First-hand information for everyone
Graph‑based approximate nearest‑neighbor (ANN) indexes, such as HNSW, underpin today’s vector search. The number of edge links is now the main memory cost, not the vectors themselves. A new compression scheme tackles that. It reorders the graph with a lightweight offline permuter, then gap‑encodes and feeds the data into a SIMD‑accelerated integer compressor (Stream VByte). The offset array that marks list starts is shrunk with Elias‑Fano, keeping random‑access speed high. Tests on real workloads show that the method cuts edge storage by up to 52.7 % while adding almost no latency over an uncompressed build. In a production eBay system the savings reach 44.3 % with identical query times.
The approach shines on dense, low‑degree graphs like HNSW. Reference‑based compression (e.g., WebGraph) offers little benefit because the adjacency lists never overlap enough. Even after permuting, the edge‑gap values remain largely uniform, so simple gap packing barely beats raw bit‑packing, which will keep the allocation above the theoretical entropy bound. The permutation step itself takes extra time – between a few percent and a third of the total build time depending on data size.
Overall, the method provides a practical, low‑overhead way to shrink ANN index size while keeping search latency unchanged, but it depends on a computationally cheap offline reorder and works best on the high‑dimensional, sparse graphs that HNSW typically handles.