CRINN: Contrastive Reinforcement Learning for Approximate Nearest Neighbor Search
Abstract
CRINN, a reinforcement learning-based approach, optimizes approximate nearest-neighbor search algorithms for speed while maintaining accuracy, outperforming state-of-the-art methods on several benchmarks.
Approximate nearest-neighbor search (ANNS) algorithms have become increasingly critical for recent AI applications, particularly in retrieval-augmented generation (RAG) and agent-based LLM applications. In this paper, we present CRINN, a new paradigm for ANNS algorithms. CRINN treats ANNS optimization as a reinforcement learning problem where execution speed serves as the reward signal. This approach enables the automatic generation of progressively faster ANNS implementations while maintaining accuracy constraints. Our experimental evaluation demonstrates CRINN's effectiveness across six widely-used NNS benchmark datasets. When compared against state-of-the-art open-source ANNS algorithms, CRINN achieves best performance on three of them (GIST-960-Euclidean, MNIST-784-Euclidean, and GloVe-25-angular), and tied for first place on two of them (SIFT-128-Euclidean and GloVe-25-angular). The implications of CRINN's success reach well beyond ANNS optimization: It validates that LLMs augmented with reinforcement learning can function as an effective tool for automating sophisticated algorithmic optimizations that demand specialized knowledge and labor-intensive manual refinement.Code can be found at https://github.com/deepreinforce-ai/CRINN
Community
🚀 Introducing CRINN, an open-source framework aiming to optimize approximate nearest-neighbor search algorithms for faster retrieval in RAG and agent-based applications.
📊 Performance:
🔹CRINN achieves best-in-class performance on 3 datasets and tied for first place on 2 datasets.
🔹Delivers up to 85.25% speedup on MNIST-784 at 0.999 recall, and 72.68% improvement on GIST-960 at 0.99 recall.
🌟 CRINN Highlights:
🔹 Works as a general optimization framework. CRINN can take any existing approximate nearest-neighbor search algorithm as a starting point.
🔹It discovers optimization strategies like adaptive search with dynamic EF scaling, zero-overhead multi-level prefetching, etc.
🔹Trained on Euclidean distance (SIFT-128), and generalizes well to angular distance datasets.
This is an automated message from the Librarian Bot. I found the following papers similar to this paper.
The following papers were recommended by the Semantic Scholar API
- CUDA-L1: Improving CUDA Optimization via Contrastive Reinforcement Learning (2025)
- PathWeaver: A High-Throughput Multi-GPU System for Graph-Based Approximate Nearest Neighbor Search (2025)
- EnhanceGraph: A Continuously Enhanced Graph-based Index for High-dimensional Approximate Nearest Neighbor Search (2025)
- Benchmarking Filtered Approximate Nearest Neighbor Search Algorithms on Transformer-based Embedding Vectors (2025)
- GHPO: Adaptive Guidance for Stable and Efficient LLM Reinforcement Learning (2025)
- AutoTriton: Automatic Triton Programming with Reinforcement Learning in LLMs (2025)
- Multi-Agent Reinforcement Learning for Sample-Efficient Deep Neural Network Mapping (2025)
Please give a thumbs up to this comment if you found it helpful!
If you want recommendations for any Paper on Hugging Face checkout this Space
You can directly ask Librarian Bot for paper recommendations by tagging it in a comment:
@librarian-bot
recommend
Models citing this paper 0
No model linking this paper
Datasets citing this paper 0
No dataset linking this paper
Spaces citing this paper 0
No Space linking this paper