[Paper Review] Sum Estimation via Vector Similarity Search
The paper presents an algorithm to estimate sums over vector-based datasets using O(log n) top elements from exponentially leveled data structures, obtaining an unbiased estimator with high-probability error bounds and demonstrating efficiency over prior O(sqrt(n)) methods.
Semantic embeddings to represent objects such as image, text and audio are widely used in machine learning and have spurred the development of vector similarity search methods for retrieving semantically related objects. In this work, we study the sibling task of estimating a sum over all objects in a set, such as the kernel density estimate (KDE) and the normalizing constant for softmax distributions. While existing solutions provably reduce the sum estimation task to acquiring $\mathcal{O}(\sqrt{n})$ most similar vectors, where $n$ is the number of objects, we introduce a novel algorithm that only requires $\mathcal{O}(\log(n))$ most similar vectors. Our approach randomly assigns objects to levels with exponentially-decaying probabilities and constructs a vector similarity search data structure for each level. With the top-$k$ objects from each level, we propose an unbiased estimate of the sum and prove a high-probability relative error bound. We run experiments on OpenImages and Amazon Reviews with a vector similar search implementation to show that our method can achieve lower error using less computational time than existing reductions. We show results on applications in estimating densities, computing softmax denominators, and counting the number of vectors within a ball.
Motivation & Objective
- Motivate and formalize the problem of sum estimation using vector similarity search beyond exact summation.
- Propose a level-based data-structure approach that reduces retrieved elements to O(log n).
- Provide an unbiased estimator for the sum and prove a high-probability relative error bound.
- Demonstrate the method on real datasets for KDE, softmax denominators, and counting within a ball.
- Investigate practical performance and discuss integration with existing vector search systems.
Proposed method
- Assume access to a maximization oracle that returns Top_k for f_q over X and build a data-structure per level with exponentially decaying level assignments (ell(x) ~ Geometric with p=1/2).
- Define U as the union of Top_k from all levels and use the top elements from U to form an unbiased estimator E for the sum F = sum_x f_q(x).
- Compute the unbiased estimator E = sum_{x in U} f_q(x) / p_i with level-aware probabilities p_i and update p as levels fill (C_ell = k).
- Provide a simple linear-time procedure to compute E given U and the level counts.
- Prove a high-probability relative error bound using martingale Bernstein inequality and Chernoff-type lemmas.
- Optionally apply a control variate to reduce variance by adjusting with a constant c.
Experimental results
Research questions
- RQ1Can a sum over a dataset X of a non-negative function f_q be estimated using only O(log n) retrieved elements from a maximization oracle?
- RQ2What are the unbiased estimation guarantees and high-probability relative error bounds for such an O(log n) level-based estimator?
- RQ3How does the proposed method perform for KDE, softmax denominators, and counting within a ball compared to baselines?
- RQ4Can this framework be integrated with existing vector search systems (e.g., HNSW) to improve practical runtimes?
- RQ5What are the limitations and practical considerations when treating vector search as a black-box maximization oracle?
Key findings
- The proposed estimator uses Top_k from exponentially sampled levels to form an unbiased estimate of the sum.
- With k and delta tuned, the method achieves a high-probability relative error of O(sqrt(log(1/delta)/k)).
- Experiments on Open Images and Amazon Reviews show lower error and faster runtime than existing reductions across KDE, softmax, and counting tasks.
- The method maintains unbiasedness and provides an explicit variance control via a martingale-based bound and a potential control variate.
- The work discusses integration opportunities with HNSW and acknowledges oracle-based limitations for runtime guarantees.
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.