Evolving Pinterest’s Embedding Retrieval Platform
Pinterest is evolving Manas, its in-house distributed search platform serving billions of embeddings across 80+ clusters, along three fronts: quantization, SSD-based ANN serving, and multi-embedding retrieval. Benchmarks on 100M embeddings showed PQ shrinks indices by 74–93% with 70–80% recall, while SQ cuts 59–75% with over 90% recall. Rolling both out per use case after A/B tests yielded 20–30% serving cost savings, and SIMD-based Linear Scaling SQ trimmed per-query compute by 10–15%. For SSD serving, SPANN with PQ-compressed posting lists and full-precision centroids beat DiskANN by 3x QPS at 1/3 the latency, and saved over 40% CPU versus HNSW on a 5B-embedding index with under 5% recall loss. Manas now also supports ColBERT-style late-interaction queries scored with Sum of MaxSim.
Related posts
- Dense Retrieval
Vinted Engineering hardMasterVinted added embedding-based dense retrieval to its multilingual, highly visual marketplace search using a two-tower model: a fine-tuned projection head on frozen multilingual CLIP for queries, and an item tower fusing CLIP image embeddings with categorical metadata, trained contrastively on 100M+ pairs. Everything runs inside Vespa with separate query and feed containers, HNSW indexes split per market bloc, tuned exact-vs-approximate thresholds, and a 350/150 ms approximate-then-exact retry that eliminated most timeouts. Because Vespa's targetHits is a per-node target rather than a limit, filters could increase result counts. A global-phase ranking trick using reciprocal rank fusion, a constant boolean field to detect interpretation matches, and rank-score-drop-limit caps how many nearest-neighbor-only matches are added. Switching the query containers to GraalVM with ZGC cut tail latencies by double-digit percentages.
- Binary and Scalar Embedding Quantization for Significantly Faster & Cheaper Retrieval
Hugging Face mediumAdeptQuantizing embeddings themselves, rather than model weights, sharply cuts retrieval memory, disk and cost. Binary quantization thresholds normalized float32 values at 0 to give 32x smaller vectors searched by Hamming distance, while scalar int8 quantization uses per-dimension min/max ranges from a calibration set to give 4x savings. On MTEB retrieval, mxbai-embed-large-v1 keeps about 96% of NDCG@10 with binary embeddings plus float32-query rescoring, and 97% with int8. A combined pipeline does a binary in-memory search, then rescores the top candidates with int8 embeddings loaded from disk, serving 41M Wikipedia texts with 5.2GB of memory instead of about 200GB. Sentence Transformers code and vector database support tables are included.
- SilverTorch: Index as Model — A New Retrieval Paradigm for Recommendation Systems
Meta Engineering hardMasterSilverTorch replaces Meta's microservice-based recommendation retrieval with "Index as Model": the item index, eligibility filter, ANN search, neural reranker and multi-task scorer all become tensors or nn.Modules inside a single PyTorch model served on GPUs in one forward pass. Folding everything into one model removes network hops and version skew between user tower and index, and lets the stages be co-designed. Two examples are a Bloom-signature filter that replaces GPU-unfriendly inverted indexes, and a fused Int8 ANN kernel that supports top-k in the hundreds of thousands. On an 80M-item production replay, SilverTorch delivered 23.7x the throughput of a multi-service baseline and 20.9x the cost efficiency of FAISS-CPU (13.35x with reranking), with no measured recall loss, and it cut the time to ship retrieval changes from weeks to days.
- On-disk HNSW index for Postgres with pg_embedding
Neon mediumAdept
pg_embedding's new version builds its HNSW vector index on disk rather than in memory and adds cosine, Manhattan and Euclidean (L2) distance support. Benchmarks on an 8 vCPU / 32 GB machine show the in-memory index is roughly 2x faster, but persisting the index lets it work with Neon's autoscaling, scale-to-zero and read replicas for read-heavy similarity search. The post walks through enabling the extension, storing embeddings as real[] and tuning the index parameters dims, m, efConstruction and efSearch, where efSearch should be at least the query's LIMIT k. Neon has since discontinued pg_embedding and recommends pgvector instead.
- Matryoshka embeddings: faster OpenAI vector search using Adaptive Retrieval
Supabase mediumAdeptOpenAI's text-embedding-3 models are trained with Matryoshka Representation Learning, so an embedding can be shortened by truncating trailing dimensions and renormalizing, which reproduces the API's `dimensions` output. Adaptive Retrieval exploits this with a two-pass search: a fast HNSW-indexed ANN pass on a low-dimensional prefix fetches an oversized shortlist, then exact KNN on the full 3072d vectors re-ranks it. Benchmarks on 1M dbpedia embeddings found a 512d first pass (ef_construction=400, m=32, ef_search=200, limit = top_k × 8) reached 99% accuracy against 3072d KNN at about 580 QPS. By comparison, a single pass on 1536d vectors topped out near 89%. The post finishes with a Postgres/pgvector implementation using a sub_vector SQL function.