Inferensys

Glossary

Blocking

Blocking is a computational technique in entity resolution that groups records into candidate sets, or blocks, to reduce the number of pairwise comparisons required for matching.
Stylish WeWork-like workspace with hot desks and document wall, professional searching through enterprise knowledge base on a mounted ultrawide display, warm industrial pendants overhead.
ENTITY RESOLUTION TECHNIQUE

What is Blocking?

A computational technique used to reduce the quadratic complexity of entity resolution.

Blocking is a technique in entity resolution that partitions records into candidate groups, or blocks, to reduce the number of pairwise comparisons required for matching. Instead of comparing every record to every other record—an O(n²) operation—the process first applies a blocking key (e.g., the first three letters of a surname or a phonetic code) to assign records to subsets. Only records within the same block are then compared using more expensive similarity functions or machine learning models, dramatically improving computational efficiency.

Common blocking strategies include standard blocking, where a single function creates partitions, and multi-pass blocking, which uses several keys to increase recall. Advanced methods like locality-sensitive hashing (LSH) create probabilistic blocks. The core trade-off is between recall (missing fewer true matches) and precision (reducing false positive comparisons), making blocking a critical design decision in any scalable record linkage or deduplication pipeline.

ENTITY RESOLUTION

Key Blocking Techniques

Blocking partitions records into candidate groups to reduce the quadratic complexity of pairwise comparisons. These are the primary algorithmic strategies for creating those groups.

01

Standard Blocking

The most fundamental blocking technique. Records are assigned to the same block if they share an identical value for a chosen blocking key, such as a ZIP code or the first three letters of a last name. It is deterministic and highly efficient but suffers from the curse of dimensionality—records with minor variations in the key are placed in different blocks and never compared.

  • Example: Blocking all customer records on postal_code='90210'.
  • Use Case: Initial, high-recall pass in a multi-pass strategy where speed is critical.
02

Sorted Neighborhood

A technique that sorts the entire dataset based on a sorting key (e.g., concatenated last_name, first_name). A fixed-size sliding window (e.g., 10 records) moves down the sorted list, and only records within the same window are compared. This method is more robust to minor errors at the beginning of the key than standard blocking.

  • Process: 1) Create sorting key, 2) Sort all records, 3) Slide window and compare within it.
  • Advantage: Captures matches where standard blocking fails due to transpositions or typos early in the key.
03

Q-Gram Blocking

A flexible method that uses overlapping substrings of length q (typically q=2 or 3, called bigrams or trigrams) as blocking keys. Each record generates multiple q-grams from an attribute, and records sharing any q-gram are placed in the same block. This dramatically increases recall for fuzzy matches.

  • Example: The string 'Miller' generates bigrams: #M, Mi, il, ll, le, er, r#.
  • Trade-off: Higher recall but produces larger, overlapping blocks, increasing comparison costs. Often used with prefix filtering to prune the number of q-grams considered.
04

Locality-Sensitive Hashing (LSH)

An approximate, probabilistic blocking method designed for high-dimensional data like text embeddings. LSH uses special hash functions where the probability of collision is high for similar inputs and low for dissimilar ones. Similar records are hashed into the same bucket with high probability.

  • Key Property: It is locality-sensitive.
  • Common Use: Blocking for deep learning models where records are represented as dense vectors. Provides a sub-linear time alternative to comparing all pairs.
  • Families: Includes MinHash for Jaccard similarity and SimHash for cosine similarity.
05

Canopy Clustering

A fast, unsupervised pre-clustering technique used to create overlapping blocks (canopies). It uses two distance thresholds: a loose threshold T1 and a tight threshold T2 (T1 > T2). A record forms a new canopy if it is not within T2 of an existing canopy center. All records within T1 of a center are placed in that canopy.

  • Result: Records can belong to multiple canopies.
  • Purpose: Not a final clustering solution, but a cheap way to create candidate sets for more expensive pairwise matching or agglomerative clustering algorithms.
06

Multi-Pass Blocking

A robust production strategy that applies multiple, independent blocking schemes in sequence or parallel and takes the union of candidate pairs. This mitigates the risk of any single blocking key failing.

  • Typical Workflow:
    1. Pass 1 (High Recall): Use a lenient key (e.g., Soundex of last name).
    2. Pass 2 (High Precision): Use a strict key (e.g., exact date of birth + first initial).
  • Engineering Benefit: Allows tuning of the recall/precision trade-off systematically. The final candidate set is the union from all passes, ensuring no potential match is missed due to a single data error.
ENTITY RESOLUTION FILTERING

Blocking vs. Other Filtering Methods

A comparison of techniques used to reduce the candidate pair space in entity resolution, highlighting the trade-offs between computational efficiency and matching accuracy.

MethodBlockingSorted NeighborhoodLocality-Sensitive Hashing (LSH)

Primary Mechanism

Partitions records into groups (blocks) based on exact or hashed key values.

Sorts records by a key and slides a fixed-size window over the sorted list for comparisons.

Hashes records into buckets such that similar items collide with high probability.

Comparison Complexity

O(n) to O(n log n)

O(n log n) for sort, O(wn) for comparisons (w = window size)

O(n) for hashing, sub-linear for similarity search

Guarantee of Recall

No guarantee; similar records with different blocking keys are never compared.

Limited guarantee within the fixed window; records far apart in sort order are missed.

Probabilistic guarantee; tuning parameters control the recall probability.

Handles Typographical Errors

Scalability for Large n

High. Drastically reduces pairs (e.g., from O(n²) to O(n)).

Moderate. Window size is fixed, but sorting becomes expensive.

Very High. Designed for approximate nearest neighbor search in high dimensions.

Common Use Case

Initial high-reduction step in batch ER pipelines.

Streaming data or datasets where a good, clean sort key exists.

Finding near-duplicates in high-dimensional data (e.g., text embeddings).

Parameter Sensitivity

High. Choice of blocking key(s) critically impacts recall.

Moderate. Sensitive to sort key quality and window size.

High. Requires tuning of hash functions, bands, and rows for target similarity.

Integration with ML

Often used as a pre-filter before classifier-based matching.

Less common; typically a deterministic pre-processing step.

Core component of many scalable similarity search and clustering algorithms.

BLOCKING

Frequently Asked Questions

Blocking is a foundational technique in entity resolution used to make the computationally intensive task of comparing all possible record pairs tractable. These questions address its core mechanisms, trade-offs, and practical implementation.

Blocking is a computational technique in entity resolution that partitions a dataset into candidate groups, or blocks, to drastically reduce the number of pairwise comparisons required to find matching records. It works by applying a blocking key—a function derived from record attributes—to assign records with similar keys to the same block. Only records within the same block are then compared for potential matches. For example, all records where the first three letters of the last name are 'SMI' might be placed in one block. This transforms an intractable O(n²) comparison problem into a manageable set of smaller, independent sub-problems, enabling scalable entity resolution on large datasets.

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.