Stable Learned Bloom Filters for Data Streams

Qiyu Liu, Libin Zheng, Yanyan Shen, Lei Chen

Bloom Filters are essential probabilistic data structures for membership testing in large-scale systems. While space-efficient, traditional Bloom Filters have been recently enhanced by machine learning in the form of Learned Bloom Filters (LBF). By using a classifier as an "oracle," LBFs significantly reduce memory requirements. However, as data shifts from static sets to high-velocity streams, these structures face a critical limitation: saturation.

The Saturation Problem in Streaming

Standard LBFs rely on a static backup filter to catch false negatives from the ML model. In a streaming environment where new elements are continuously inserted, this backup filter eventually fills up. As the number of insertions grows, the false positive rate (FPR) inevitably climbs toward 100%, rendering the filter ineffective. This makes the original LBF unsuitable for long-running applications like network monitoring or real-time security filtering.

Comparison of FPR stability between original LBF and the proposed SLBF.

Stable Learned Bloom Filters (SLBF)

To address this, researchers introduced the Stable Learned Bloom Filter (SLBF). The core innovation is replacing the static backup filter with a "Stable" Bloom Filter (SBF). SBFs maintain a constant FPR by using an eviction mechanism—randomly clearing old data to make room for new insertions. By combining ML predictions with stable eviction logic, SLBFs achieve a "steady state" where performance remains predictable over infinite streams.

The "Stability" property is the defining characteristic of this new class of filters. In a standard Bloom Filter, the bit array becomes increasingly dense with 1s as more items are added. Once the array is saturated, every query returns a positive result. SLBFs avoid this by ensuring that the number of set bits reaches an equilibrium. This equilibrium allows the filter to operate indefinitely without the need for manual resets or massive memory reallocations.

Architectural Variants

The paper details two primary configurations for SLBFs, each offering a different trade-off between complexity and efficiency:

  1. Single SLBF (s-SLBF): A direct replacement where the ML oracle's negative predictions are passed to a single SBF backup. This is the simplest implementation and provides immediate stability over standard LBFs.
  2. Grouping SLBF (g-SLBF): A more advanced approach that partitions the classifier's confidence scores into multiple ranges. Each range is assigned its own dedicated SBF. This allows the system to allocate more resources to "uncertain" regions of the score distribution, optimizing accuracy.

The g-SLBF variant leverages the fact that machine learning classifiers provide a continuous score representing the probability of membership. A score near 0.0 indicates high certainty of non-membership, while a score near 0.5 indicates significant uncertainty. By grouping these scores, the g-SLBF can apply different hashing parameters to different "bins" of uncertainty. This granular control makes the filter much more robust against "hard threshold" errors where a single fixed cutoff might misclassify borderline cases.

Architectural comparison of the single (s-SLBF) and grouping (g-SLBF) variants.

Evaluation and Key Results

Testing on real-world datasets like Kitsune (network attacks), Amazon resource access, and Higgs boson identification showed that g-SLBF can achieve the same error rates as traditional streaming filters while using up to 97% less memory. The grouping approach also provides a significant safety net against distribution shift; because it partitions the classifier's output, it is less reliant on the model's initial training accuracy than the simpler s-SLBF variant.

Furthermore, the system maintains high throughput. Despite the computational overhead of an ML model, the authors achieved an inference throughput of ~10 million operations per second using Gradient Boosting Trees. The total SLBF system handled approximately 7-9 million operations per second, making it viable for high-velocity production environments.

Conclusion

SLBFs represent a significant step forward for streaming data structures. While they introduce a small false negative rate due to data eviction—making them unsuitable for applications where missing a member is catastrophic—their ability to maintain a low, stable FPR with minimal memory overhead is a major advantage. Future research into "on-the-fly" model updates could further enhance their resilience to evolving data distributions and long-term model staleness.

Summary updated

BibTeX
@article{liu2020stable,
  author = {Qiyu Liu and Libin Zheng and Yanyan Shen and Lei Chen},
  title = {{Stable Learned Bloom Filters for Data Streams}},
  journal = {Proc. VLDB Endow.},
  year = {2020},
}
Figure