n-Gram Blocking
Definition
Repeated word or token sequences can be blocked during generation.
A decoding rule prevents sequences of a fixed length that have already been generated from appearing again. It limits repetitions regardless of semantic meaning.
Simply explained
A text engine must not constantly repeat the same short word sequence.
Why it matters in practice
This can reduce annoying repetition loops.
Example from business
Hypothetical example: A generator blocks already used triplets in a longer draft.
Limits and pitfalls
- Required names or technical terms can also be blocked.
Origin & history
The method belongs to rule-based interventions in text decoding.
Use in mid-sized companies
- SMEs should only use it together with readability and technical checks.
Frequently asked questions
Does it eliminate semantic redundancy?
Not reliably, because identical statements can be formulated differently.
Sources
- Text generation configuration — · Hugging Face: Text generation configuration —
Editorially reviewed on: