How to reduce repetition with frequency_penalty
The frequency_penalty
parameter helps you control how often the model repeats words or phrases.
- Positive values → penalize tokens that have already appeared → model is less likely to repeat itself.
- Negative values → encourage more repetition (rarely used).
How it works:
- After each token is generated, the model adjusts the probability of generating the same tokens again, based on how often they have already been used.
- This helps you create more varied and natural-sounding text.