Solving LLM Repetition Problem in Production: A Comprehensive Study of Multiple Solutions
Weiwei Wang, Weijie Zou, Jiyong Min

TL;DR
This paper investigates the repetition problem in Large Language Models during production, analyzing its causes and evaluating multiple practical solutions like beam search, presence penalty, and DPO fine-tuning for real-world deployment.
Contribution
It provides a comprehensive theoretical analysis and experimental validation of various solutions to mitigate LLM repetition issues in production environments.
Findings
Beam Search with early stopping effectively resolves all repetition patterns.
Presence penalty helps specifically with business rule repetition.
DPO fine-tuning offers a universal solution for various repetition cases.
Abstract
The repetition problem, where Large Language Models (LLMs) continuously generate repetitive content without proper termination, poses a critical challenge in production deployments, causing severe performance degradation and system stalling. This paper presents a comprehensive investigation and multiple practical solutions for the repetition problem encountered in real-world batch code interpretation tasks. We identify three distinct repetition patterns: (1) business rule generation repetition, (2) method call relationship analysis repetition, and (3) PlantUML diagram syntax generation repetition. Through rigorous theoretical analysis based on Markov models, we establish that the root cause lies in greedy decoding's inability to escape repetitive loops, exacerbated by self-reinforcement effects. Our comprehensive experimental evaluation demonstrates three viable solutions: (1) Beam…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware System Performance and Reliability · Software Engineering Research · Machine Learning in Materials Science
