CRINN: Contrastive Reinforcement Learning for Approximate Nearest Neighbor Search
On the map: Retrieval-augmented generation → Agentic RAG, agents and memory
Abstract (arXiv)
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/ornith-ai/CRINN
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in Agentic RAG, agents and memory, one of 15 directions in Retrieval-augmented generation. Builds on 18 of its 27 references that are in the map. First posted on arXiv 4 Aug 2025.
Builds on
18 of 27 references.
References · 18
- 2024DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Modelscited by 9,379
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,297
- 2023Generative Agents: Interactive Simulacra of Human Behaviorcited by 3,568
- 2020REALM: Retrieval-Augmented Language Model Pre-Trainingcited by 2,141
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
- 2016Efficient and robust approximate nearest neighbor search using Hierarchical Navigable Small World graphscited by 861
- 2024The Faiss librarycited by 376
- 2024RLEF: Grounding Code LLMs in Execution Feedback with Reinforcement Learningcited by 151
- 2018ANN-Benchmarks: A Benchmarking Tool for Approximate Nearest Neighbor Algorithmscited by 130
- 2017Fast Approximate Nearest Neighbor Search With The Navigating Spreading-out Graphcited by 104
- 2023Execution-based Code Generation using Deep Reinforcement Learningcited by 99
- 2025CUDA-L1: Improving CUDA Optimization via Contrastive Reinforcement Learningcited by 61
6 more
- 2024Meta Large Language Model Compiler: Foundation Models of Compiler Optimizationcited by 39
- 2021Fast Nearest Neighbor Machine Translationcited by 37
- 2025CUDA-LLM: LLMs Can Write Efficient CUDA Kernelscited by 34
- 2023ParlayANN: Scalable and Deterministic Parallel Graph-Based Approximate Nearest Neighbor Search Algorithmscited by 24
- 2019The Design and Implementation of a Real Time Visual Search System on JD E-commerce Platformcited by 16
- 2023Relative NN-Descent: A Fast Index Construction for Graph-Based Approximate Nearest Neighbor Searchcited by 4
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2025Optimizing Retrieval for RAG via Reinforcement Learning
- 2025A Comprehensive Survey on Reinforcement Learning-based Agentic Search: Foundations, Roles, Optimizations, Evaluations, and Applications
- 2026AutoSearch: Adaptive Search Depth for Efficient Agentic RAG via Reinforcement Learning
- 2025WebSeer: Training Deeper Search Agents through Reinforcement Learning with Self-Reflection
- 2025Search Wisely: Mitigating Sub-optimal Agentic Searches By Reducing Uncertainty
- 2026PROGRESS: Coverage-guided RL to Train Search-augmented LLM Agent
- 2026When should I search more: Adaptive Complex Query Optimization with Reinforcement Learning
- 2026RAPO: Expanding Exploration for LLM Agents via Retrieval-Augmented Policy Optimization