Induction Heads Interpolate N-Grams
Abstract
Lay Summary
One of the most striking abilities of large language models is in-context learning: the ability to adapt to a new task from examples given in the prompt, without changing the model’s parameters. One proposed explanation is that these models contain small internal circuits, or recurring patterns of computation, that carry out useful prediction strategies. A well-known example is the induction head, which looks back through the prompt, finds earlier patterns that resemble the current one, and copies the token that followed those patterns. This paper studies what induction heads are actually doing in a controlled sequence-prediction setting. Previous work often described them as simply counting exact repeated patterns. We show that they can do something richer: they also use partial matches, giving more weight to past contexts that are more similar to the current one. This helps the model make better predictions when exact repeats are rare. We also show that a special beginning-of-sequence token can help the model avoid overconfident predictions when there is little evidence, acting like a built-in smoothing mechanism. Overall, our results connect transformer circuits and induction heads with classical methods for improving sequence prediction, showing that transformers do more than memorize and count: they learn to combine evidence from context in a statistically useful way.