---
title: "Faster Retrieval for Better, More Efficient RAG"
description: "Maximum inner product search can be amortized by training small neural networks offline on a known query distribution, exploiting the fact that the max-inner-product function is the convex support function of the key set, whose gradient is the best-matching key."
url: "https://swe.quest/articles/faster-retrieval-for-better-more-efficient-rag-d17d027c0d4bf4d2"
canonical: "https://machinelearning.apple.com/research/faster-retrieval"
source: "Apple Machine Learning Research"
published: "2026-11-05"
difficulty: "hard"
kind: "Research"
reading_minutes: 12
tags: ["vector-search","rag","machine-learning","search","performance"]
---

# Faster Retrieval for Better, More Efficient RAG

A post on [Apple Machine Learning Research](https://swe.quest/sources/apple-ml.md), published 2026-11-05, 12 min read, Research. Original: [https://machinelearning.apple.com/research/faster-retrieval](https://machinelearning.apple.com/research/faster-retrieval)

## Summary

Maximum inner product search can be amortized by training small neural networks offline on a known query distribution, exploiting the fact that the max-inner-product function is the convex support function of the key set, whose gradient is the best-matching key. SupportNet, a loosely constrained input convex neural network, learns per-cluster support functions to replace centroid routing in IVF indexes. On Natural Questions (~2.6M passages, 128 clusters) it reaches 95% routing recall about 1.9× faster than centroids. KeyNet maps a query to its predicted best key as a query rewriter in front of a FAISS IVF index, reaching 99% recall up to ~8× faster and scanning ~11× fewer keys. Use KeyNet when speed is the bottleneck, and SupportNet when calibrated scores are needed or models must be small.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Vector search](https://swe.quest/tags/vector-search.md) (Data & databases)
- [RAG & retrieval](https://swe.quest/tags/rag.md) (AI & ML)
- [Machine learning](https://swe.quest/tags/machine-learning.md) (AI & ML)
- [Search](https://swe.quest/tags/search.md) (Backend & APIs)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)

## Prerequisites

- vector embeddings ([easy posts on RAG & retrieval](https://swe.quest/tags/rag.md?difficulty=easy))
- inverted file (IVF) indexes
- neural network regression
- convex functions

## Keywords

Maximum Inner Product Search, SupportNet, KeyNet, Input Convex Neural Networks, FAISS, Natural Questions, ICML 2026

## Related posts

- [pgvector v0.5.0: Faster semantic search with HNSW indexes](https://swe.quest/articles/pgvector-v0-5-0-faster-semantic-search-with-hnsw-indexes-d1e5c38ac44f551e.md): Supabase · 2023-09-06 · Medium · 6 min read · Vector search, PostgreSQL, Performance engineering, Algorithms
  pgvector v0.5.0 adds HNSW indexes, which combine skip-list-style layering with navigable small world proximity graphs to do approximate nearest-neighbor search over embeddings.
- [Understanding vector search and HNSW index with pgvector](https://swe.quest/articles/understanding-vector-search-and-hnsw-index-with-pgvector-db3498f2e1e5486e.md): Neon · 2023-09-20 · Medium · 10 min read · Vector search, PostgreSQL, LLMs
  pgvector 0.5.0 adds an HNSW (Hierarchical Navigable Small Worlds) index for approximate nearest neighbor search in Postgres, replacing O(N) sequential exact scans with a multi-layer graph traversal that trades a little accuracy for much faster queries.
- [Neon Docs search is now built on Neon](https://swe.quest/articles/neon-docs-search-is-now-built-on-neon-6358bcc8a0cf6214.md): Neon · 2026-10-26 · Medium · 6 min read · Search, PostgreSQL, Vector search, Caching, AI agents
  Neon's docs search now runs entirely on its own stack: Lakebase Postgres with the lakebase\_vector (pgvector-compatible ANN) and lakebase\_text (BM25) extensions, a Hono API on Neon Functions, and Neon AI Gateway for embeddings and reranking.
- [Training 100x Cheaper Retrieval models Neon and Castform](https://swe.quest/articles/training-100x-cheaper-retrieval-models-neon-and-castform-05a64846d2e32056.md): Neon · 2026-08-05 · Easy · 5 min read · Model training, RAG & retrieval, PostgreSQL, AI agents, Search
  Castform uses data stored in Neon Postgres, exposed through Lakebase Search's BM25 and vector functions, to RL post-train a 4B open-source model for agentic retrieval.
- [Multi-Vector (Late Interaction) Embedding Models with Sentence Transformers](https://swe.quest/articles/multi-vector-late-interaction-embedding-models-with-sentence-transformers-8580846e619b61eb.md): Hugging Face · 2026-08-18 · Medium · 39 min read · Search, Vector search, Python, RAG & retrieval
  Sentence Transformers v6.0 adds MultiVectorEncoder, a fourth model type for ColBERT-style late-interaction retrieval that loads PyLate, Stanford-NLP ColBERT and (with added config) colpali-engine checkpoints.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
