Greedy decoding walks in circles
Language models trained purely by maximum likelihood have a famous failure mode, documented by Holtzman and colleagues: under maximization-based decoding they repeat themselves. Our baseline reproduces it on cue. Fine-tuned on WikiText-103 and decoded greedily, GPT-2 medium turns a biography prefix into the same clause forever: promoted to the rank of CB, promoted to the rank of CBE, four words rotating until the token budget runs out.
We measure the loop with sequence repetition, , the fraction of duplicate 4-grams in a continuation. The looping sample above scores 0.65. Human text almost never repeats a 4-gram, so the target is near zero, and perplexity has to stay put while we get there.
The loop, verbatim
DegenerationWhen you cannot write down the negatives
The strongest training-time fix is unlikelihood training, from Welleck and colleagues: alongside likelihood, minimize , which pushes down the probability of negative candidates , in practice the tokens that would extend an already-seen n-gram. It works, but only after has been spelled out by hand.
That requirement is the crack we aim at. For repetition the negatives are easy to enumerate. For a property like toxicity, scored by an external classifier, there is no natural candidate set to punish. So we make the unlikelihood implicit: fine-tune with policy-gradient reinforcement learning against the metric itself, with the reward of a sampled continuation defined as . Anything you can score, you can train against.
Three losses take turns
Training alternates three updates, gated by an update rate . With probability we take an ordinary likelihood step on real text, which anchors perplexity. Otherwise a fair coin picks either a sequence-level unlikelihood step or a policy-gradient step, so each runs at rate . Unlikelihood training is exactly this scheme with the policy-gradient path removed.
One gate, three updates
Training mixerThe policy-gradient step is deliberately plain REINFORCE. We greedily decode 100-token continuations for a batch of fifty-token prefixes, score each sequence with , and subtract the batch mean as a baseline, , giving the loss
Each token's log-probability is weighted by how much its sequence beat the batch average. A coefficient scales this loss against the other two; we sweep . The greedy rollouts are load-bearing: every other sampling scheme we tried made the repetition metric converge worse.
Several times less repetition at the same perplexity
Perplexity against greedy repetition
greedy seq_rep_4, lower is betterThe components compound rather than compete. Unlikelihood alone leaves greedy repetition at 0.056 with perplexity 19.44; policy gradient alone reaches 0.032; run together inside i-UT, repetition lands between 0.005 and 0.009 while perplexity improves to 19.17 at . The count of unique generated tokens rises too, from 11,210 to 11,432.
Repetition across decoding strategies
seq_rep_4Beam search is where models loop hardest
seq_rep_4On held-out test data with GPT-2 medium the wins are consistent rather than cosmetic: softmax perplexity improves from 13.83 for plain fine-tuning to 13.16, the Jensen-Shannon divergence to the ground-truth distribution is lowest for i-UT under every sampling scheme we evaluated, and the model produces the most unique tokens, 20,493 against 19,932.
What did not work, and what opens up
We report the dead ends because they shaped the recipe. Proximal Policy Optimization destabilized validation perplexity and never produced comparable results. Replacing the one-reward-per-sequence estimator with per-token rewards, with or without generalized advantage estimation, always lost to a single sequence reward minus the batch mean. And rollouts sampled any way other than greedily made the repetition metric converge worse.
The point of making unlikelihood implicit was never repetition alone. The same loop optimizes any property of generated text you can score, with toxicity and bias the objectives we want next. Repetition was the controlled experiment showing the loop works without paying in language-model quality.
If you can score a property of generated text, you can train against it directly; repetition was just the first target.