Skip to content

Dedup threshold at 0.8 or 0.95: how much does it actually change

THE ARGUMENT

A threshold is not a quality score, it is a dial for how much gets deleted; exact and semantic deduplication answer different questions, so 0.8 and 0.95 cannot be ranked against each other. What you verify is the decision rule, the wrongful-deletion rate and the sensitivity to the threshold, not the threshold itself.

On this page

Both quotes say “deduplicated”. Vendor A writes “documents with 5-gram Jaccard similarity above 0.8 are treated as duplicates”. Vendor B writes “semantic deduplication at cosine similarity 0.95”. Your instinct may be that 0.95 is stricter and therefore cleaner. That instinct is wrong: 0.8 and 0.95 are not two marks on the same ruler, they are measurements of two different things. This article is about how each ruler works and what you can check at acceptance.

Start with two quotes

A fictional scenario. You are buying one million product titles with descriptions to train a category classifier. Vendor A's quote says documents with 5-gram Jaccard similarity above 0.8 are treated as duplicates and removed whole. Vendor B's quote says embedding-based semantic deduplication at cosine similarity above 0.95. Both claim the result is cleaner and trains faster.

You ask for retention. A keeps 820,000 rows, B keeps 610,000. That is a real difference, and you cannot yet say who is right, because some of B's 210,000 removed rows may be genuine duplicates while others are the same product in a different colour, capacity or edition. In embedding space those sit almost on top of each other. In your catalogue they must all survive.

What each parameter actually controls

Take exact and near matching first. A systematic deduplication effort offers two complementary tools: one uses a suffix array to find spans that repeat verbatim and removes only those spans, keeping the rest of the document; the other uses MinHash to find whole documents with high overlap. That matcher estimates Jaccard similarity from n-gram shingles, then confirms with edit similarity, and deletes the whole document only when both pass.[1] The paper reports the values it used, but they were tuned for English web text; on your corpus the threshold has to be re-derived, not copied.

Those thresholds do different jobs. The n-gram length decides how short a repeat still counts: at 5, templated sentences and product-name-plus-spec patterns light up everywhere; make it longer and only long copied passages are caught, while short templates slip through. The Jaccard threshold decides how much overlap makes two documents the same: lower it and lightly rewritten versions go too, raise it and only near-identical copies are removed. The minimum span length is a third dial controlling the granularity of span-level deletion.

Semantic deduplication is the other lineage. It embeds every item with a pretrained model, clusters the vectors with k-means (the paper used different cluster counts for image-text and text data, in the tens of thousands), compares cosine similarity only inside a cluster, and treats pairs at or above 1 minus epsilon as semantic duplicates, keeping one.[2] Here epsilon is “how similar counts as similar”: larger epsilon means a coarser notion, and more deletion.

ParameterWhat it controlsTurn it upTurn it down
n-gram lengthHow short a repeat is detectableOnly long copied passages; templated short sentences escapeShort templates flood the matches; wrongful deletion rises
Jaccard thresholdHow much overlap counts as the same documentOnly near-verbatim copies removed; more paraphrases keptRewritten versions also deleted; deletion volume jumps
Minimum span lengthGranularity of span-level deletionOnly long repeats removed; short repeats stay in the textShort repeats cut out; documents may become incoherent
Semantic threshold (1 minus epsilon)How similar counts as semantically equalOnly near-identical items removed; less deletionSame-topic paraphrases removed; diversity drops
Cluster countComparison scope and costFiner clusters, more precise but slowerCoarser clusters, more cross-topic false matches

Read the table and one conclusion follows: these parameters have no correct value, only a value chosen for your data. The same settings that suit product descriptions can be disastrous on legal text, where boilerplate is supposed to repeat.

Exact dedup and semantic dedup are not the same question

Exact deduplication asks whether this string appears somewhere else. Semantic deduplication asks whether these two items say the same thing. The first is a text-level judgement: recomputable, explainable, stable across people and runs. The second depends on an embedding model, which means “semantic” is defined by that model; swap the model and the judgement changes.

That produces a gap buyers routinely miss. B's “0.95” has an omitted subject: 0.95 in whose embedding space. The same threshold against a general-purpose encoder that never saw your domain will behave completely differently. A quote that states a threshold without stating the embedding model has stated nothing usable.

Exact matching has its own blind spot, and the paper documents a common one: web corpora contain many documents that differ only in templated fields such as place names, dates or product names, with everything else copied verbatim. Two methods handle these differently — near-duplicate matching deletes the whole document, span matching keeps the document and cuts the repeated span.[1] Which you want depends on whether the model should learn the template structure or only what sits outside it.

How to verify it at acceptance

A fictional example, but every step is executable. You hold A's 820,000 rows and B's 610,000 from an original pool of one million, and you have half a day to decide whether either is usable and at what price.

  1. Request a decision-rule card: algorithm, n-gram length or embedding model and version, similarity definition, threshold, deletion granularity (span, document or cluster), whether it crosses languages, whether it crosses batches. One missing field and it goes back.
  2. Sample the deletions: draw 200 removed items at random, look at each alongside the record it matched, and judge by hand whether it should have been removed. This is manual work, and it produces the hardest number you will get.
  3. Compute a wrongful-deletion rate and split it by type. If 18 of A's 200 should have stayed, that is 9%; if 54 of B's should have stayed, that is 27%, and 31 of those are the same product in different specs. The breakdown matters more than the total, because it tells you where the method is biased for your business.
  4. Run a threshold sensitivity check: ask for the same pipeline at 0.7, 0.8 and 0.9, and plot retention and wrongful deletion. A steep curve means the result is highly sensitive and the quality is not under control; a flat curve means the threshold choice barely matters.
  5. Compare downstream: same base model, same evaluation, one run on the kept set and one on the undeduplicated set. This is the only experiment that answers whether deletion helped. The sampling above only answers whether it deleted the right things.

The third step is where the judgement lives. A 27% wrongful-deletion rate sounds damning, but if everything wrongly removed was duplicated marketing boilerplate, it may be fine. If what was removed was different product capacities, your classifier will never learn that dimension. The same number, sorted into different buckets, supports opposite conclusions.

What a threshold cannot tell you

Another limit worth admitting: the deletion rate is not a quality metric. Deleting a lot may mean the data was dirty or that the method was aggressive; deleting little may mean the data was clean or that the threshold does nothing. The paper reports near-duplicate rates in the low single digits for web data and reports span-level removal taking a substantial share of tokens — those numbers establish that duplication is common, not that any particular deletion rate is correct.[1]

There is a further layer: the benefit of semantic deduplication depends on the downstream task. Removing close to half of a large image-text set while holding performance is a result from specific data and specific evaluations[2]; on your category task, the half that was removed may contain exactly the fine distinctions your labels depend on. “Someone else deleted half with no loss” is a hypothesis to test, not an acceptance criterion.

One action for today: turn the decision-rule card into a fixed table and send it to every vendor. Four fields — algorithm, parameters, granularity, keep-list. Quotes that cannot fill it in wait. The table solves no technical problem, but it makes incomparable things comparable, and most procurement mistakes happen while believing two things are the same.

References

  1. Deduplicating Training Data Makes Language Models Better
  2. SemDeDup: Data-efficient learning at web-scale through semantic deduplication

Read next

All articles

Sign in to Padda

A code in your inbox. No password to remember.

Connecting to sign-in…