AI Glossary Term

What does “Repetition Penalty” mean?

Definition

A decoding setting that lowers the probability of tokens the model has already produced to reduce loops.

How Repetition Penalty works

Diagram for Repetition Penalty, steps in order: Model has already written 'very very'; then Penalty lowers probability of repeating those tokens; then Different word is more likely; then Less looping text.Model has already written 'very very'Penalty lowers probability ofrepeating those tokensDifferent word is more likelyLess looping text

Example

Without a penalty, a model might loop with 'the best of the best of the best'. A modest penalty on repeated tokens nudges it to move on.

Why it matters

Repetition loops make text unreadable. Too strong a penalty can stop the model from reusing words it legitimately needs, such as names.

Common questions

Repetition vs frequency penalty?

They are similar. Frequency penalty scales with how many times a token appeared; repetition penalty is often applied once to any seen token.

Typical values?

Slightly above 1 in some systems; scales differ by software, so check the documentation.

Does it fix all loops?

Not always. It helps with simple loops but can distort legitimate repeats.

Learn more in our free guides

Test yourself

See also