RACE: Breaking the Dimensionality Curse in Streaming Kernel Density Estimation
Sub-linear RACE Sketches for Approximate Kernel Density Estimation on Streaming Data
The paper introduces RACE (Repeated Array-of-Counts Estimator), a sub-linear memory sketching algorithm for approximate Kernel Density Estimation (KDE) on high-dimensional streaming data. By leveraging Locality Sensitive Hashing (LSH), RACE compresses data streams into small arrays of integer counters, achieving SOTA compression while maintaining theoretical error guarantees.
TL;DR
Kernel Density Estimation (KDE) is the "Swiss Army Knife" of unsupervised learning, yet it is notoriously memory-heavy. RACE (Repeated Array-of-Counts Estimator) changes the game by transforming high-dimensional streams into tiny arrays of integer counters. By using Locality Sensitive Hashing (LSH) as a proxy for kernel similarity, it achieves a 10x reduction in memory compared to standard sampling, enabling 5GB of data to be summarized into just 4MB.
Context: Why Traditional KDE Fails at Scale
The standard KDE formula requires a summation over all points in a dataset: . This presents two massive roadblocks for modern systems:
- Memory Bottleneck: Storing high-dimensional vectors is impossible for IoT and edge devices.
- Streaming Limitation: Most existing "fast" KDE methods (like dual-trees or HBE) require multiple passes over the data, which is a luxury we don't have in real-time streams.
Previous "merging" attempts tried to store cluster centroids, but in high dimensions, the number of required centroids explodes. RACE sidesteps this by never storing a single data vector.
The Physical Intuition: Hashing as a Density Probe
Imagine a high-dimensional space partitioned by several random hyperplanes (LSH). When a data point arrives, RACE doesn't "store" the point; it simply finds the "bucket" the point falls into and increments a counter.
When you query the density of a new point , you look at the counters in the buckets where would fall. If the counter is high, the local neighborhood is dense.
Core Architecture: The RACE Sketch
The RACE sketch is remarkably simple: an 2D array of integers.
- The Construction: For every point in the stream, we compute independent hashes and increment
A[row][hash(x)]. - The Query: To estimate density for , we average the values found at
A[row][hash(q)].
Figure 1: (a) RACE as a 2D array; (b) Mergeability—sketches from two different streams can be combined via simple addition; (c) Distributed aggregation.
Methodology: From Hashing to Math
The brilliance of RACE lies in its theoretical foundation. It relies on the fact that for many LSH families, the collision probability is exactly a kernel function (like the Angular or -stable Euclidean kernel).
The authors use a Median-of-Means estimator to provide a multiplicative approximation. This is crucial: the error doesn't depend on the total number of points , but on the density itself, allowing for sub-linear scaling.
Rehashed RACE: Handling Infinite Ranges
For kernels with infinite ranges (like L2), the authors employ a rehashing trick to map the infinite hash space into a finite array of size . While this introduces some bias, the paper provides a "unbiased rehashed estimator" that corrects for collisions while maintaining tight variance bounds.
Performance: 10x Better Compression
The authors tested RACE against Random Sampling (RS) and Hashing-Based Sketches (HBS) across diverse datasets like Webspam (2.3M dimensions) and Hyperspectral imaging (Angular kernels).
Figure 2: Multiplicative error vs. Memory. RACE (red line) consistently achieves lower error for the same memory budget compared to sampling methods.
Key Findings:
- Extreme Compression: On the URL dataset, RACE attained error with a 4MB sketch, whereas the raw data occupied several gigabytes.
- Dimensionality Win: RACE truly shines when the cost of storing a single vector is higher than the required units of the sketch. This makes it ideal for the "Large , Small Memory" regime of modern NLP and genomics.
Critical Analysis & Future Outlook
The "Mergeable" Advantage
Unlike sampling-based methods (which require complex reservoir sampling to merge), RACE sketches are linearly mergeable. Two sensors can compute separate sketches and a central server can simply add them together. This makes it perfect for distributed IoT systems.
Limitations
- LSH Kernel Constraint: RACE is natively limited to kernels that can be expressed as LSH collision probabilities. While the paper outlines a Taylor series approach for arbitrary kernels, it is less efficient than the native LSH-kernel case.
- The Bandwidth Trade-off: Choosing the right LSH parameters is equivalent to choosing a kernel bandwidth—a task that still requires some domain knowledge or tuning.
Takeaway
RACE represents a shift from "data-centric" to "count-centric" summaries. By treating memory as a collection of counters rather than a buffer of samples, it allows us to perform complex kernel methods on the edge, directly within the L3 cache of a processor, potentially revolutionizing real-time anomaly detection and distributed user modeling.
