Table of Contents
Fetching ...

Repetition Neurons: How Do Language Models Produce Repetitions?

Tatsuya Hiraoka, Kentaro Inui

TL;DR

Repetition in text generation under greedy decoding is analyzed by identifying repetition neurons—specific neurons in Transformer feed-forward blocks whose activations rise as repetition unfolds. The authors propose a simple, neuron-level method to identify them by comparing activations before and after repetition onset and use the score $Δ_n = \bar{a}_n - a_n$ to select top-$K$ neurons, validating the phenomenon across four languages/models. They show that deactivating these neurons reduces repetition by up to 25–35% with limited perplexity degradation, while activating them increases repetition and worsens perplexity, and they explore the relationship to induction and self-finding heads. The work provides a broad, cross-model view of repetition mechanisms, suggests practical mitigation via targeted neuron interventions, and highlights language- and model-size dependent differences.

Abstract

This paper introduces repetition neurons, regarded as skill neurons responsible for the repetition problem in text generation tasks. These neurons are progressively activated more strongly as repetition continues, indicating that they perceive repetition as a task to copy the previous context repeatedly, similar to in-context learning. We identify these repetition neurons by comparing activation values before and after the onset of repetition in texts generated by recent pre-trained language models. We analyze the repetition neurons in three English and one Japanese pre-trained language models and observe similar patterns across them.

Repetition Neurons: How Do Language Models Produce Repetitions?

TL;DR

Repetition in text generation under greedy decoding is analyzed by identifying repetition neurons—specific neurons in Transformer feed-forward blocks whose activations rise as repetition unfolds. The authors propose a simple, neuron-level method to identify them by comparing activations before and after repetition onset and use the score to select top- neurons, validating the phenomenon across four languages/models. They show that deactivating these neurons reduces repetition by up to 25–35% with limited perplexity degradation, while activating them increases repetition and worsens perplexity, and they explore the relationship to induction and self-finding heads. The work provides a broad, cross-model view of repetition mechanisms, suggests practical mitigation via targeted neuron interventions, and highlights language- and model-size dependent differences.

Abstract

This paper introduces repetition neurons, regarded as skill neurons responsible for the repetition problem in text generation tasks. These neurons are progressively activated more strongly as repetition continues, indicating that they perceive repetition as a task to copy the previous context repeatedly, similar to in-context learning. We identify these repetition neurons by comparing activation values before and after the onset of repetition in texts generated by recent pre-trained language models. We analyze the repetition neurons in three English and one Japanese pre-trained language models and observe similar patterns across them.

Paper Structure

This paper contains 18 sections, 2 equations, 14 figures, 3 tables.

Figures (14)

  • Figure 1: Activation values of top four repetition neurons for 30 tokens before and after repetition (Gemma-2B, averaged value over 1,000 texts). Repetition neurons are strongly activated in the repetition range.
  • Figure 2: $\Delta_n$ of all neurons sorted in the ascending order. The x-axis shows the relative rank of each neuron (i.e., 1.0 is the 294,912-th neuron in Gemma-2B).
  • Figure 3: The number of repetition neurons for each layer when considering the top 0.5% of the entire neurons are repetition neurons. The x-axis shows the relative location of layers against the number of entire layers (e.g., 1.0 is the 18th layer in the case of Gemma-2B).
  • Figure 4: The number of samples with repetition after deactivating the repetition neurons for the texts originally with repetition.
  • Figure 5: The number of samples with repetition after activating the repetition neurons for the texts originally without repetition.
  • ...and 9 more figures