Repetition failure in large language models is one of those problems that feels embarrassingly mundane until you look closely at it. A model asked to list all 151 original Pokémon collapses into a tight loop, repeating the same entry until the generation budget runs out. This happens at rates as high as 95% in some Gemma 4 configurations, survives prompt rewording, and resists most standard sampling fixes. The question this paper asks is whether that failure is localised enough in the network to simply edit out. The answer, for most of the failure modes studied, turns out to be yes.
The work sits at the intersection of mechanistic interpretability and practical model editing. It draws direct inspiration from Kazemi et al. (2026), who showed a single MLP neuron mediates the refusal axis in safety-tuned LLMs. The analogy is tight: if safety behaviour can concentrate in one neuron, can pathological generation behaviour do the same? Across four Gemma 4 models of varying scale, the answer is broadly affirmative, though the required intervention grows with model size.
What the Paper Contributes
The authors make several distinct contributions worth separating out:
- A taxonomy of two loop phenotypes: tight loops (exact token-level periodicity) and soft loops (surface list structure preserved but entries converge to a repeated answer). Both are captured by a deterministic, prompt-agnostic detector they release alongside the work.
- A per-layer ablation methodology for identifying which MLP layers and individual neurons carry the loop-driving signal, combined with a gradient-times-activation attribution score to rank neurons within a candidate layer.
- Empirical weight surgery results across all four Gemma 4 models, with edited weights released on Hugging Face.
- An analysis of doom looping, a distinct failure mode at extended generation budgets where the model self-corrects in circles over a fact it cannot recall, never committing to an answer. This is characterised as a knowledge-precision problem rather than a removable circuit.
Methodology
The localisation procedure is clean and replicable. For a captured looping rollout, the authors split generated tokens into a pre-loop set (positions 200 to start minus 50) and a loop set (start plus 50 to end), then compare internal activations across these two windows. A per-layer ablation sweep zeros out attention or MLP outputs one layer at a time and measures the change in probability assigned to the next loop token. This identifies candidate layers where the loop signal concentrates.
Within those candidate layers, individual neurons are scored using a gradient-times-activation attribution: the product of the post-gate activation and the gradient of the loop-token log-probability with respect to that activation, summed across positions. This approximates the counterfactual effect of zeroing each neuron's write direction into the residual stream, and it does so in a single forward-backward pass rather than one pass per neuron.
One methodologically important finding emerges from the E2B model: the layer where the loop token is most strongly committed to the residual stream (L13-L15 by ablation) is not the layer where a static edit most effectively prevents the loop from forming (L10/L12, found by full-generation sweeps). This replicates, in a behavioural context, the dissociation Hase et al. (2023) observed for factual knowledge editing: localisation and optimal intervention site need not coincide. It is a useful reminder that single-token ablation probes a different thing than multi-step trajectory dynamics.
The Mixture-of-Experts 26B model requires a different approach. Because the shared MLP accounts for only about 27% of FFN compute, stripping shared MLP neurons causes severe benchmark regression. Instead, the authors score router-selection frequency for each (layer, expert) pair across loop versus pre-loop tokens, identifying expert slots that jump from under 6% selection pre-loop to over 60% inside the loop. Three expert slots are masked, touching 0.078% of the 3,840 total expert positions.
Results
The headline numbers are striking. For E2B, sign-inverting one L10 neuron and amplifying one L12 neuron (two neurons total, 0.0009% of FFN parameters) eliminates all 13 loop failures across 128 generations in both thinking modes. For E4B, stripping three L18 neurons (0.0007% of FFN parameters) eliminates all thinking-enabled failures and leaves two soft-loop residuals in thinking-disabled mode. The 31B model requires stripping 1,100 L36 neurons (0.085% of FFN parameters) to reach zero thinking-enabled failures. The 26B MoE edit reduces tight loops from 6/64 to 2/64 with thinking enabled.
Benchmark costs are small. Across IFEval, TruthfulQA, ARC-Easy, ARC-Challenge, and GSM8K, the selected variants stay within roughly plus or minus one percentage point for 31B and 26B, and within minus 1.3 to plus 1.7 percentage points for E2B. These are not zero-cost edits, but they are modest relative to the failure rates being corrected.
The doom looping analysis is less encouraging, and the authors are candid about it. At extended generation budgets, the two larger models enter a non-convergent self-correction regime that the weight edits reduce but do not eliminate. The argument that this reflects missing factual knowledge rather than a removable circuit is plausible, though it is more of a motivated hypothesis than a demonstrated result. A model that cannot recall which episode of The Wire is which cannot be fixed by editing the mechanism that prevents it from looping; it needs the knowledge itself.
Implications and Limitations
The broader implication is that certain generation pathologies in large models are genuinely localised at the parameter level, not just at the level of attention heads or layers. The finding that three neurons out of 430,080 can eliminate a reproducible 95% failure rate is the kind of result that should inform how the field thinks about post-training model repair. It suggests that not every behaviour requiring correction needs retraining or RLHF; targeted weight edits may suffice for well-characterised failure modes.
There are real limitations to acknowledge. The intervention search is empirical rather than principled: the authors are explicit that reported configurations are one set that works, not a guaranteed optimum. The attribution method is a first-order approximation, and the disconnect between ablation-identified layers and effective intervention layers in E2B suggests the approximation can mislead. The evaluation grid is also relatively small (8 prompts times 8 seeds), which is enough to demonstrate the effect but not enough to characterise generalisation across the full distribution of enumeration tasks.
The unconditional nature of the expert masking in 26B is worth flagging. Zeroing expert slots for every token on every prompt is a blunt instrument. The authors note that conditional masking, applied only when a runtime loop detector fires, would be more surgical, but would require custom inference code. For a static weight replacement this is a reasonable trade-off, but it means the edit is paying a small general-purpose cost on every generation to prevent a failure that occurs on a subset.
The work is a clean feasibility demonstration with honest scope. Weight surgery can delete a loop; it cannot supply a missing fact. That delineation is itself a useful contribution to how the field should think about the limits of parameter-level intervention.