AI 101

Repetition penalty

Also known as: repetition · presence penalty

Inference

A repetition penalty lowers the probability of tokens the model has already produced, discouraging it from looping over the same phrases.

It’s the go-to fix for output that goes in circles (“and that’s why… and that’s why…”).

  • Presence penalty: penalizes any previously used token.
  • Frequency penalty: penalizes in proportion to how often it’s been used.

Calibrate, don't max: a little repetition penalty fixes loops; a lot of it makes the model avoid perfectly normal repeated words. Start around 1.05–1.2.