LLM output deduplicator
LLMs frequently pad answers by restating the same point in slightly different words — “In summary…”, “To reiterate…”, “As mentioned above…”. This tool finds those near-duplicate sentences and removes them, keeping the first occurrence of each idea and showing you exactly what it dropped and which sentence it matched.
This matters most for long-form outputs: research summaries, multi-section reports,
and anything generated with a high max_tokens budget. Models under instruction to
be thorough routinely conclude with a paragraph that echoes the introduction, re-list
key points already mentioned, or open each section with a sentence restating the
previous section’s conclusion. Removing those echoes without re-reading the whole
response is what this tool is for.
How it works
The text is split into sentences on terminal punctuation. Each sentence is normalized to lowercase and reduced to a set of word bigrams (overlapping two-word sequences), which captures phrasing better than single words. Sentences are then compared pairwise using the Jaccard index — the size of the intersection of their bigram sets divided by the size of the union. The first sentence is always kept; each later sentence is removed only if its similarity to an already-kept sentence meets or exceeds your threshold. Removed sentences are listed alongside the sentence they duplicated.
Worked example
Suppose a model returns these three sentences:
- “Machine learning models require labeled training data to learn from examples.”
- “Deep neural networks can process images, audio, and text at scale.”
- “To learn from examples, machine learning systems need labeled training data.”
Sentences 1 and 3 share the bigrams machine learning, learning models/systems,
training data, and labeled training — enough for a Jaccard score well above 0.7.
Sentence 3 is dropped as a near-duplicate of sentence 1; sentence 2 is kept because
it covers a different idea. The tool shows you the match so you can confirm the
removal was correct.
Choosing the right threshold
| Threshold | What it removes |
|---|---|
| 0.5 | Aggressive — catches paraphrases that share about half their bigrams |
| 0.7 | Default — catches obvious restatements, keeps genuinely distinct sentences |
| 0.9 | Conservative — only removes sentences that are near word-for-word repeats |
Start at 0.7 and lower only if you see many similar sentences surviving, or raise it if unrelated sentences are being dropped.
Tips and notes
- Start at 0.7. It removes obvious restatements while preserving distinct points; adjust from there based on the output you see.
- Order is preserved. The first time an idea appears it is kept; only later echoes are removed, so the logical flow stays intact.
- It never rephrases. Kept sentences are returned word-for-word, so the result is always a faithful subset of your input.
- Local only. No text leaves your browser, making it safe for private or proprietary content.
- Best on prose, not bullet lists. The bigram method works on flowing sentences; very short list items may not have enough words to score reliably — review those manually if a list survives that looks repetitive.