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.

Level: intermediateTopic: Prompt context engineering

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

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.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.