Repetition Filter
Strips degenerate repetition loops from LLM output — repeated lines, looping phrases and character cycles — while keeping the first occurrence of everything, so no unique information is lost.
About
Repetition Filter
AI models sometimes get stuck and repeat themselves — the same line or phrase, over and over, until they run out of room. This tidies up the repetition, leaves everything else exactly as it was, and tells you when an answer went off the rails.
The problem
You've probably seen it. An answer starts out fine, then the model latches onto a phrase and can't let go:
Thanks for getting in touch! Your order #4471 shipped on Tuesday and should arrive by Friday. The tracking link is in your confirmation email. Let me know if there is anything else I can help with. Let me know if there is anything else I can help with. Let me know if there is anything else I can help with. Let me know if there is anything else I can help with. Let me know if there is anything else I can help with. Let me know if there is anything else I can help with.
Smaller and cheaper models do this more often. It's not a rare edge case — it's the single most common way a good answer turns into an unusable one.
What you get
Drop the Filter Repetition node into your flow, connect your text, and the same answer comes out clean:
Thanks for getting in touch! Your order #4471 shipped on Tuesday and should arrive by Friday. The tracking link is in your confirmation email. Let me know if there is anything else I can help with.
Nothing was rewritten. The sentence was said six times, so five copies went and one stayed. Everything around it is untouched, character for character.
Four things come out of the node
Filtered Text | Your text, cleaned up. Use this instead of the original. |
Degenerate | Yes or no — did this answer go off the rails? Wire it into a branch to retry the model or send the answer for a human to look at. |
Repetition Ratio | How much of the answer was repetition, from 0 to 1. Handy for dashboards and alerts. |
Report | The full story: every loop it found, how many times each one repeated, and how repetitive the text was before and after. |
Where it helps
- Chatbots and support replies — catch a broken answer before a customer sees it.
- Summaries and long-form writing — models drift into loops most often near the end.
- Document and image transcription — a model reading a scan can get stuck on a region and emit the same fragment hundreds of times.
- Anywhere you use a small or local model — the cheaper the model, the more this earns its place.
It won't eat your content
This is the part worth trusting, so here's exactly how it behaves:
- It only ever deletes. Nothing is reworded, reordered, shortened or regenerated. Every character that comes out went in.
- The first copy always survives. A phrase repeated fifty times becomes that phrase once — never zero times. Whatever the loop was trying to say is still in there.
- Repeats have to be back to back. A heading that legitimately appears on every page isn't a loop, and it stays.
- Short repeats stay. "Very, very, very good" is someone writing for emphasis, not a model breaking.
- Layout and formatting are left alone. Blank lines, indentation, bullet lists, table dividers, dotted lines in a contents page — all untouched.
Settings
The defaults are tuned to be careful, and most flows never need to change them. Two are worth knowing about:
keep_copies— keep two or three copies instead of one, if you'd rather see a little of the loop than none of it.
near_duplicate_cycles— on by default. This catches loops where each copy differs slightly, like a line number or timestamp ticking up. Turn it off if your text has long runs of rows that differ only by a number and that number matters — measurement tables, price lists, time series.
Everything else — how long a repeat has to be, how many times it has to repeat — is adjustable if you want to be stricter or more aggressive.
Privacy
Nothing leaves your machine. The node does its work inside the Flow-Like sandbox with no network access, no file access and no model calls. Your text is never sent anywhere, and there's nothing to pay for per use.
Use Case
Removing LLM Repetitions
Provided Nodes
1 node included in this package.
Text / Cleanup
Removes degenerate repetition loops from model output — repeated lines, looping phrases and character cycles — while keeping the first occurrence of everything, so no unique information is lost. Also reports how repetitive the input was, so a flow can retry or flag a bad generation.