# Repetition Penalty

- **Canonical URL:** https://getaimath.com/dictionary/repetition-penalty/
- **Topics:** [LLM Fundamentals](https://getaimath.com/dictionary/category/llm-fundamentals/)
- **Last updated:** 2026-11-25

## What is Repetition Penalty?

**In one sentence:** A repetition penalty is a setting that makes a model less likely to repeat the same words or phrases over and over.

Models sometimes get stuck in loops, saying the same thing again and again. A repetition penalty lowers the chance of tokens that have already appeared, nudging the model toward fresh wording.

![How ChatGPT & Claude Talk: Super-Powered Autocomplete — Simple cartoon diagram showing a sentence chopped into Lego word blocks (tokens), an AI brain weighing the odds of the next word ("mat" 75%, "couch" 18%, "roof" 5%), and snapping "mat" onto the end of the sentence.](https://getaimath.com/diagrams/llm-fundamentals.png)
*Napkin Diagram (LLM Fundamentals): Language models don’t plan whole essays at once—they play a super-smart game of "guess the very next word" over and over.*

## What is an example of Repetition Penalty?

Without a penalty, a model might write "very very very very good"; with one, it is more likely to write "really excellent."

## Why does Repetition Penalty matter?

It keeps generated text readable and less robotic.

## Related Concepts

- [Top-P Sampling](https://getaimath.com/dictionary/top-p-sampling/): Top-P sampling means the model picks from the smallest group of likely tokens whose chances add up to P, such as 90%.
- [Logits](https://getaimath.com/dictionary/logits/): Logits are the raw scores a model gives every possible next token before they are turned into probabilities.
- [Top-K Sampling](https://getaimath.com/dictionary/top-k-sampling/): Top-K sampling means the model only chooses the next token from its K most likely options.
- [Softmax](https://getaimath.com/dictionary/softmax/): Softmax is a math function that turns a list of raw scores into probabilities that add up to 100%.
- [Temperature](https://getaimath.com/dictionary/temperature/): Temperature is a setting that controls how random or creative a model's answers are.
- [Probability Distribution](https://getaimath.com/dictionary/probability-distribution/): A probability distribution is a list of every possible outcome with the chance of each one happening, adding up to 100%.

---
Source: The AI Math Dictionary (https://getaimath.com/dictionary/repetition-penalty/)
