[Paper Review] Optimizing Learned Bloom Filters by Sandwiching
This paper proposes a sandwiched learned Bloom filter that improves performance by placing a standard Bloom filter before the learned function and a backup Bloom filter after it, significantly reducing false positives. The key result is that the optimal backup filter size is constant regardless of total memory budget, making the initial Bloom filter the primary space investment as memory increases.
We provide a simple method for improving the performance of the recently introduced learned Bloom filters, by showing that they perform better when the learned function is sandwiched between two Bloom filters.
Motivation & Objective
- To improve the efficiency and robustness of learned Bloom filters, which use machine-learned functions to compress set representations.
- To address the issue of high false positive rates in learned Bloom filters when query distributions deviate from training data.
- To determine the optimal memory allocation between initial and backup Bloom filters in a learned Bloom filter pipeline.
- To show that sandwiching the learned function between two Bloom filters yields better performance than the original single-Bloom-filter design.
Proposed method
- The method introduces a sandwiched architecture: an initial Bloom filter filters out non-members before the learned function, followed by a backup Bloom filter to correct false negatives from the learned function.
- The false positive rate is modeled as $ \alpha^{b_1}(F_p + (1-F_p)\alpha^{b_2/F_n}) $, where $ b_1 $ and $ b_2 $ are bits per key for the initial and backup filters, respectively.
- The optimal size of the backup filter is derived by minimizing the false positive rate, yielding $ b_2 = F_n \log_\alpha \left( \frac{F_p}{(1-F_p)(1/F_n - 1)} \right) $.
- The analysis assumes the false positive rate of a Bloom filter decays exponentially as $ \alpha^j $, with $ \alpha \approx 0.6185 $ for standard Bloom filters or $ \alpha = 0.5 $ for perfect hash-based filters.
- The method optimizes memory allocation by showing that increasing the initial filter size is more effective than increasing the backup filter once the optimal $ b_2 $ is reached.
- The approach is robust to distributional shifts in query workloads, as errors from the learned function are confined to a smaller subset of keys that pass the initial filter.
Experimental results
Research questions
- RQ1Can the performance of learned Bloom filters be improved by modifying the filter pipeline structure?
- RQ2What is the optimal memory allocation between an initial Bloom filter and a backup Bloom filter in a learned Bloom filter system?
- RQ3Does the size of the backup Bloom filter depend on the total memory budget, or is it constant?
- RQ4How does sandwiching affect the false positive rate and robustness under distributional shift in query workloads?
Key findings
- The optimal size of the backup Bloom filter is constant and independent of the total memory budget, meaning it does not scale proportionally with the total bits allocated.
- For $ F_n = 1/2 $ and $ F_p = 1/100 $, the optimal backup filter size is approximately 3.315 bits per key when $ \alpha = 1/2 $.
- At a total budget of 8 bits per key, the false positive rate drops from ~0.010015 to ~0.000777, achieving over a 10x reduction.
- Even at 6 bits per key, the false positive rate decreases from ~0.010242 to ~0.003109, demonstrating significant improvement with minimal overhead.
- The method allows the use of weaker, smaller learned functions (higher $ F_p $) while maintaining low overall false positive rates, enabling space savings.
- The sandwiched design enhances robustness by limiting the impact of distributional shift in queries, as only a small fraction of keys reach the learned function after the initial filter.
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.