Faster Retrieval for Better, More Efficient RAG machinelearning.apple.com · 61 p...
HN Best 200 @best
Faster Retrieval for Better, More Efficient RAG machinelearning.apple.com · 61 points · 6 comments · HN thread
TL;DR Apple researchers present amortized maximum inner product search (MIPS), training small neural networks offline on a fixed key database and a known query distribution to route queries to their best match faster. Two variants are proposed: SupportNet, which learns per-cluster support functions for better routing, and KeyNet, which predicts the best key vector and can act as a query rewriter in front of standard IVF indexes. The work is reported as a paper at ICML 2026, with latency and recall gains on Natural Questions.
- MIPS finds the database key with the largest inner product to a query; it underlies recommendation, search and RAG.
- Centroid routing in IVF indexes can miss the true best match when a cluster holds an outlier key far from its centroid.
- SupportNet learns each cluster's support function and routes queries by the largest score; on Natural Questions split into 128 clusters, the small model hits 95% routing recall about 1.9x faster than centroid routing (1.74 ms vs 3.36 ms).
- KeyNet predicts the best-matching key from the query and can rewrite queries for a standard FAISS IVF index; reaching 99% recall takes up to about 8x less wall-clock time (0.23 ms vs 1.8 ms) with the largest model.
- Both networks are trained by regression on queries sampled from the expected query distribution, with ground truth computed by exhaustive search once offline.
- The authors suggest SupportNet when calibrated scores are needed and KeyNet when inference speed matters most.
Discussion The thread is short and mostly skeptical of RAG rather than of the paper itself. Commenters question whether retrieval biases LLMs toward heuristic results, and one raises the classic suggestion to just use grep. Replies push back that grep cannot handle meaning, typos or multiple languages, and that hybrid vector search is needed at scale with latency targets. The tone is practical and somewhat wry, with commenters sharing their own experience of when retrieval helps and when it hurts.
- Retrieval can bias LLMs toward weak heuristic results (some): One commenter argues that retrieval systems with a shallow understanding of the domain push LLMs toward poor answers, and that letting the model explore without retrieval bias gives better output quality, based on personal experience.
- Grep is too limited for production RAG (some): Replying to a grep suggestion, one commenter says grep cannot search by meaning, across languages or with typos, and does not scale to terabytes across distributed servers under about 1000 ms, where hybrid vector search is needed.
- Latency is the main reason to use retrieval (a few): One commenter says latency is often the reason for retrieval, with distilling interactions into better retrieval as the second reason.
- Let the LLM build the query for huge datasets (a few): A commenter suggests that when data is this large, the LLM itself could construct the query rather than relying on fixed retrieval.
- Semantic folding handles unnormalized data well (a few): One commenter reports from experience that with very large, totally unnormalized datasets, semantic folding is a silver bullet.
#RAG #vectorSearch #MIPS #approximateNearestNeighbor #AppleResearch #retrieval