TL;DR
HorizANN is a distributed graph-based vector search system that allows you to add or remove server nodes on the fly without rebuilding your index from scratch. By introducing "ghost edges"—dormant links that preserve graph connectivity across server boundaries—it achieves high-throughput, billion-scale search with near-perfect recall and zero downtime during scaling.
What Problem Does This Paper Address?
Approximate Nearest Neighbor Search (ANNS) is the engine behind modern AI, powering everything from Retrieval-Augmented Generation (RAG) to recommendation systems. Currently, graph-based indexes (like HNSW) are the gold standard because they offer the best trade-off between speed and accuracy.
However, these indexes are "horizontally inelastic." Because graph nodes are physically linked to their neighbors by edges, partitioning a graph across multiple servers is brittle. If you need to add a new server to handle more data, you typically have to repartition the entire dataset and rebuild the graph indexes from the ground up. At the billion-vector scale, this reconstruction can take hours or days, leading to massive compute costs and service interruptions.
The authors identify two main hurdles:
- Structural Dependency: Moving a vector to a new server severs its edges to neighbors remaining on the old server, "fracturing" the graph and tanking search recall.
- Routing Bottlenecks: In a distributed system, broadcasting every query to every server wastes resources, but "under-routing" risks missing the best results.
Methods
HorizANN introduces a manager-worker architecture designed for "elasticity." Its core innovation is the Ghost Edge mechanism.
- Ghost Edges: When a vector is inserted or moved, HorizANN identifies neighbors that live on other workers. Instead of discarding these cross-partition links, it stores them as "ghost edges." These edges are ignored during active searches (to avoid slow network hops) but are kept on disk.
- Split-and-Merge Repartitioning: When the cluster size changes, HorizANN uses a "split-and-merge" algorithm. Workers split their local indexes and send the relevant pieces to new nodes. If a vector and its "ghost" neighbor end up on the same worker after the move, the ghost edge is "reactivated" into a standard, searchable edge. This avoids the need to re-run expensive neighbor discovery searches.
- Selective Query Routing: To avoid broadcasting, the main node maintains a "seed index"—a tiny (0.01%) reservoir sample of the total data. Queries first probe this seed index to identify which specific workers are likely to hold the nearest neighbors, ensuring high throughput.
- Online Repartitioning Protocol: The system uses an epoch-based versioning system. It can build a new index configuration in the background while the old one continues to serve queries, switching over only when the new partitions are ready.
Datasets
The authors evaluated HorizANN on three billion-scale datasets:
- SIFT1B: 1 billion vectors (128-dim), a standard industry benchmark.
- SPACEV1B: 1 billion vectors (100-dim) from Microsoft’s Big-ANN challenge.
- IBM1B: A synthetic dataset of 1 billion vectors (128-dim) modeled after real-world embeddings.
- HotpotQA: Used to demonstrate how retrieval recall directly impacts the accuracy of downstream LLM reasoning in RAG pipelines.
Key Insights and Ideas
- The "Aha" Moment for Ghost Edges: The most expensive part of building a graph index isn't storing the edges; it's the search required to find which vectors should be neighbors. By preserving that structural information as "ghosts," HorizANN effectively "remembers" the graph's shape even when it's physically broken apart.
- Quadratic Recall Decay: The paper quantifies a critical reality for RAG developers: in multi-hop reasoning tasks, downstream accuracy decays quadratically ($r^2$) relative to retrieval recall ($r$). This highlights why maintaining ultra-high recall (0.99+) is non-negotiable for complex AI tasks.
- Sample-Based Routing: They prove that a simple reservoir sample is a more robust routing mechanism than traditional centroid-based routing, especially as partitions grow large and internally heterogeneous.
Key Results
- Scalability: HorizANN successfully scaled from 100M vectors on one worker to 1B vectors on ten workers. It maintained a consistent insertion time of roughly 2.5 hours per 100M vectors.
- Search Performance: At 1B scale, it sustained 3.4–3.5K queries per second (QPS) while maintaining a 0.998 Recall@10.
- Efficiency: Repartitioning (adding a node) took only 15% of the total build time, whereas baseline systems like SPTAG and Harmony either timed out or ran out of memory before reaching the 1B mark.
- Low Overhead: Storing ghost edges added only 11–16% memory overhead, a small price to pay for the ability to scale elastically.
Limitations and Future Work
- Ghost Edge Accumulation: As the dataset grows and repartitions occur, the number of ghost edges stored on disk increases. While currently manageable, the authors note that for 10B+ scales, they may need to implement a strategy to "prune" ghost edges that are unlikely to ever be reactivated.
- Repartitioning vs. Insertion Time: In extreme scenarios (very high worker counts), the time spent moving data during repartitioning might eventually exceed the time spent on raw insertion. Optimizing the data transfer layer remains a target for future iterations.
Summary updated