Introduction
In modern search and recommendation systems, Embedding-Based Retrieval (EBR) has become the standard approach. By converting queries and documents into high-dimensional vectors, systems can identify relevant content based on semantic "closeness" in a vector space. However, scaling this approach to billion-scale corpora presents a significant challenge known as the "memory wall." Storing a billion 768-dimensional floating-point vectors requires approximately 3TB of RAM, a cost-prohibitive requirement for most organizations. While data compression techniques like quantization exist, they are typically applied after model training, often leading to a substantial loss in retrieval accuracy.
The BiDR Architecture
To address these scalability and accuracy trade-offs, the authors introduce BiDR (Bi-granular Document Representation). This framework utilizes a split-level indexing strategy that decouples the retrieval process into two distinct granularities.
As illustrated in the architecture above, every document is represented by two vectors:
- Sparse Embeddings: These are extremely compressed representations (using Product Quantization) designed to fit entirely within RAM. They are used for the initial Candidate Search (ANN) to quickly narrow down the entire corpus to a small set of $N$ candidates.
- Dense Embeddings: These are high-fidelity vectors stored on disk. Once candidates are identified, the system performs a Post Verification (Linear Scan) by fetching only the relevant dense vectors from disk for a final, precise re-ranking.
Progressive Optimization Framework
A core innovation of BiDR is its Progressive Optimization training strategy. Conventional methods often train a dense model first and then apply unsupervised quantization, which ignores the specific needs of the retrieval task. In contrast, BiDR optimizes the two layers sequentially to specialize them for different roles.
This framework consists of two primary stages:
- Stage 1 (Global Discrimination): The sparse embeddings are trained first using supervised contrastive learning (InfoNCE loss). This ensures that the initial "neighborhood" search is as accurate as possible despite the high compression ratio.
- Stage 2 (Local Discrimination): The dense embeddings are then trained specifically to distinguish the ground-truth document from the "hard" candidates shortlisted by the sparse layer.
To facilitate this, the authors utilize Locality-Centric Sampling (LCS). By building a bipartite proximity graph and using techniques like Random Walks or Snowball Sampling, they identify negative examples that are "locally concentrated" around the query in the sparse vector space, forcing the dense layer to learn fine-grained distinctions.
Experimental Results and Impact
The researchers evaluated BiDR on major benchmarks, including TREC 2019 and a massive proprietary dataset of one billion ads. The results demonstrate that BiDR effectively breaks the memory wall:
- Accuracy Gains: On the billion-scale dataset, BiDR achieved a +17.45% improvement in Recall@10 compared to state-of-the-art baselines like STAR + DiskANN.
- Resource Efficiency: The system successfully hosted a billion-scale index using only 32GB of RAM for the sparse index while maintaining a low latency of approximately 8ms per query.
- Real-World Performance: Upon deployment on a major commercial sponsored search platform, BiDR led to a +1.95% increase in revenue (RPM) and a +0.49% gain in Click-Through Rate (CTR).
Conclusion
BiDR demonstrates that high-accuracy, billion-scale retrieval does not require massive RAM investments. By specializing document representations into sparse and dense layers and optimizing them progressively, the framework achieves superior discrimination at both global and local levels. While performance remains tied to disk I/O speeds for re-ranking, the use of SSDs and efficient candidate filtering makes this a highly viable solution for modern, large-scale search engines.
Summary updated