Maximum inner product search, or MIPS, is a core operation in recommendation, search, and retrieval-augmented generation. It compares a query vector with large collections of key vectors to find the strongest match. Exhaustive comparison becomes costly as databases reach millions of keys and vector dimensions grow into the thousands.
Apple researchers presented a different approach at ICML 2026. Instead of relying only on query-agnostic clustering and quantization, they train small neural networks once, offline, for a fixed key database. The networks learn from the distribution of queries that the system is likely to receive, trading an upfront training cost for faster and more accurate retrieval during inference.
The work treats the function mapping a query to its largest inner product as a support function from convex analysis. That function is convex, and its gradient identifies the best-matching key. Apple describes two specialized models: SupportNet learns support functions and can improve routing among clusters, while KeyNet directly predicts the best-matching key vector. Both train on sampled queries paired with answers produced by exhaustive search.
The method addresses a practical mismatch in RAG systems: user queries are often short questions, while stored keys represent longer, curated documents. By learning the patterns of queries that actually matter, the system can direct computation toward likely matches rather than optimizing equally for every possible input.