AI Glossary / AI and machine learning / Intermediate
Maximum inner-product search
Definition
Maximum inner-product search is the task of finding the stored vector with the largest dot product with a query vector. It supports retrieval and recommendation systems whose relevance scores are expressed as inner products rather than ordinary geometric distances.
What it means
A vector is a list of numbers representing an item, person, document or query. The dot product multiplies corresponding numbers and adds the results. A search system can use that result as a relevance score.
Maximum inner-product search, often abbreviated MIPS, asks which stored vector obtains the highest score for the query. Top-k MIPS asks for several highest-scoring vectors. The problem becomes difficult when a collection contains millions of high-dimensional vectors and queries must be answered quickly.
Vector length matters unless the scoring design removes it. This makes MIPS different from cosine-similarity search in the general case. Choosing the wrong search objective can change the results, even when the same embeddings are used.
How it works
An exact system computes the query's dot product with every candidate and selects the largest values. This is straightforward but can require substantial computation at scale.
Approximate systems organize the stored vectors so they can examine a smaller candidate set. Research approaches include transformations that connect inner-product search to other similarity-search problems, as well as specialized indexes. Approximation trades some retrieval accuracy for speed or memory savings.
The index must match the intended scoring function. Evaluation compares returned candidates with exact results on representative queries and measures recall, latency and resource use. Updating vectors can also require index maintenance or rebuilding.
Three practical examples
- A recommendation system retrieves products with high dot-product scores against a user's learned preference vector.
- A document-retrieval system searches embeddings whose training objective uses unnormalized inner products.
- A large classifier retrieves candidate labels by scoring their vectors before applying a more expensive final ranking stage.
Think of it this way
Think of a purchasing manager scoring suppliers by multiplying several supplier attributes by the manager's priorities and adding the results. The supplier with the largest total comes first.
The analogy explains weighted scoring, but learned vectors need not contain interpretable attributes. A large dot product is only meaningful relative to the model that created the vectors and the task used to evaluate them.
Worked example
The scoring rule changes the winner
Let a query vector be q = (1, 0). Candidate A is (0.9, 0.1), and candidate B is (2, 3).
The dot product with A is 1 × 0.9 + 0 × 0.1 = 0.9. The dot product with B is 1 × 2 + 0 × 3 = 2. Maximum inner-product search therefore selects B.
Cosine similarity divides the dot product by the product of vector lengths. Because q has length 1, A's cosine similarity is approximately 0.994, while B's is approximately 0.555. Cosine search selects A instead.
Neither calculation is inherently wrong. The correct choice depends on the intended scoring model. If the system was trained to use raw inner products, silently normalizing candidate vectors changes its objective. If all compared vectors are normalized appropriately, relationships between these search objectives become simpler, but that condition must be established.
Illustrative case study
Fictional case: retrieving catalog candidates
Meadow Market, an invented retailer, uses learned user and product vectors to shortlist products. A developer replaces a slow exhaustive search with a vector index configured for cosine similarity. Offline tests reveal unexpected changes in the shortlist.
The team discovers that its recommendation model was trained for raw inner-product scores. It restores the intended objective and compares approximate results with exact top-k results for a representative query set. The final business assessment also checks product availability and customer relevance.
This scenario illustrates a configuration error and a verification method. It does not claim a measured sales effect or describe a real deployment.
Common misconceptions and mistakes
Inner product and cosine similarity are not interchangeable for arbitrary vectors. Normalization is a modeling decision, not merely harmless housekeeping. Approximate nearest-neighbor terminology does not guarantee that an index supports the required scoring objective correctly.
High retrieval recall also does not prove good recommendations: it only shows that the index reproduces the model's ranking well. A poorly trained model can be retrieved faithfully.
Business use
Businesses use MIPS when learned scoring models must retrieve candidates quickly from large collections. The value comes from making the chosen relevance function operational at scale.
Before adopting an index, document whether vectors are normalized, which score is authoritative and how updates are handled. Benchmark realistic query traffic and measure accuracy against an exact baseline. Separate retrieval quality from final user outcomes, and monitor whether popular or high-norm items dominate unexpectedly. A staged system may retrieve a larger candidate set and then apply business constraints and a more detailed ranking model.
People also ask
Is MIPS the same as nearest-neighbor search?
It is a related retrieval problem, but its objective is maximizing a dot product.
Must it be approximate?
No. Exhaustive exact search is possible when its cost is acceptable.
Does the highest score guarantee relevance?
No. It reflects the model's learned scoring rule, which itself needs evaluation.
Check your understanding
An approximate index returns a different winner after all stored vectors are normalized. Does that necessarily show an indexing bug?
Answer: No. Normalization may have changed the scoring problem. First verify that the intended objective and vector preprocessing match the model, then assess approximation errors.
Related terms
- Dot product
- Embedding
- Cosine similarity
- (1+ε)-approximate nearest neighbor search
- Vector Database
- embeddings
- approximate nearest-neighbour search
- candidate retrieval
Learn next
Learn next how cosine similarity and Euclidean distance relate for normalized vectors. Then compare an approximate index with exhaustive top-k search on a small representative dataset, keeping the scoring function identical in both.
More in AI and machine learning
- Matrix regularization - Matrix regularization is the use of penalties or constraints to control the structure of a matrix estimated from data.
- Matrix semantics - Matrix semantics is the discipline of keeping track of what the rows, columns and cells of a data matrix mean: which axis is which entity, in which units...
- MAUVE (metric) - MAUVE is a measure for comparing two collections of generated and reference examples, developed for evaluating open-ended text generation.
- Means - ends analysis - Means - ends analysis is a problem-solving strategy that compares the current situation with a desired goal, identifies an important difference and chooses...
- Medoid - A medoid is an actual member of a group of observations chosen to minimize the total dissimilarity to the other members.
- Memory map - A memory map is a file-access technique where a file on disk is mapped directly into a program's address space, so the program reads and writes it like...
Sources
Primary sources: Shrivastava and Li, Asymmetric LSH for MIPS, https://arxiv.org/abs/1405.5869 ; Neyshabur and Srebro, https://arxiv.org/abs/1410.5518 . Relevant primary-paper passages defining MIPS and its normalization assumptions were consulted; independent editorial review is recorded, without publication approval. Numerical example and fictional case are original.
Previous: Maximum Flow Next: Maximum likelihood estimate