Frequency Moments Beyond Equality: Streaming Cosine Density Moments
Abstract
For a stream of nonzero vectors , let . We define the cosine density of the -th stream element by and study the density moments in both the signed- and nonnegative-cosine regimes. These quantities are similarity-aware analogues of classical frequency moments: replacing cosine similarity by equality (that is, ) gives and, in particular, , the number of distinct elements. We give one-pass streaming algorithms and lower bounds whose dependence on is tight up to logarithmic factors for , , and even (the latter under signed cosine), and whose exponents differ by less than for odd under nonnegative cosine. Our results thus extend several fundamental statistics from the classical data stream literature to cosine similarity, a widely used measure for comparing vector embeddings in modern AI systems. The main challenge in proving a space lower bound for nonnegative cosine is to eliminate unwanted contributions without relying on pairs of opposite vectors. We address this through a construction that we call \emph{equal-sum moment isolation}: two insertion-only prefixes have the same cardinality and vector sum, and a finite-difference comparison cancels the baseline shared by all their vectors while isolating the desired higher-order signal. This proof framework may be useful for other insertion-only streaming lower bounds, where direct cancellation is not possible.
Create a lesson
Metadata
- Comments
- 44 pages
Related papers
The Heavy Hitter Oracle: Enhancing Frequency Estimation in Skewed Data Streams
Shared title terminologycs.DSLisa Schmierer, Ioana-Oriana Bercea
Streaming Algorithms for Gaussian Kernel Density Statistics
Shared title terminologycs.DSQin Zhang
A Space Separation for Single-Pass DFS Trees in Insertion-Only and Turnstile Streams
Shared title terminologycs.DSTsun-Ming Cheung, Meng-Tsung Tsai, Tzu-Chiao Yen
Language Generation Beyond Adversarial Examples
Shared title terminologycs.DSDebmalya Panigrahi, Fan Wei, Ian Zhang
A Sharp Density Threshold for Pinwheel Covering with Three Distinct Periods
Shared title terminologycs.DSAarav Jalan
Beyond the Quadratic Barrier for Multidimensional Grid Range Problems
Shared title terminologycs.DSFilippo di Gravina, Francesco Damiano Di Gregorio