Abstract
Text retrieval using learned sparse representations of queries and documents has evolved into a highly effective approach to search. Recent advances in approximate nearest neighbor search, such as the inverted index-based Seismic and graph-based Hnsw, have made retrieval with sparse representations viable in practice. In this work, we scrutinize the efficiency of sparse retrieval algorithms, focusing on the forward index—a data structure common to all algorithmic flavors that constitutes a substantial fraction of the overall index size. We seek compression techniques to reduce the storage footprint of the forward index without compromising search quality or inner product computation latency. In our examination of various integer compression techniques, we report that StreamVByte achieves the best trade-off between memory footprint, retrieval accuracy, and latency. We then improve StreamVByte by introducing DotVByte, a new algorithm tailored to inner product computation. Experiments on MS MARCO show that our improvements lead to significant space savings while maintaining retrieval efficiency.
The Challenge of Forward Index Storage
In modern information retrieval, Large Language Models (LLMs) are frequently employed to create "learned sparse representations" of text, such as those produced by the SPLADE model. These models map documents into high-dimensional spaces where most values are zero, offering high interpretability and effective handling of vocabulary mismatches.
However, searching these sparse vectors efficiently requires Approximate Nearest Neighbor Search (ANNS) algorithms like SEISMIC or HNSW, which rely heavily on a forward index. This massive data structure maps document IDs to their non-zero vector coordinates (components) and weights (values). Because the forward index is used to compute exact inner products to re-rank search candidates, it must be extremely fast. Storing millions of 16-bit components and floating-point values consumes prohibitive amounts of RAM, necessitating compression techniques that do not sacrifice query latency.
Compression Methods and Document Reordering
We evaluated several standard integer compression techniques, including VByte, Elias Gamma, Zeta, and StreamVByte, specifically for the forward index's components array. These methods were paired with Recursive Graph Bisection (RGB), a technique that reorders documents to minimize numerical gaps between components, thereby enhancing compressibility.
Our findings indicate that document reordering via RGB provides a "free lunch": it improved compression ratios by up to 27% and simultaneously accelerated decompression, as smaller numerical gaps are faster for the CPU to decode. While StreamVByte offered the best baseline balance of speed and size, it still required decompressing data into an intermediate buffer before computation.
DotVByte: Fusing Decompression and Computation
To address the limitations of standard StreamVByte, we introduced DotVByte. Unlike standard approaches that decompress data into a buffer, DotVByte is custom-tailored for inner-product computation using SIMD (Single Instruction, Multiple Data) registers. It decompresses components, gathers query values, multiplies them by document values, and accumulates the results in a single fused sequence of operations directly within CPU registers. This approach bypasses the memory bandwidth bottleneck associated with intermediate buffers. Additionally, DotVByte enforces strict document alignment to prevent unnecessary decompression of adjacent document data.
Experimental Results
We tested our methods on the MS MARCO passage retrieval benchmark using two models: the widely-used SPLADE and the denser LiLSR (Learned Inference-Free) model. We found that value compression is straightforward; reducing weights from 16-bit floats (float16) to 8-bit fixed-point integers (fixedU8) halved storage size with negligible impact on accuracy.
Key performance metrics include:
- Speed: DotVByte scans the MS MARCO dataset in 0.36 seconds—only 20% slower than an uncompressed index and over 3x faster than standard StreamVByte.
- Efficiency: For the SPLADE model at 90% accuracy, DotVByte (with
fixedU8) reduces the index size from 5.8 GB to 4.2 GB while maintaining a latency of 156 µs (comparable to the uncompressed 157 µs). - Scalability: On the denser LiLSR embeddings, DotVByte maintained low query latency (662 µs vs. 670 µs uncompressed) while reducing index size from 14.3 GB to 11.7 GB.
Conclusion
DotVByte significantly shrinks the memory footprint of forward indexes without compromising the speed of inner-product computations. While highly effective, future work will explore "sub-byte" capabilities to better compress the small, frequent gaps between components, potentially further reducing the memory footprint of learned sparse retrieval systems.
Summary updated