Papers
arxiv:2508.02091

CRINN: Contrastive Reinforcement Learning for Approximate Nearest Neighbor Search

Published on Aug 4
· Submitted by xxiaoyali on Aug 6
Authors:
,
,
,
,

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.

AI-generated summary

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

Paper submitter

🚀 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

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

Sign up or log in to comment

Models citing this paper 0

No model linking this paper

Cite arxiv.org/abs/2508.02091 in a model README.md to link it from this page.

Datasets citing this paper 0

No dataset linking this paper

Cite arxiv.org/abs/2508.02091 in a dataset README.md to link it from this page.

Spaces citing this paper 0

No Space linking this paper

Cite arxiv.org/abs/2508.02091 in a Space README.md to link it from this page.

Collections including this paper 1