AI engineering glossary · Prompt context engineering
What is repetition penalty?
Repetition penalty: A setting, common in open-source inference tools, that divides or reduces the score of tokens already present in the text so far, discouraging loops. It acts similarly to frequency and presence penalties but is defined by its own formula.
Repetition penalty: an example
In a local model server, repetition_penalty=1.1 stops a story from repeating the same sentence.
Related terms
More Prompt context engineering terms
- Rephrase and Respond
- Role prompting
- Rolling summary
- Schema-constrained generation
- Scratchpad
- Seed parameter
- Self-ask
- Self-consistency
Where you learn it
Repetition penalty is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.