Amortizing Maximum Inner Product Search with Learned Support Functions

This paper proposes "amortized MIPS," a learning-based framework that leverages the mathematical properties of support functions to train neural networks (SupportNet and KeyNet) that directly predict optimal keys for Maximum Inner Product Search, thereby amortizing computational costs for queries drawn from a fixed distribution.

Theo X. Olausson, João Monteiro, Michal Klein, Marco Cuturi

Published Tue, 10 Ma
📖 5 min read🧠 Deep dive

Imagine you are the librarian of a massive library containing millions of books (the database). Every day, thousands of people walk in asking for a specific book that matches their current mood or topic (the query).

Traditionally, to find the best book, the librarian has to walk down every single aisle, pick up every book, and check if it matches the request. This is called Maximum Inner Product Search (MIPS). It works, but if the library has millions of books, it takes forever. It's like trying to find a needle in a haystack by checking every single piece of hay one by one.

The Old Way: The "Brute Force" Librarian

Current methods try to speed this up by organizing the library with complex maps, indexes, or by squashing the books into smaller boxes (quantization). These are like having a "Find" button on a computer. But these maps are static. They treat every visitor as if they are a stranger, even if you know that 90% of your visitors usually ask for mystery novels on Tuesdays. They don't learn from the patterns of who is asking what.

The New Way: The "Amortized" Librarian

This paper proposes a new kind of librarian: a Neural Network that acts like a super-intelligent, experienced guide. Instead of building a map, we train this guide to instantly know the answer.

The authors call this Amortized MIPS. "Amortized" is a fancy word meaning "spreading the cost over time."

  • The Cost: It takes a long time to train this guide (like studying for years).
  • The Payoff: Once trained, the guide can answer any question from a regular visitor instantly, without looking at the shelves. The heavy lifting was done once during training, so the daily work is free.

The Secret Sauce: The "Support Function"

How does the guide know the answer so fast? The paper uses a clever mathematical trick involving something called a Support Function.

Think of the library's books as a group of people standing in a field.

  • If you stand in a specific spot and shout, "Who is closest to me?" the person who steps forward is the answer.
  • The paper realizes that the "distance" (or score) you shout is actually a shape called a Support Function.
  • The Magic: If you know the shape of this field, you don't need to look at the people. You just need to know the slope of the ground at your feet. The direction the ground slopes down points exactly to the person you need!

The paper builds two types of guides based on this idea:

1. SupportNet: The "Topographer"

This guide learns to draw a perfect 3D map of the field (the Support Function).

  • How it works: When a visitor asks a question, the guide looks at the map, calculates the slope at that exact spot, and the slope points directly to the best book.
  • Pros: It's mathematically perfect and very accurate.
  • Cons: Calculating the slope takes a little bit of extra brainpower (computation) every time.

2. KeyNet: The "Intuitive Guide"

This guide skips the map entirely. It learns to look at the visitor and directly point to the correct book.

  • How it works: It's like a seasoned librarian who sees a customer and immediately says, "You want The Great Gatsby," without thinking about the map or the slope.
  • Pros: It's incredibly fast because it doesn't need to calculate slopes. It just outputs the answer.
  • Cons: It's a bit harder to train to be perfect, but once it learns, it's a speed demon.

The "Cluster" Trick

What if the library is too big for even one guide? The authors suggest splitting the library into 10 smaller sections (clusters).

  • They train a team of guides (or one multi-tasking guide) to first guess which section the visitor belongs to.
  • Once the section is identified, they only search that small section.
  • This is like a receptionist who asks, "Are you looking for fiction or non-fiction?" before you even walk into the main library. It saves a ton of time.

The Results: Why Should We Care?

The authors tested this on real-world data (like searching through millions of Wikipedia articles or Q&A forums).

  • Speed: Their AI guides were much faster than traditional search engines for specific types of questions.
  • Accuracy: They found the right answers almost as often as the slow, exhaustive method.
  • Compression: They showed that you can "compress" the library. Instead of storing millions of books, you can store a small AI model that knows where the books are.

The Bottom Line

This paper is about teaching a computer to stop searching and start predicting.

Instead of treating every search query as a new, unknown problem, the computer learns the "personality" of the questions it usually gets. It builds a mental shortcut (a neural network) that instantly knows the answer, saving massive amounts of time and energy. It's the difference between looking up a phone number in a directory every time you need it, versus having a friend who knows everyone's number by heart and just tells you immediately.