[Paper Review] Towards Similarity Graphs Constructed by Deep Reinforcement Learning
This paper proposes a reinforcement learning (RL)-based method to construct similarity graphs that explicitly optimize search efficiency by learning edge probabilities in the adjacency matrix. By framing graph construction as an RL problem, the method improves recall over heuristic baselines with the same number of distance computations, achieving state-of-the-art performance on multiple benchmarks, including a 0.4% gain at 88% Recall@1 on GloVe1M.
Similarity graphs are an active research direction for the nearest neighbor search (NNS) problem. New algorithms for similarity graph construction are continuously being proposed and analyzed by both theoreticians and practitioners. However, existing construction algorithms are mostly based on heuristics and do not explicitly maximize the target performance measure, i.e., search recall. Therefore, at the moment it is not clear whether the performance of similarity graphs has plateaued or more effective graphs can be constructed with more theoretically grounded methods. In this paper, we introduce a new principled algorithm, based on adjacency matrix optimization, which explicitly maximizes search efficiency. Namely, we propose a probabilistic model of a similarity graph defined in terms of its edge probabilities and show how to learn these probabilities from data as a reinforcement learning task. As confirmed by experiments, the proposed construction method can be used to refine the state-of-the-art similarity graphs, achieving higher recall rates for the same number of distance computations. Furthermore, we analyze the learned graphs and reveal the structural properties that are responsible for more efficient search.
Motivation & Objective
- To address the lack of theoretically grounded methods for similarity graph construction, which currently rely on heuristic procedures with limited generalization.
- To explicitly optimize graph structure for nearest neighbor search (NNS) performance by maximizing search recall under fixed computational budgets.
- To investigate whether reinforcement learning can be effectively applied to large-scale graph construction for NNS, improving upon existing heuristic-based approaches.
- To analyze the structural properties of learned graphs that contribute to improved search efficiency.
Proposed method
- The method models a similarity graph probabilistically using edge probabilities derived from the adjacency matrix.
- It formulates graph construction as a reinforcement learning task, where the agent learns to optimize edge probabilities to maximize search recall over a set of training queries.
- The RL agent is trained using a policy gradient approach to adjust edge probabilities based on feedback from search performance.
- The approach is applied as a refinement step to existing graphs (e.g., NSW, HNSW), improving their navigation properties without altering the underlying data structure.
- Graph properties are analyzed by measuring vertex visit frequencies to identify specialized navigation hubs.
- A magnitude-based pruning baseline is used for comparison, where edge weights are derived from visitation frequencies and a threshold is tuned for optimal performance.
Experimental results
Research questions
- RQ1Can reinforcement learning be effectively used to optimize similarity graph structure for nearest neighbor search, beyond heuristic-based methods?
- RQ2What structural properties of graphs contribute to improved search efficiency, and can they be learned automatically?
- RQ3Does explicitly optimizing for search recall lead to measurable gains in recall@k across diverse datasets?
- RQ4How does the proposed method compare to heuristic refinement techniques like magnitude-based pruning?
- RQ5To what extent do the learned graphs exhibit specialized navigation vertices, and how does this relate to performance gains?
Key findings
- The RL-based method improves search recall across all datasets, with gains of up to 0.4% at 88% Recall@1 on the challenging GloVe1M dataset.
- On all datasets, the optimized NSW graph outperforms or matches HNSW, suggesting that the hierarchical structure in HNSW may be redundant when better navigation is achieved through optimized edges.
- The learned graphs exhibit a more peaky distribution of vertex visit frequencies, indicating the emergence of specialized navigation hubs that guide search more effectively.
- The RL agent learns to select a single optimal starting vertex for each query, reducing initial exploration cost to just one distance computation.
- Magnitude-based pruning, while effective, is outperformed by the RL method across all distance computation budgets on DEEP1M.
- Applying magnitude pruning after RL refinement further improves performance, indicating that the two methods are complementary.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.