Abstract
Recently, retrieval systems based on dense representations have led to important improvements in open-domain question answering, and related tasks. While very effective, this approach is also memory intensive, as the dense vectors for the whole knowledge source need to be kept in memory. In this paper, we study how the memory footprint of dense retriever-reader systems can be reduced. We consider three strategies to reduce the index size: dimension reduction, vector quantization and passage filtering. We evaluate our approach on two question answering benchmarks: TriviaQA and NaturalQuestions, showing that it is possible to get competitive systems using less than 6Gb of memory.
Introduction
Modern Open-Domain Question Answering (ODQA) systems typically follow a "retriever-reader" architecture. A dense retriever first identifies relevant passages from a massive knowledge base like Wikipedia using neural network embeddings. Subsequently, a reader model extracts or generates the final answer. While dense retrievers are significantly more accurate than traditional keyword-based methods, they are notoriously memory-intensive. Storing a standard dense index of Wikipedia can require upwards of 80GB of RAM, as every passage must be represented as a high-dimensional vector. This memory bottleneck limits the deployment of state-of-the-art ODQA systems on consumer-grade hardware or mobile devices.
Methodology
The researchers propose a three-pronged strategy to compress the retrieval index without significantly sacrificing performance:
1. Dimension Reduction and Distillation
Standard dense retrievers often use 768-dimensional vectors. The authors reduce this footprint by adding a linear layer and LayerNorm during training to project embeddings into lower-dimensional spaces (e.g., 128 or 256 dimensions). To maintain accuracy, they use knowledge distillation, where a powerful reader model "teaches" the retriever which passages are most important.
2. Product Quantization (PQ)
Product Quantization is a lossy compression technique that decomposes vectors into sub-vectors and represents them using a set of learned centroids. This allows dimensions to be represented with as few as 1 or 2 bits, drastically reducing the storage required for each vector.
3. Passage Filtering
Not all content in a massive knowledge base is relevant for question answering. The authors trained a linear classifier to identify and discard "unlikely" articles based on metadata like titles and categories. This pruning step reduces the search space before index construction, effectively removing "dead weight" from Wikipedia.
Experimental Setup
The proposed methods were evaluated on two benchmark datasets:
- NaturalQuestions (NQ): Comprising real Google search queries with answers derived from Wikipedia.
- TriviaQA: A dataset of question-answer-evidence triples authored by trivia enthusiasts.
The reader component utilized the Fusion-in-Decoder (FiD) architecture, which is robust at synthesizing answers from multiple retrieved passages.
Key Results and Insights
The study reveals that dimension reduction and quantization are highly complementary. The best results are achieved by balancing moderate dimension reduction with aggressive quantization, rather than pushing either technique to its extreme.
As shown in the figures above, the researchers established a Pareto frontier for the accuracy-to-memory trade-off. Key findings include:
- Significant Compression: The "Topline" model (81GB) was compressed to a "Compressed Large" version requiring only 5.1GB—a 16x reduction.
- Minimal Performance Loss: On NaturalQuestions, the Exact Match (EM) score dropped only slightly from 54.7 (81GB model) to 53.6 (5.1GB model).
- Extreme Efficiency: A "Compressed Base" model was developed that fits within 2.1GB, making it suitable for high-end mobile devices or low-cost cloud instances.
Conclusion and Future Work
This work demonstrates that the massive memory requirements of dense ODQA systems can be mitigated through strategic compression. While the memory bottleneck is addressed, the authors note that training these models remains computationally expensive. Furthermore, while the index is small, retrieval latency with Product Quantization can be higher than with raw vectors. Future research may focus on end-to-end training of quantization schemes to further optimize the compression-performance trade-off.
Summary updated