CRINN: Contrastive Reinforcement Learning for Approximate Nearest Neighbor Search

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

Link
https://arxiv.org/abs/2508.02091
Found by
arXiv
Authors
Xiaoya Li, Albert Wang, Guoyin Wang, Chris Shum, Jiwei Li
Categories
benchmark, evaluation, dataset
Published
2026-11-13
Last seen by the radar
2026-11-13
Radar score
57.04 / 100 (how it is scored)
Why it scored so
Matched: benchmark, dataset, evaluat; Primary record: arXiv
Is this record right? If you made this work and something here is wrong or missing, tell us what to fix.

More records found by arXiv