MinHash deduplication is a probabilistic algorithm that compresses document shingles into compact signature matrices to estimate Jaccard similarity without pairwise comparison. By partitioning signatures into multiple bands, it identifies candidate pairs with high similarity in sub-linear time, making it the standard for sanitizing multi-terabyte training corpora like Common Crawl.
Glossary
MinHash Deduplication

What is MinHash Deduplication?
MinHash deduplication is a locality-sensitive hashing technique used to efficiently identify and remove near-duplicate documents in massive web-scale datasets, preventing memorization and overfitting in large language models.
The technique mitigates data contamination by removing syntactically near-identical documents that cause memorization and artificially inflate benchmark scores. Unlike exact hash matching, MinHash's locality-sensitive properties catch paraphrased or slightly altered duplicates, preserving the statistical diversity of the training distribution while preventing self-consuming loops.
Key Features of MinHash Deduplication
MinHash is a foundational algorithm for estimating set similarity, enabling the efficient identification and removal of near-duplicate documents in web-scale training corpora to prevent memorization and model collapse.
Jaccard Similarity Estimation
MinHash provides a unbiased estimator of the Jaccard similarity coefficient between two sets. By comparing the minimum hash values of shingled documents, the algorithm approximates the ratio of the intersection to the union of their n-gram sets without requiring an expensive pairwise comparison of all elements. This statistical property allows for sub-linear deduplication in massive corpora like Common Crawl.
Shingling and Tokenization
Before hashing, documents are decomposed into k-shingles—contiguous subsequences of tokens of a fixed length k. For text, k is typically 5 to 9 words. This process converts a document into a set of features that is robust to minor edits, reordering, and paraphrasing. The choice of k directly impacts the granularity of duplicate detection:
- Low k (3-4): Catches small phrase overlaps, higher false positives
- High k (8-10): Identifies larger structural copies, higher precision
LSH Banding for Scalability
To avoid O(n²) comparisons, MinHash signatures are split into b bands of r rows each. Documents that hash to the same bucket in any band are considered candidate pairs. This Locality-Sensitive Hashing (LSH) technique probabilistically guarantees that similar documents collide with high probability while dissimilar ones are pruned. The parameters b and r are tuned to control the similarity threshold, creating an adjustable precision-recall curve for deduplication sensitivity.
Preventing Model Collapse
MinHash deduplication is a critical pre-processing defense against synthetic data contamination and model autophagy. By removing near-duplicate documents from training corpora, it prevents models from memorizing and regurgitating verbatim passages, which accelerates tail erosion and reduces output diversity. Research has shown that deduplicating web-scale datasets with MinHash significantly improves perplexity and reduces the frequency of exact training data extraction attacks.
MinHash vs. SimHash
While both are LSH techniques, they serve distinct purposes:
- MinHash: Estimates Jaccard similarity; ideal for near-duplicate document detection and corpus deduplication.
- SimHash: Estimates cosine similarity via randomized rounding; optimized for identifying exact or near-exact duplicates in web crawling. MinHash is preferred for training corpus sanitization because it is more robust to paraphrasing and document restructuring, catching semantic duplicates that SimHash would miss.
Implementation in Data Pipelines
Production deduplication pipelines typically execute MinHash in a MapReduce or Spark job across distributed clusters. The workflow involves:
- Shingling: Convert each document to a set of n-grams
- MinHashing: Apply multiple hash functions to generate a compact signature
- LSH Bucketing: Group signatures into candidate pairs
- Thresholding: Filter pairs above a Jaccard similarity cutoff (commonly 0.8) This process can deduplicate petabytes of text, such as the Colossal Clean Crawled Corpus (C4), reducing storage and preventing memorization.
Frequently Asked Questions
Explore the core mechanisms behind MinHash, the locality-sensitive hashing algorithm that powers near-duplicate detection in web-scale training datasets.
MinHash deduplication is a locality-sensitive hashing (LSH) technique used to efficiently estimate the Jaccard similarity between two documents to identify near-duplicates. Instead of comparing raw text byte-by-byte, the algorithm compresses a document into a compact signature by applying multiple hash functions to its set of n-grams (typically word shingles). The core insight is that the probability of a collision between two MinHash signatures directly equals the Jaccard similarity of their original sets. By splitting these signatures into bands, the system can rapidly cluster similar documents without performing an O(n²) pairwise comparison, making it feasible to deduplicate massive corpora like Common Crawl or The Pile.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Understanding MinHash deduplication requires familiarity with the foundational algorithms and degradation phenomena it is designed to combat in web-scale training datasets.

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us