Inferensys

Glossary

Bloom Filter

A space-efficient probabilistic data structure used to test whether an element is a member of a set, with a controllable false-positive rate but no false negatives, often used as a building block in private set intersection.
Data scientist building training data pipeline on laptop, data preprocessing visible, technical workspace.
PROBABILISTIC DATA STRUCTURE

What is a Bloom Filter?

A Bloom filter is a space-efficient probabilistic data structure used to test whether an element is a member of a set, with a controllable false-positive rate but no false negatives.

A Bloom filter is a space-efficient probabilistic data structure designed to test set membership. It can definitively state that an element is not in a set, but can only indicate that an element may be present, with a mathematically controllable false-positive rate. This trade-off enables massive memory savings compared to storing the complete set, making it ideal for high-volume, latency-sensitive applications.

The structure operates by applying k independent hash functions to an element, setting bits at the resulting positions in a fixed-size bit array. A membership query checks these same positions; if any bit is 0, the element is guaranteed absent. In private set intersection (PSI) protocols, Bloom filters often serve as a compact, encoded representation of a party's dataset, enabling efficient oblivious comparison without exposing raw elements.

PROBABILISTIC DATA STRUCTURE

Key Properties of Bloom Filters

A Bloom filter is a space-efficient probabilistic data structure used to test whether an element is a member of a set. It guarantees no false negatives but allows a controllable false positive rate, making it a fundamental building block in privacy-preserving protocols like Private Set Intersection.

01

Space Efficiency

Bloom filters achieve extreme memory efficiency by representing a set as a fixed-size bit array rather than storing the elements themselves. A Bloom filter for 1 million elements with a 1% false positive rate requires only about 1.14 MB of memory, compared to storing the raw elements which could consume orders of magnitude more space. This compact representation is critical in bandwidth-constrained PSI protocols where the filter is transmitted between parties.

  • Uses k independent hash functions to map each element to k positions in the bit array
  • Memory footprint depends only on target false positive rate and expected element count
  • Size remains constant regardless of element length or complexity
02

No False Negatives Guarantee

A Bloom filter provides a one-sided error guarantee: if the filter reports an element is not in the set, that answer is always correct. This property is essential in PSI protocols where a false negative would mean missing a genuine intersection element. The filter achieves this by only setting bits to 1 during insertion and never clearing them.

  • Query returns definitely not in set or possibly in set
  • Absence of an element is provably certain
  • This asymmetry makes Bloom filters ideal as a pre-filter before more expensive cryptographic checks
03

Configurable False Positive Rate

The false positive probability can be precisely tuned by adjusting three parameters: the bit array size (m), the number of hash functions (k), and the expected number of elements (n). The optimal number of hash functions is approximately k = (m/n) * ln(2). For a target false positive rate p, the required bits per element is m/n ≈ -1.44 * log₂(p).

  • 1% false positive rate: ~9.6 bits per element
  • 0.1% false positive rate: ~14.4 bits per element
  • Trade-off: lower false positive rates require more memory and hash computations
04

PSI Pre-Filtering Role

In Private Set Intersection protocols, Bloom filters serve as an efficient pre-filtering mechanism. One party encodes their entire set into a Bloom filter and sends it to the other party, who can quickly eliminate elements that are definitely not in the intersection before performing expensive cryptographic operations on the remaining candidates.

  • Dramatically reduces the number of oblivious transfer or garbled circuit evaluations needed
  • Commonly used in KKRT-style PSI protocols with OT extension
  • The false positive rate directly impacts the protocol's communication overhead, as false positives trigger unnecessary cryptographic work
05

Garbled Bloom Filters for PSI

A Garbled Bloom Filter (GBF) extends the standard Bloom filter for secure computation. Instead of storing bits, each position holds a secret share of the element. During PSI, the GBF enables one party to encode their set such that the other party can only recover elements they also possess, without learning anything about non-matching entries.

  • Each array position stores a λ-bit string rather than a single bit
  • Uses XOR-based secret sharing across the k hash positions
  • Enables asymmetric PSI where only one party learns the intersection
  • Provides information-theoretic security against the receiver
06

Limitations and Trade-offs

Bloom filters have inherent constraints that affect their use in privacy-preserving applications. They do not support deletion of elements (standard variant), and the false positive rate increases as more elements are inserted beyond the designed capacity. Additionally, transmitting a Bloom filter reveals its bit density, which can leak information about the set size.

  • Counting Bloom filters extend the structure with counters to support deletions
  • Compressed Bloom filters optimize for network transmission rather than memory
  • In PSI, the filter's bit pattern may leak the cardinality of the sender's set if not properly padded
BLOOM FILTER BASICS

Frequently Asked Questions

Clear, technically precise answers to the most common questions about the probabilistic data structure that serves as a fundamental building block for efficient private set intersection protocols.

A Bloom filter is a space-efficient probabilistic data structure used to test whether an element is a member of a set. It can definitively state that an element is not in the set, but can only state that an element possibly is in the set, with a controllable false-positive rate.

Mechanism

  • The structure consists of a bit array of m bits, initially all set to 0.
  • It uses k independent hash functions, each of which maps an input element to one of the m array positions with a uniform random distribution.
  • Insertion: To add an element, it is fed through each of the k hash functions, and the bits at all k resulting positions are set to 1.
  • Query: To test for membership, the element is hashed with the same k functions. If any of the bits at those positions are 0, the element is definitively not in the set. If all bits are 1, the element may be in the set (or it could be a false positive caused by overlapping bits from other insertions).

A Bloom filter never produces a false negative—it will never incorrectly claim an inserted element is absent. This one-sided error property makes it a powerful pre-filtering tool in cryptographic protocols like private set intersection.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.