Jargonautica
Language Models Specifically

Repetition Penalty

A blunt setting that discourages the model from saying the same thing again. It fixes visible looping and, pushed too hard, stops the model repeating words it genuinely needs, such as a name or a technical term used throughout a document.

Technical view

Divides or subtracts from the logits of previously generated tokens, in variants including presence and frequency penalties and n-gram blocking. It treats all repetition as undesirable, which damages structured output, code and any text with legitimate recurring vocabulary. Repetition is usually a symptom of low-temperature decoding or a weak model, so adjusting sampling is generally the better fix.


Part of AI Terminology Index, section: Language Models Specifically.

How it connects

Repetition Penalty links to 4 other terms. The faint lines are links between those terms. See it in the full graph.

Structured OutputStructured OutputTemperature and SamplingTemperature and Sam…Greedy DecodingGreedy DecodingLogit BiasLogit BiasRepetition Penalty