Abstract
Approximate Nearest Neighbor Search (ANNS) is critical for modern retrieval systems, yet the impact of dynamic data deletion on graph-based indexes remains under-explored. This paper formalizes three deletion strategies—logical, physical, and rebuilding—and proposes a "Deletion Control" algorithm to maintain search accuracy efficiently. Our findings highlight the trade-offs between immediate deletion latency and long-term search performance, providing a framework for more realistic evaluation of dynamic vector databases.
Introduction
Approximate Nearest Neighbor Search (ANNS) serves as the backbone for Retrieval-Augmented Generation (RAG) and recommendation engines. While static index construction is well-understood, real-world data is inherently dynamic, requiring frequent deletions as products go out of stock or documents are retired. In graph-based indexes like HNSW, deleting a node is non-trivial; simply removing a vertex can disrupt graph connectivity, leading to "unreachable" regions and degraded search accuracy. This work addresses the lack of standardized evaluation for deletions in graph-based ANNS.
Deletion Strategies
The authors categorize and mathematically formalize three primary strategies for handling data removal:
- Logical Deletion: Nodes are flagged as deleted but remain in the graph structure. Search algorithms ignore flagged results. This method offers extremely low deletion latency but leads to "ghost" nodes that eventually impede search speed and increase memory usage.
- Physical Deletion: Nodes and their associated edges are removed from the index. While more memory-efficient than logical deletion, it can compromise the graph's structural integrity if the resulting "holes" are not repaired.
- Rebuilding: The index is periodically reconstructed from scratch using the remaining dataset. This ensures optimal search performance at the cost of high computational overhead and significant update latency.
To balance these trade-offs, the authors introduce Deletion Control, a hybrid strategy that utilizes logical deletion until search accuracy (monitored via a small training set) falls below a threshold $\alpha$, at which point a full rebuild is triggered.
Experimental Evaluation
The study utilizes several industry-standard benchmarks, including SIFT1M, GIST1M, DEEP1M, and Glove100Angular. For large-scale testing, a 2-million-point subset of SIFT1B was used to simulate continuous insertion and deletion workloads.
Search Accuracy and Stability
A key finding is the distinct behavior of recall over time across different strategies. Logical deletion exhibits a linear decline in accuracy as the proportion of "ghost" nodes increases. Conversely, physical deletion initially causes a drop in recall but eventually stabilizes at a new equilibrium, suggesting the graph structure adapts to the removals.
Performance Trade-offs
In terms of deletion speed, logical deletion is the clear winner, achieving approximately $10^9$ operations per second. Physical deletion is significantly slower due to the overhead of managing memory and pointers. However, when considering search throughput (QPS) versus accuracy, rebuilding remains the gold standard, providing the best Pareto frontier for high-recall requirements.
Key Insights
- The "Ghost" Problem: Logical deletion is a "buy now, pay later" approach. While it offers near-instant updates, the persistent flagged nodes eventually degrade search throughput by forcing the algorithm to traverse irrelevant data.
- Equilibrium in Physical Deletion: The stabilization of accuracy in physical deletion suggests that graph-based indexes can maintain a functional structure even with simple node removal, provided the initial graph was sufficiently robust.
- Context-Dependent Selection: The optimal strategy depends on the application's recall requirements. High-precision requirements (e.g., >99% recall) necessitate periodic rebuilding, whereas applications tolerant of slight accuracy dips can benefit from the efficiency of physical deletion.
Conclusion and Future Work
The proposed Deletion Control algorithm effectively maintains search accuracy above target thresholds while minimizing the total time spent on index maintenance. Future research should extend this evaluation to other graph-based or hybrid index architectures and explore the sensitivity of Deletion Control parameters under shifting data distributions in production environments.
Summary updated