# Phase Transitions in Attention: A Bayesian Theory of Copy Head Emergence

*Itay Lavie, Kirsten Fischer, Andrey Lekov, Frederic Van Maele, Zohar Ringel, Moritz Helias*

[NeurIPS page](https://neurips.cc/virtual/2026/poster/148770) · [Open on the map](../papers.html#p148770)

Category: [Interpretability & Model Adaptation](../pcat/15.md) › [Transformer Attention Theory](../pgroup/150.md) · Type: theory · Keywords: attention mechanisms, phase transitions, Bayesian theory, transformer models, copy subcircuit, softmax attention

Areas: [LLM Reasoning](../areas/reasoning.md) › Efficient Reasoning › Transformer Circuits; [Model Architectures & Sequence Modeling](../areas/architectures.md) › Language Model Architectures › Attention Geometry

## Summary
The paper provides a Bayesian theory that explains the abrupt emergence of the copy head subcircuit in attention via a phase transition, revealing first-order behavior in softmax attention and a different transition pattern in linear attention.

## Explained to a 5-year-old
Computers that read text sometimes learn to pay attention to certain parts. While they are learning, they can suddenly start copying information they saw before. Scientists used math to figure out why this copying happens all at once. They showed that this sudden copying appears when the computer sees enough examples. This helps us understand how these computer brains work.

## Explained to a 5-year-old, longer
A transformer is a kind of computer program that tries to understand words. It has a special way of focusing on parts of the text, called attention. While it practices, it slowly learns which parts are important. At some point, it suddenly begins to copy a piece of information it just saw, like a shortcut. The researchers built a mathematical model to see why this copying appears abruptly. They discovered that the copying emerges when the program has seen enough examples to trigger a change. This change is similar to a phase transition, like water turning into ice. They also compared this behavior with a simpler type of attention and found it behaves differently. The study helps explain a mysterious behavior seen in large language models. It shows that sudden jumps in learning can happen in many artificial intelligence systems. Understanding these jumps can help designers create better and more predictable models.

## For a technical reader
The paper investigates why attention patterns in transformer models sometimes appear suddenly during training. Using Bayesian analysis, the authors derive a mathematical description of how the attention matrix evolves as more data is seen. They discover that softmax attention undergoes an abrupt, first-order transition, while linear attention changes more gradually. These insights explain the emergence of a copying subcircuit observed in large language models. The work provides a theoretical foundation for understanding and potentially guiding such behavior.

## Problem
Understanding why structured attention patterns appear suddenly during transformer training and what drives these abrupt transitions is a fundamental open question.

## Method
The authors develop a Bayesian framework for feature learning in attention, derive a closed-form posterior over the attention matrix, reduce it to a low-dimensional order parameter space, and analyze how the amount of training data triggers phase transitions, validating predictions with Bayesian sampling and standard Adam training.

## Contributions
A first-principles Bayesian theory that accounts for the sudden appearance of the copy subcircuit, analytical reductions to order parameters, and a comparative study showing first-order versus second-order phase transitions in softmax and linear attention respectively.

## Research questions this paper is counted under

- [How does attention in transformers evolve and affect model behavior under training, noise, context length, and scale?](../q/207.md)

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. [Suggest a correction](../feedback/?on=p/148770)
