cs.DBApr 6, 2026

Cardinality Estimation for High Dimensional Similarity Queries with Adaptive Bucket Probing

Authors: Zhonghan Chen, Qintian Guo, Ruiyuan Zhang, Xiaofang Zhou

Organizations: The Hong Kong University of Science and Technology, Hong Kong SAR, China · Hong Kong Generative AI Research and Development Center (HKGAI), Hong Kong SAR, China

Abstract

In this work, we address the problem of cardinality estimation for similarity search in high-dimensional spaces. Our goal is to design a framework that is lightweight, easy to construct, and capable of providing accurate estimates with satisfying online efficiency. We leverage locality-sensitive hashing (LSH) to partition the vector space while preserving distance proximity. Building on this, we adopt the principles of classical multi-probe LSH to adaptively explore neighboring buckets, accounting for distance thresholds of varying magnitudes. To improve online efficiency, we employ progressive sampling to reduce the number of distance computations and utilize asymmetric distance computation in product quantization to accelerate distance calculations in high-dimensional spaces. In addition to handling static datasets, our framework includes updating algorithm designed to efficiently support large-scale dynamic scenarios of data updates.Experiments demonstrate that our methods can accurately estimate the cardinality of similarity queries, yielding satisfying efficiency.

Figures & tables

Explore similar work

Oct 19, 2026

MultiCard: Multiple Attribute Cardinality Estimation via Deep Learning

Cardinality estimation is essential for query optimization, but most existing learned estimators focus on a single predicate type, such as string LIKE clauses or numerical range filters. In practice, analytical workloads often combine both types, while the accuracy of string estimators tends to decrease with longer patterns. We introduce MultiCard, a comprehensive learned cardinality estimator that unifies LIKE predicates and numerical filters within a single end-to-end architecture. By combining a Transformer for long-range sparse patterns with an LSTM for short, frequent patterns, MultiCard achieves robust pattern modeling. In parallel, a numerical encoder integrates catalog histograms and structural predicate features, enabling the model to dynamically assess histogram estimation accuracy across different operators and data skew conditions. A final Transformer layer captures interactions among heterogeneous predicates before a multilayer perceptron predicts query cardinalities. We also introduce UPCI, a workload generator that produces length-balanced LIKE patterns, multi-column numerical predicates, and exact cardinality labels for training and evaluation. Experiments on five real-world datasets show that, for string-only workloads, MultiCard achieves the best or near-best Q-error across all datasets compared with state-of-the-art methods. For mixed multi-attribute queries, MultiCard reduces PostgreSQL's mean Q-error by up to 16 times while maintaining an inference latency below 5 ms.
Oct 4, 2026

Locality Sensitive Hashing for p-Exponential Kernels with Applications to Density Estimation

A kernel k(x,y)k(x,y) is LSHable if there exists a locality sensitive hashing scheme HH such that k(x,y)=Pr⁡h∼H[h(x)=h(y)]k(x,y)=\Pr_{h\sim H}[h(x)=h(y)] for all x,yx,y. This notion plays a key role in efficient kernel methods in high dimensions. In this work, we show that the pp-exponential kernel k(x,y)=exp⁡(−∥x−y∥p)k(x,y)=\exp(-\lVert x-y \rVert_p) is LSHable in bounded regions for all 1<p≤21<p\leq2. Previously, this was known only for p=1p=1. Our new "mosaic LSH" scheme is based on a Poisson hyperplane process with hyperplanes sampled as ℓ1\ell_1-biased pp-stable vectors, for which we develop efficient sampling procedures. As applications, our results yield new and efficient density estimation methods based on LSHability for those pp-exponential kernels.
Oct 27, 2025

Sublinear Sketches for Approximate Nearest Neighbor and Kernel Density Estimation

Approximate Nearest Neighbor (ANN) search and Approximate Kernel Density Estimation (A-KDE) are fundamental problems at the core of modern machine learning, with broad applications in data analysis, information systems, and large-scale decision making. In massive and dynamic data streams, a central challenge is to design compact sketches that preserve essential structural properties of the data while enabling efficient queries. In this work, we develop new sketching algorithms that achieve sublinear space and query time guarantees for both ANN and A-KDE for a dynamic stream of data. For ANN in the streaming model, under natural assumptions, we design a sublinear sketch that requires only O(n(1−η)(1+ρ))\mathcal{O}(n^{(1-η)(1+ρ)}) memory by storing only a sublinear (n−ηn^{-η}) fraction of the total inputs, where ρρ is a parameter of the LSH family, and 0<η<10<η<1. Our method supports sublinear query time, batch queries, and extends to the more general Turnstile model. While earlier works have focused on Exact NN, this is the first result on ANN that achieves near-optimal trade-offs between memory size and approximation error. Next, for A-KDE in the Sliding-Window model, we propose a sketch of size O(LW⋅11+ε−1log⁡2N)\mathcal{O}\left(LW \cdot \frac{1}{\sqrt{1+ε} - 1} \log^2 N\right), where LL is the number of sketch rows, WW is the LSH range, NN is the window size, and εε is the approximation error. This, to the best of our knowledge, is the first theoretical sublinear sketch guarantee for A-KDE in the Sliding-Window model. We complement our theoretical results with experiments on various real-world datasets, which show that the proposed sketches are lightweight and achieve consistently low error in practice.