Technology
Pinterest Cuts Vector Search Costs 30% by Moving to Quantized, SSD-Based Index Architecture
The company overhauled its Manas search platform to handle billions of embeddings more efficiently, scaling from memory-intensive algorithms to compressed quantization and disk-resident indexes.
InfoQ
Pinterest has significantly rearchitected its distributed search platform to reduce the memory and compute costs of serving vector embeddings at scale. The changes to Manas—which powers the Home Feed, Search, Related Pins, Ads, and Notifications across 80 clusters—come as the company's embedding corpus has grown to tens of billions of items, outpacing the efficiency of traditional in-memory vector indexes like HNSW.
Compression Through Quantization#
The core insight was that not every embedding needs to be stored at full floating-point precision. Pinterest implemented two complementary compression strategies:
- Scalar Quantization (SQ) converts vector components into low-bit integers, shrinking HNSW indices by 59% and Inverted File (IVF) indices by 75% while maintaining over 90% recall.
- Product Quantization (PQ) compresses floating-point vectors into compact byte codes, achieving even tighter compression: 74% reduction on HNSW and 93% on IVF, though at a cost to recall (70–80% range).
In offline benchmarks on a 100-million-embedding dataset, HNSW with SQ achieved a 50 GB footprint while returning 92.92% of top-100 results—nearly matching the baseline HNSW's 93.72% recall at the original 121 GB. The team also optimized the decompression path using SIMD intrinsics, cutting query compute overhead by 10–15%.
SSD-Resident Indexes#
To push beyond RAM constraints entirely, Pinterest evaluated disk-resident approaches. Testing showed that SPANN (Microsoft's scalable approximate nearest-neighbor algorithm) paired with PQ outperformed the alternative DiskANN method, delivering 3x higher query throughput at 1/3 the latency with only a minor 5% recall penalty.
The architecture keeps a small, fast centroid index in memory to identify relevant partitions, while storing the bulk of data on high-throughput SSDs. In a real-world Pin recommendation experiment over 5 billion embeddings, this hybrid approach saved more than 40% CPU time compared to keeping the full HNSW index in memory.
Production Impact and Future Directions#
Online deployments of both SQ and PQ realized 20–30% serving cost savings across production workloads. The team is now exploring richer matching models: moving beyond single-vector representations toward multi-vector approaches like ColBERT, which use token-level scoring to capture finer-grained relevance. A pilot with an internal team is underway to test the updated Manas query parser and simultaneous ANN searches across multiple embedding indices.

