[Paper Review] Inner Product Similarity Search using Compositional Codes
This paper proposes compositional codes for efficient inner product similarity search by approximating vectors as combinations of elements from multiple source dictionaries. The group M-selection algorithm jointly learns dictionaries and selects M elements to form compact codes, achieving superior accuracy and efficiency over product quantization and Cartesian k-means on large-scale datasets like SIFT1M, SIFT1B, Netflix, and linear models.
This paper addresses the nearest neighbor search problem under inner product similarity and introduces a compact code-based approach. The idea is to approximate a vector using the composition of several elements selected from a source dictionary and to represent this vector by a short code composed of the indices of the selected elements. The inner product between a query vector and a database vector is efficiently estimated from the query vector and the short code of the database vector. We show the superior performance of the proposed group $M$-selection algorithm that selects $M$ elements from $M$ source dictionaries for vector approximation in terms of search accuracy and efficiency for compact codes of the same length via theoretical and empirical analysis. Experimental results on large-scale datasets ($1M$ and $1B$ SIFT features, $1M$ linear models and Netflix) demonstrate the superiority of the proposed approach.
Motivation & Objective
- Address the challenge of efficient approximate nearest neighbor search under inner product similarity, a critical task in vision, recommendation, and NLP.
- Overcome limitations of existing compact code methods like product quantization and Cartesian k-means, which are suboptimal for inner product similarity.
- Develop a vector approximation framework using compositions of elements from multiple source dictionaries to improve code efficiency and search accuracy.
- Introduce a group M-selection algorithm that jointly learns M source dictionaries and performs M-1 selections to form a larger, more expressive compositional dictionary.
- Achieve high search accuracy with compact codes while maintaining low query time cost, suitable for large-scale applications.
Proposed method
- Approximate each database vector as a linear combination of M vectors selected from M distinct source dictionaries, forming a compositional code.
- Represent each vector using a short code consisting of the indices of the selected vectors from each dictionary, enabling compact storage and fast retrieval.
- Estimate the inner product between a query vector and a database vector using only the query and the compositional code, avoiding full vector storage.
- Formulate the group M-selection problem as simultaneous 1-selection from M different source dictionaries, enabling joint optimization of dictionary learning and code generation.
- Leverage the equivalence between M-selection from a single dictionary and 1-selection from M identical dictionaries to generalize to M distinct dictionaries for improved approximation capacity.
- Use a greedy optimization strategy to minimize vector approximation error while maintaining low computational cost during code generation and query processing.
Experimental results
Research questions
- RQ1Can a compact code representation based on compositional vector approximation improve inner product similarity search accuracy compared to existing methods?
- RQ2Does using multiple distinct source dictionaries in a group M-selection framework yield better approximation and search performance than using a single shared dictionary?
- RQ3How does the proposed method compare in accuracy and efficiency to product quantization (PQ), optimal product quantization (OPQ), and Cartesian k-means (CKM) on large-scale datasets?
- RQ4Can the compositional code approach be effectively adapted to inner product similarity search in real-world applications such as image retrieval, recommendation systems, and linear model search?
- RQ5What is the trade-off between code length, approximation error, and query efficiency in the proposed framework?
Key findings
- On the SIFT1M dataset with 64-bit codes, the proposed compositional code (CC) achieves an inner product approximation error of 2.148×10⁻², significantly lower than PQ (8.915×10⁻²), OPQ (8.238×10⁻²), and CKM (6.835×10⁻²).
- With 128-bit codes on SIFT1B, CC reduces the inner product approximation error to 1.252×10⁻², outperforming PQ (5.075×10⁻²), OPQ (5.610×10⁻²), and CKM (4.269×10⁻²).
- On the Netflix dataset, CC achieves an inner product approximation error of 48.31, compared to 157.02 (PQ), 60.24 (OPQ), and 49.25 (CKM), demonstrating consistent improvement.
- For linear model search, CC reduces the inner product approximation error to 1.724×10⁻³, outperforming PQ (4.755×10⁻³), OPQ (1.957×10⁻³), and CKM (2.312×10⁻³).
- The vector approximation error (VAE) is consistently lower across all datasets: for example, on SIFT1M with 128-bit codes, VAE is 0.797×10⁻⁴ for CC versus 0.992×10⁻⁴ for CKM, 1.038×10⁻⁴ for PQ.
- The method enables efficient Euclidean distance approximation when source dictionaries are mutually orthogonal, reducing query cost to O(M) from O(M²), with a constant factor of 2.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.