Phase Transitions in Attention: A Bayesian Theory of Copy Head Emergence
Itay Lavie, Kirsten Fischer, Andrey Lekov, Frédéric Van Maele, Zohar Ringel, Moritz Helias
NeurIPS 2026
TL;DR. We present a first-principles theory explaining why copy heads emerge abruptly: softmax attention undergoes a first-order phase transition.
Abstract. Attention is the key mechanism underlying in-context learning in transformers, and attention patterns have been observed empirically to emerge abruptly during training. We present a Bayesian theory of feature learning in attention; we then focus on how the copy subcircuit in the first layer of an induction head is learned by analyzing a single-layer softmax attention network trained on a copy task. We derive a closed-form posterior over the attention matrix and reduce it to a low-dimensional order parameter space. This reduction reveals a phase transition in the amount of training data, which we verify using both Bayesian sampling and standard training with Adam. We contrast our results with linear attention and find that softmax attention exhibits a first-order phase transition while in linear attention an initial second-order phase transition is followed by a smooth, continuous evolution toward the structured attention pattern (crossover). Our work provides a first-principles theoretical account of the abrupt emergence of the copy subcircuit, reminiscent of the one observed in training large language models.
Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.
Claim this paperedit · history
NeurIPS 2026
Accept (poster) · 5 reviews · OpenReview
Updated 25 Nov 2026, 03:49 UTC.
- Decision
- Accept (poster)
Read decision
Meta-review
I read the authors’ response and the full discussion, which was animated and useful,
The main concern was the two-parameter reduction. The authors now provide a closed-form derivation of Eq. (112) under an explicit rank assumption. They also acknowledge that the two-dimensional restriction is an empirically supported ansatz, not a proved consequence of the theory. The final paper must state this clearly and remove the claim that the reduction loses no information. This is a real limitation, but definitly not a reason to reject the paper.
The response also separates the equilibrium theory from training dynamics, explains the filtered Adam runs, reports similar SGD results, and makes clear that the model captures a copy subcircuit rather than a full induction head. The authors also give a much clearer comparison with related work and expand the analysis of competing minima, noise, and softmax temperature.
The reviewers found the response convincing. 2h5a and fbCx maintained their accept ratings, beA3 increased to accept, and giTG and VUAH increased to borderline accept. VUAH also corrected the contribution type. We now have three accept and two borderline accept ratings. These are excellent rates. The result is useful and original enough for NeurIPS.
I recommend acceptance as a poster.
PREVIOUS: Papers needing clarification/borderline assessment
This paper develops a Bayesian theory for the emergence of copy attention in a single-layer, single-head network trained on a supervised shift-by-one task. After marginalizing network weights, the authors obtain an effective posterior over attention patterns and describe it through order parameters representing uniform pooling and copying. The main claim is that linear attention undergoes a continuous second-order transition followed by a crossover, whereas softmax attention undergoes a discontinuous first-order transition. These predictions are compared with experiments.
The posterior-over-attention-patterns perspective is appealing, the contrast between linear and softmax attention is potentially valuable, and the controlled experiments show encouraging agreement with the reduced theory. These strengths are reflected particularly in the reviews from 2h5a, fbCx, and beA3. Overall, the paper appears close to the acceptance threshold. The current assessment is genuinely borderline: the conceptual contribution is promising, but several questions about mathematical rigor, interpretation, and positioning currently prevent a recommendation for acceptance. The response should prioritize the following points.
-
Please address giTG’s concern about the two-order-parameter reduction. Equation (11) introduces the reduction as an ansatz, whereas lines 181–182 claim that it entails no information loss. Appendix M nevertheless reports non-negligible out-of-subspace components near the crossover. In addition, Eq. (112), which enters the prior action and the predicted transition boundaries, is obtained by numerical matching of brute-force pseudo-inverses; Appendix D states that its coefficients were not derived analytically. Please distinguish clearly between proved asymptotic results, conjectured identities, and effective approximations. A convincing justification of Eq. (112) and of concentration onto the proposed subspace would be an important consideration in the final discussion. Otherwise, the claims of a first-principles, lossless reduction and any conclusions depending on it should be qualified. This is the highest-priority issue.
-
Please address 2h5a’s concerns about static analysis, optimization dynamics, and filtered runs, together with the related questions from beA3 and VUAH about scope. The theory characterizes the global MAP solution as (P) varies; it does not directly characterize circuit emergence over training time. The Adam comparison for linear attention retains only runs reaching the lowest-loss basin, while SGLD is warm-started from Adam. Please summarize the frequency and behavior of filtered runs and state precisely what the experiments establish about standard optimization. The response should also clarify the relationship between this supervised, content-independent, single-layer copy task and the formation of complete induction heads under next-token prediction. Extensive new experiments are not required, but the claims should be scoped to the evidence.
-
Please address fbCx’s questions about the first-order-transition phenomenology and noise/temperature, together with beA3’s concern about the monitoring interpretation. A discontinuity of the global MAP estimator does not by itself establish the absence of every possible precursor or intrinsic unpredictability. Competing minima, metastability, posterior bimodality, susceptibility, or hysteresis may provide information before the minima exchange dominance. Please explain when the second minimum appears, when the minima cross, and when the original solution loses stability, as well as the dependence on (\sigma^2), (\chi), and, if relevant, softmax temperature. The broad predictability claims should be restricted to what follows from the present equilibrium analysis.
-
Please address giTG’s and fbCx’s concerns about originality and positioning. Several recent solvable attention models already exhibit phase transitions, sharp sample thresholds, low-dimensional order parameters, Bayesian characterizations, or sequential learning. This includes the works identified in those reviews, as well as closely related high-dimensional analyses of SGD in sequence single-index and single-layer attention models. Note that merely adding citations would not fully resolve the issue. Please compare the models, asymptotic regimes, learned objects, control parameters, and equilibrium-versus-dynamical notions of transition. The apparent distinctive contribution here is the posterior directly over attention patterns and the comparison of transition order for linear and softmax attention; this distinction should be established explicitly.
The paper is presently close to the decision boundary. Clear and convincing responses, especially concerning the mathematical status of the reduction, would materially strengthen its case. Conversely, if the central transition formulas rely on an unsupported low-dimensional restriction or numerical identity while being presented as rigorous first-principles results, this would weigh significantly against acceptance. The final recommendation will depend on the author response, subsequent reviewer discussion, and overall calibration.
Final justification
See meta-review
- Final justification
- See meta-review
Read meta-review
Meta-review
I read the authors’ response and the full discussion, which was animated and useful,
The main concern was the two-parameter reduction. The authors now provide a closed-form derivation of Eq. (112) under an explicit rank assumption. They also acknowledge that the two-dimensional restriction is an empirically supported ansatz, not a proved consequence of the theory. The final paper must state this clearly and remove the claim that the reduction loses no information. This is a real limitation, but definitly not a reason to reject the paper.
The response also separates the equilibrium theory from training dynamics, explains the filtered Adam runs, reports similar SGD results, and makes clear that the model captures a copy subcircuit rather than a full induction head. The authors also give a much clearer comparison with related work and expand the analysis of competing minima, noise, and softmax temperature.
The reviewers found the response convincing. 2h5a and fbCx maintained their accept ratings, beA3 increased to accept, and giTG and VUAH increased to borderline accept. VUAH also corrected the contribution type. We now have three accept and two borderline accept ratings. These are excellent rates. The result is useful and original enough for NeurIPS.
I recommend acceptance as a poster.
PREVIOUS: Papers needing clarification/borderline assessment
This paper develops a Bayesian theory for the emergence of copy attention in a single-layer, single-head network trained on a supervised shift-by-one task. After marginalizing network weights, the authors obtain an effective posterior over attention patterns and describe it through order parameters representing uniform pooling and copying. The main claim is that linear attention undergoes a continuous second-order transition followed by a crossover, whereas softmax attention undergoes a discontinuous first-order transition. These predictions are compared with experiments.
The posterior-over-attention-patterns perspective is appealing, the contrast between linear and softmax attention is potentially valuable, and the controlled experiments show encouraging agreement with the reduced theory. These strengths are reflected particularly in the reviews from 2h5a, fbCx, and beA3. Overall, the paper appears close to the acceptance threshold. The current assessment is genuinely borderline: the conceptual contribution is promising, but several questions about mathematical rigor, interpretation, and positioning currently prevent a recommendation for acceptance. The response should prioritize the following points.
-
Please address giTG’s concern about the two-order-parameter reduction. Equation (11) introduces the reduction as an ansatz, whereas lines 181–182 claim that it entails no information loss. Appendix M nevertheless reports non-negligible out-of-subspace components near the crossover. In addition, Eq. (112), which enters the prior action and the predicted transition boundaries, is obtained by numerical matching of brute-force pseudo-inverses; Appendix D states that its coefficients were not derived analytically. Please distinguish clearly between proved asymptotic results, conjectured identities, and effective approximations. A convincing justification of Eq. (112) and of concentration onto the proposed subspace would be an important consideration in the final discussion. Otherwise, the claims of a first-principles, lossless reduction and any conclusions depending on it should be qualified. This is the highest-priority issue.
-
Please address 2h5a’s concerns about static analysis, optimization dynamics, and filtered runs, together with the related questions from beA3 and VUAH about scope. The theory characterizes the global MAP solution as (P) varies; it does not directly characterize circuit emergence over training time. The Adam comparison for linear attention retains only runs reaching the lowest-loss basin, while SGLD is warm-started from Adam. Please summarize the frequency and behavior of filtered runs and state precisely what the experiments establish about standard optimization. The response should also clarify the relationship between this supervised, content-independent, single-layer copy task and the formation of complete induction heads under next-token prediction. Extensive new experiments are not required, but the claims should be scoped to the evidence.
-
Please address fbCx’s questions about the first-order-transition phenomenology and noise/temperature, together with beA3’s concern about the monitoring interpretation. A discontinuity of the global MAP estimator does not by itself establish the absence of every possible precursor or intrinsic unpredictability. Competing minima, metastability, posterior bimodality, susceptibility, or hysteresis may provide information before the minima exchange dominance. Please explain when the second minimum appears, when the minima cross, and when the original solution loses stability, as well as the dependence on (\sigma^2), (\chi), and, if relevant, softmax temperature. The broad predictability claims should be restricted to what follows from the present equilibrium analysis.
-
Please address giTG’s and fbCx’s concerns about originality and positioning. Several recent solvable attention models already exhibit phase transitions, sharp sample thresholds, low-dimensional order parameters, Bayesian characterizations, or sequential learning. This includes the works identified in those reviews, as well as closely related high-dimensional analyses of SGD in sequence single-index and single-layer attention models. Note that merely adding citations would not fully resolve the issue. Please compare the models, asymptotic regimes, learned objects, control parameters, and equilibrium-versus-dynamical notions of transition. The apparent distinctive contribution here is the posterior directly over attention patterns and the comparison of transition order for linear and softmax attention; this distinction should be established explicitly.
The paper is presently close to the decision boundary. Clear and convincing responses, especially concerning the mathematical status of the reduction, would materially strengthen its case. Conversely, if the central transition formulas rely on an unsupported low-dimensional restriction or numerical identity while being presented as rigorous first-principles results, this would weigh significantly against acceptance. The final recommendation will depend on the author response, subsequent reviewer discussion, and overall calibration.
7 comments
Analytical derivation of the prior term's pseudo-inverse Eq. (112)
We have since derived Eq. (112) in closed form and no coefficients are fitted anymore. The result is identical to the previous one, so all downstream results are unchanged. We will revise App. D and the corresponding maintext accordingly.
Derivation (sketch). With the embedding and the Kronecker factorization , (both already in App. D), an SVD gives with . Summing over collapses the -dimensional pseudo-inverse to with and . One-hot encoding implies that every row of sums to one, so the vector carrying on all positional and on all token coordinates satisfies for every : this is the sole degeneracy and the reason a pseudo-inverse is needed. Let be the common right inverse of all embeddings, for every , made unique by ; its positional block is and its token block has all entries equal to . Then , and the columns of lie in the range of , so and , where . This is exactly Eq. (112). The Kronecker structure is thus derived rather than assumed, and the three coefficients are , , by construction.
This is an exact identity at finite . The result depends on a single assumption on the data set: is its only degeneracy, i.e. . In the revision we will make this assumption explicit. It is necessary for the reduction, and rank counting shows it requires . We also prove a sufficient condition, which is that the rank is attained whenever every token pair occurs at every position pair; despite not being tight, this condition explains the underlying mechanism. Instead, the assumption is decidable exactly for any given training set: has integer entries, so is an exact integer computation, not a numerical estimate.
Static vs. dynamic description and filtered trajectories
We thank the AC for the opportunity to clarify this. The framework developed throughout is a Bayesian equilibrium theory, and the paper's claims should be read accordingly unless stated otherwise. For the revision, we will work through the manuscript to make sure this is unequivocal about this throughout. We will also add to the outlook the following sentence "It would be interesting to understand this phenomenon from a dynamical perspective, for example in an online setting, or to characterize the initialization-dependent behavior of different optimizers in this problem". We deliberately chose a Bayesian setting as phases, and thus phase transitions, are ordinarily defined at equilibrium.
A separate question is how the system approaches equilibrium as a function of time. Fig. 7 shows the loss changing rapidly at a given training step only when , with pronounced crossing-time variability near the transition (); an analogous figure for the order parameters and shows the same behavior. We will discuss both in the main text in the revision. Full details of this argument, including the discussion of Fig. 6/7 and the filtering criterion, are given in our response to Reviewer 2h5a (Q1.1–Q1.2). We also ran (S)GD experiments and found good agreement with the theory, comparable to Adam (see our response to Reviewer beA3, Q1).
[We note that this is distinct from a much more exotic phenomenon of "dynamical phase transitions", which is an unrelated and narrower, considerably less canonical phenomenon in physics.]
On why theory and gradient-based training agree at all: this follows from App. K, where the large- limit yields a zero-temperature limit and the posterior action becomes equivalent to gradient flow with weight decay objective. The caveat is the order of limits: gradient flow corresponds to , the equilibrium posterior to . These generically fail to commute when the action has more than one minimum: a local minimum traps gradient flow even as , whereas SGLD at will always eventually escape it and sample according to the stationary distribution. This is why we filter Adam trajectories to those reaching the global minimum: Fig. 2's contour panel shows the unfiltered Adam trajectories split into two groups, converging to the global vs. a local minimum (both captured by ), depending on initialization, in contrast the Bayesian posterior concentrates exponentially on the global one.
- Rating
- 5/6
- Confidence
- 3/5
- Quality
- 3/4
- Clarity
- 3/4
- Significance
- 3/4
- Originality
- 3/4
- Contribution type
- theory
- Ethical concerns
- NO or VERY MINOR ethics concerns only
Read review
Summary
This paper conducted a theoretical analysis of one-layer, single-head linear and softmax self-attention trained on a copy task. The method is calculating the Bayesian posterior with a given training set size. The conceptual finding is a phase transition from uniform attention to concentrated attention on the token being copied. The broader implication is intended for understanding and monitoring LLM training.
Strengths and weaknesses
Strength
- The writing of this paper is polished and mostly clear. The paper makes it relatively explicit which assumptions are required for which parts of the results to hold, which helps readers both understand the analysis and interpret the implications of the theory accurately.
- The reduction to two scalar order parameters due to symmetry makes the problem intuitive to understand despite the dense expressions from the analytical calculations. That is, the main mechanism is the competition between uniform attention prior and concentrated attention on the copied token, which is mediated by the sample size.
- Experiments with Adam match the Bayesian results surprisingly well, despite that the Bayesian results do not model the optimization trajectories.
Weakness
One of the primary empirical observations that serves as the motivation of this theoretical analysis is the "In-context Learning and Induction Heads" blog by Olsson et al. In their original observationin (Argument 1 in their blog), they found that "models with more than one layer have a sudden improvement in in-context learning." Could the authors explain why their one-layer, single-head model exhibits a phase transition, while the prior empirical work found phase transitions only in models with more than one layer? And what does this difference imply about to what extent can we use the mechanism derived in the idealized model to explain the phase transitions observed in practical settings?
Questions
It is kind of surprising that the results from the Bayesian analysis, which don't model the training dynamics aspect of the problem, match the training dynamics of Adam. Does SGD dynamics also match the results?
Could the authors clarify what they mean by the sentence at line 23 "if capabilities are acquired without prior signal, models may move between different risk classes abruptly without giving the opportunity to prepare appropriately."? It is unclear to me what we are preparing for, and thus I also didn't fully understand the implications on designing monitoring strategy mentioned at the end of the paper at line 280.
At line 33, the authors state that out of two tasks of the in-context regression and in-context bigram, the latter exhibits an abrupt evolution. But arguably, the former also exhibits abrupt evolutions (Chen et al., 2024; Zhang et al., 2025).
At line 146, is the notation supposed to be ?
Limitations
Could the authors discuss whether or how their results might change when using multi-head instead of single-head attention?
Final justification
Please see my Official Comment reply to the authors' rebuttal.
Formatting concerns
N/A
2 comments
Rebuttal
We thank the reviewer for their helpful review and for highlighting the intuition behind the two-order-parameter reduction and the accessibility of the resulting mechanistic picture. We address the raised points below.
(W1) Could the authors explain why their one-layer, single-head model exhibits a phase transition, while the prior empirical work found phase transitions only in models with more than one layer? And what does this difference imply about to what extent can we use the mechanism derived in the idealized model to explain the phase transitions observed in practical settings?
This is correct in the regard that a single attention layer cannot implement induction on its own as it requires composing a copy operation with a previous-token operation across two layers. So our single-layer model is not a candidate for exhibiting the composite ICL score Olsson et al. measure, and there is no tension with their finding regarding the necessity of more than one layer. Instead, we isolate the copy (shift-by-one) subcircuit that Olsson et al. themselves identify as the first layer of a two-layer induction head, which is thus learnable by a single-layer, single-head model.
We hypothesize that the first-order emergence of this subcircuit is one plausible mechanistic contributor to the abrupt ICL jumps observed in deeper models, but our single-subcircuit equilibrium analysis does not by itself establish this for the full multi-layer, next-token-prediction setting. In the rebuttal, we generated results for a two-layer model (building on App. J for two-layer theory) that is trained on sequences containing context-dependent bigrams. We observe the emergence of induction heads proper in this setting, in particular the copy attention pattern in the first layer; the order parameters capture the copy pattern albeit with differences in the last two positions due to the specific task structure including the trigger and follower token. We are, however, still investigating the phase transition behavior in this setting; a full characterization will be a subject of future work.
(Q1) It is kind of surprising that the results from the Bayesian analysis, which don't model the training dynamics aspect of the problem, match the training dynamics of Adam. Does SGD dynamics also match the results?
This is a good point and worth separating two things: SGLD's agreement is expected by construction, since its stationary distribution is the Bayesian posterior, whereas Adam and SGD converge to a single point estimate rather than sampling a distribution. Their match to theory follows from a separate argument we give in App. K, where we show that the large limit implies a zero-temperature limit, and the posterior action yields the same objective as gradient flow with weight decay. To answer the reviewer's question more fully, we repeated the experiments presented in the paper with (S)GD (in practice, since is small the whole dataset fits in a single batch). The results are very similar to those for Adam that we presented in the paper, and we will add them to an appendix in our manuscript. We can already share them via an anonymized link here if that would be useful to the reviewer.
(Q2) Could the authors clarify what they mean by the sentence at line 23? It is unclear to me what we are preparing for, and thus I also didn't fully understand the implications on designing monitoring strategy mentioned at the end of the paper at line 280.
We thank the reviewer for prompting us to sharpen this point. One of the main approaches to AI safety defines risk and sets policies to mitigate the risk based on the capabilities of the model [8]. Accordingly, the ability to predict the emergence of new capabilities is crucial to implementing such policies in the most effective way.
Our model studies a much simpler capability than those such policies typically target: the ability to copy the previous token. This subcircuit is nonetheless a component of induction heads, which have themselves been linked to capabilities such as chain-of-thought reasoning; if a capability relying on this mechanism emerges via a first-order transition, with no precursor in the training dynamics, the network could leave a given safety class without prior opportunity for detection. Within our mathematically precise and simple setting, we ask: when can we predict the emergence of a new capability in a model that is trained on datapoints from a model that was trained on datapoints? We find the answer is nuanced: the learning curves for both softmax attention and linear attention are non-smooth and have a sharp transition; that is, there exists such that for every the capability is not learned and for the capability is learned. Now, based on the classification of these points into first-order and second-order phase transitions, respectively, we deduce that the former is not predictable from the observables tracked in this framework, while the latter is predictable if we track the correct observables (which is the monitoring strategy referenced at line 280).
The unpredictability conclusion follows from general statistical physics/probability arguments: Denoting the limit of a large system by (in our context that would mean the scaling limit defined in Section 2 ) for the local minimum where the capability appears, is statistically unobservable outside of a vanishingly narrow window around . The probability mass of any competing minimum is exponentially suppressed by , scaling as where is the difference in the value of the action between the competing minimum. Consequently, strictly outside a window of away from the critical point , the posterior mass of this minimum is vanishingly small. From the perspective of local sampling or optimization within the dominant minimum, the competing state is therefore practically unobservable.
As this statement may appear overly strong, we note that:
- This result should be understood within the Bayesian context in which it is derived. Training in an online setting requires an out-of-equilibrium description and will be interesting and important future work.
- It is possible that capabilities of practical importance are composite, and built from microscopic capabilities that emerge abruptly, but give a collective build-up signal.
We will add these points and develop the discussion in the main text to make this point clear.
(Q3) At line 33, the authors state that out of two tasks of the in-context regression and in-context bigram, the latter exhibits an abrupt evolution. But arguably, the former also exhibits abrupt evolutions (Chen et al., 2024; Zhang et al., 2025).
We thank the reviewer for pointing out that the phrasing in l. 33 is misleading; we did not mean to imply that the former exhibits no abrupt evolution. We will correct the sentence in the revision and will cite Chen et al. (2024) and Zhang et al. (2025) alongside it as further examples of abrupt evolution in in-context regression:
Zhang et al. (2025) and Chen et al. (2024) investigate gradient flow in single layer attention layers trained on in-context regression. Both find a training dynamics that transitions rapidly as a function of training time from the initial, untrained, to the final state where the task has been learned. Chen et al. (2024) identified different temporal phases, while Zhang et al. (2025) analyzed the fixed-point structure, which depends on whether or not key and query are combined. From their analysis it is not straightforward to identify whether this is a phase transition in the physical sense, because they do not define an ensemble and also because the control parameter of the transition (e.g. number of training samples) is neither made explicit, nor is the dynamics studied as a function of such a control parameter.
(Q4) At line 146, is the notation supposed to be ?
Thank you for pointing this out. The notation is correct as written: is the network's output, appearing in the first term of the exponential, while is the conjugate variable introduced via the Fourier representation and integrated out. We will make sure this distinction is unambiguous in the revision.
(Limitations) Could the authors discuss whether or how their results might change when using multi-head instead of single-head attention?
Thanks to the reviewer's question, we extended the Bayesian posterior derivation to multi-head attention; the order-parameter reduction transfers as well, yielding two order parameters per head, using the same machinery as in the main text. This reveals a richer symmetry structure than in the single-head case: for linear attention the relevant branch reduces to an effective two-parameter structure, while for softmax attention the continuous symmetry over heads breaks down to a discrete permutation symmetry across the heads. In principle this allows for solutions in which different heads specialize into different states, i.e. some settling into copy attention while others remain uniform, rather than every head independently repeating the single-head transition. Characterizing which of these configurations dominate the posterior is the natural next step of this analysis, which we are actively pursuing and hope to discuss further with the reviewer. This indicates that the single-head setting studied in the paper is not a limiting special case but a foundation that extends naturally to the richer, more realistic multi-head regime, and we will comment on this extension in the revision.
We hope this resolves the reviewer's question and and are glad to elaborate on any of these points during the discussion period.
Final Justification
I thank the authors for a comprehensive rebuttal.
Q1, Q3, Q4 have been addressed properly.
W1 is a structural issue. Though this work doesn't directly explain the phenomenology in the wild, I find the authors' discussion helpful.
Q2: I still find the connection to AI safety to be too far of a leap from theory to practice. But the concrete notion of a monitoring strategy, i.e., the observables in the theory, is a new, helpful piece of clarifying information.
Limitation: the authors' comments on multi-head attention seem to contain promising new information, though a full treatment warrants a new work. Including the intuitions that the authors have should be useful for future researchers.
Overall, I don't have pressing concerns with this paper at this stage. The theory seems solid and the writing is polished. Some limitations stand, but the contributions are sufficient for acceptance. I thus update my rating from borderline accept to accept.
- Rating
- 5/6
- Confidence
- 4/5
- Quality
- 3/4
- Clarity
- 4/4
- Significance
- 3/4
- Originality
- 3/4
- Contribution type
- theory
- Ethical concerns
- NO or VERY MINOR ethics concerns only
Read review
Summary
The authors study the emergence of the copy head in a simplified setting amenable to a theoretical study. They consider a single head of attention with trainable key, query and value matrices, acting on binary sequences that are pre-processed by a linear embedding layer with the addition of positional encodings. This model is then trained on a copying task: we want the network to repeat one of the tokens. The authors provide an analytical characterization of the learning curves in the case of infinite embedding dimension and extreme overparametrization, while keeping the sequence length and the number of examples large much smaller. The learning is done by considering a Bayesian framework and selecting the maximum over the posterior. The authors use their tools to obtain that the copy head is learned through a second order phase transition for linear attention and a first order one in the case of softmax.
Strengths and weaknesses
This paper offers an interesting theoretical analysis of the emergence of structured attention heads. The topic and the results are particularly timely: several recent works have reported phase-transition-like phenomena in language models, and a principled mathematical account of such behavior is therefore very welcome. The paper is, for the most part, clear and precise, and the mathematical development is presented pedagogically enough to be accessible to a broad theoretical machine-learning audience. The theoretical predictions are further supported by numerical simulations on synthetic data.
My main concerns concern the generality of the theoretical setting and the treatment of the Bayesian parameters. First, the learning task is extremely simple: the desired operation is to copy the token at a fixed relative position. Although the output still depends on the token identity, the position to be attended to is independent of the sequence content. Consequently, the target attention pattern is a fixed shift operator, and the problem does not test genuinely content-dependent query–key matching or the interaction between multiple learned components of an attention layer. This makes the model tractable and useful as a minimal example, but it also limits how directly the conclusions can be transferred to more realistic in-context learning settings.
Second, while studying the Bayesian posterior is reasonable, the role of the noise parameter deserves more careful treatment. In the paper, this parameter controls the relative contribution of the likelihood and prior, and is also related to the temperature in the SGLD interpretation. It may therefore substantially affect posterior concentration, the transition point, and the presence or relevance of competing minima. I would encourage the authors to clarify which conclusions are robust across, and which depend on the strong-regularization regime used in the derivation. On this point, I would encourage the authors to specify the value of in the plots, to improve clarity.
Finally, the first-order transition in the softmax case could be analyzed in greater detail. The paper demonstrates such a transition in the studied regime, but it would strengthen the result to characterize more explicitly the parameter range in which two competing minima exist and the global minimum switches discontinuously. In particular, a phase diagram or asymptotic analysis showing the dependence of the transition point on the parameters of the problem would make the conclusion substantially more robust.
Questions
-
Could you comment on the rescaling done lines 108 and following, their role in the theoretical analysis. I think this is particularly relevant as it implies a rescaling of . On the same line, is the noise level in Table 1 before or after rescaling?
-
In the paper you correctly state that having a first order phase transition implies that the maximizer of the action switches from point X to Y as one external parameter is varied. I would say however that the most complete phenomenology of a first order transition has the following phases: at first only X is a maximizer, then a second (local) maximizer Y appears, then Y becomes the local maximizer, finally X is not a local maximum anymore. It could be interesting to see if all of these moments are present in your model, and if they have some implications for the learning.
-
Would it be possible to isolate what part of the softmax activation induces the first order phase transition? Does it depend on the internal temperature of the softmax?
-
What happens if you lower , the temperature in the posterior?
-
Reading through the derivation, is seems really that P and L need to be much smaller than the embedding dimension. Is this a hard limitation? If so I would consider being more explicit about it in the main text. For the moment there is a mention of the order of the limits in line 112, but I would make it more clear that the limits not commuting it's not a technicality.
-
Would you comment on the difference of the theoretical approach to attention of this paper with [1,2]?
[1] "Bayes optimal learning of attention-indexed models", Fabrizio Boncoraglio, Emanuele Troiani, Vittorio Erba, Lenka Zdeborová, NeurIPS 2025 [2] "Single-Head Attention in High Dimensions: A Theory of Generalization, Weights Spectra, and Scaling Laws" Fabrizio Boncoraglio, Vittorio Erba, Emanuele Troiani, Yizhou Xu, Florent Krzakala, Lenka Zdeborová, ICML 2026
Limitations
Yes
Final justification
The authors gave a very detailed response and addressed my concerns, hence I increased my confidence.
Formatting concerns
No
2 comments
Rebuttal
We thank the reviewer for the positive and thoughtful assessment, for finding the topic timely and the theoretical account principled, and for noting that the paper is clear, pedagogically accessible, and well supported by numerical simulations.
(W1) Generality of the theoretical setting.
We deliberately presented a clean setup that allows us to study the emergence of copy heads, which are important components required for the full induction head mechanism. Importantly, we are able to demonstrate that this is a true phase transition in the statistical physics sense and determine its type from our analysis while pinpointing significant differences between linear attention and softmax attention. In this context, even the predictability and nature of emergent capabilities remain the subject of debate in the community (see Refs. 4-7). While we work in a simplified setting, our work can be seen as a constructive "existence proof" of real phase transitions in attention and capability acquisition.
We will also show in a new appendix how to extend the theory to learning from temporally correlated sequences drawn from a Markov system (with a fixed transition matrix), where the transition matrix appears in the effective action. This demonstrates our approach is not confined to the copy task, and provides a template for future studies of more realistic, temporally structured tasks.
(W2+Q1+Q4) The role of the noise parameter.
We agree that the noise parameter is important, and we will report its value in all figures in the revision; the value we used throughout is . The previously shown in the table is before scaling down by , but after scaling up by ; we update the table to show directly and note explicitly this is the value post-scaling. We also note a typo in the manuscript: the quantity is (instead of the typo ); in numbers, we have in our experiments.
We will also improve the discussion around to explain its double role: (1) First, it scales the likelihood term and thus controls the balance between the likelihood and the prior term, playing a counterweight to . This can be seen in Eqs. (17) and (21), where the phase transition is indeed effectively controlled by .
(2) Second, a sufficiently large is important for the equivalent kernel approximation we employ in the theory. A sufficiently large allows one to perform the data average on the action instead of the log partition function; the latter can be performed by help of replica methods or free probability theory [Zavatone Veth et al. 2025]. These two roles are not codependent; keeping the ratio fixed and scaling up ensures the balance between the likelihood and prior term stays the same, but improves the accuracy of the EK approximation. In the revision we will flesh out the latter point when discussing the scaling of our model.
Taken together, these two points imply that the existence of the transition is indeed robust, as we may increase such that the EK approximation holds, which will only delay the point of the transition to a larger value, but will not abolish it altogether.
Conversely, decreasing the ridge at fixed pushes the system towards a regime where the EK approximation no longer holds; this is different from the scaling we take in the paper. we performed new experiments to probe this regime. Using the same parameters as in the manuscript, for each value of we swept ; we found good agreement up to , with showing significant deviations from the theory. We will include those figures in the revision. If the reviewer is interested, we can already share them via an anonymous link.
(W3+Q2) Detailed analysis of the first-order transition
We thank the reviewer for this suggestion. We generated new figures with a more complete characterization of the phase diagram shown in Fig 4 (middle and right) for the case of the softmax attention, annotated with a dashed line beyond which the second minimum of the action Eq. (20) arises, and a dotted line beyond which the first minimum ceases to exist (the spinodals); the transition point discussed in the main text marks the third moment in this sequence, where Y becomes the global maximizer. We show the phase diagram as functions of the control parameter as well as and . We will update Fig. 4 in the revision.
We also obtained analytical estimates for their scaling from the action in Eq. (20) and found the second minimum is created at and the first minimum is annihilated at . We added a derivation of these estimates to a new appendix.
Of course, there is also a dependence on the other parameters, such as the prior variances , and , as shown explicitly by the closed form of Eq. (20).
(Q3) Would it be possible to isolate what part of the softmax activation induces the first order phase transition? Does it depend on the internal temperature of the softmax?
We thank the reviewer for the suggestion. We repeated the same calculation as in App. G, for softmax with inverse temperature parameter , and found the l.h.s. in Eq. (260) receives a factor of , which reduces the prior term in the action by a factor of and leaves the likelihood term unchanged, such that the action in Eq.(20) now reads
This result can be seen intuitively: scaling up the inverse temperature is like scaling up the logits in the prior, which is exactly what does. The resulting sample complexity is therefore . As changing is equivalent to changing , the full phase transition picture carries over.
This leaves the more general question of what part of the softmax activation induces the first-order phase transition open to future research. From a symmetry perspective, the softmax activation is neither odd nor even, and it thus breaks the symmetry that protected the second-order phase transition in the linear case.
(Q5) Scaling of w.r.t.
Indeed, we make this assumption and will add "throughout we assume " to the scaling paragraph for transparency.
This assumption is mostly used in Appendix B to make the prior rigid in directions that are irrelevant to the task, thereby mitigating some of the technical challenge; the framework itself does not require it. Specifically, without it (see Eq.80) could concentrate on a value different than . Similarly, the prior for would take a more complicated form (see Eq.86), interpolating between Gaussian local concentration of the entries and exponential tails of the singular values when they are large. Pushing further into this regime, fluctuations in become significant, which, in principle, could also be taken into account based on the frameworks of [30, 31], though closed-form expressions are unlikely to remain tractable at that point.
Regarding line 112: we agree the non-commutativity of the limits is a substantive feature, not a technicality. The two orders correspond to physically distinct procedures (gradient flow vs. equilibrium posterior, see also our response to Reviewer 2h5a Q1.1), and can yield different results whenever the action has multiple minima. We will revise line 112 to state this explicitly rather than noting it in passing.
(Q6) Would you comment on the difference of the theoretical approach to attention of this paper with [1,2]?
[1] characterizes Bayes-optimal learning in attention-indexed models, while [2] analyzes ERM generalization, recovery thresholds, and the spectral structure of the learned weights. The main difference lies in the object computed: we derive an effective posterior directly over the attention pattern, rather than characterizing weight-space learning through overlaps, prediction errors, or spectral observables. Our result therefore gives the probability assigned to competing attention patterns, not the performance or weight statistics of an estimator. We refer the reviewer to our response to reviewer giTG for the fuller comparison across additional related works, including [1] and [2]. We will update the related-work section in the revision accordingly.
We thank the reviewer again for their detailed and constructive feedback, which has helped us substantially strengthen the paper's clarity and scope.
I thank the authors for their detailed response. I will increase the confidence of my already positive rating.
- Rating
- 4/6
- Confidence
- 3/5
- Quality
- 3/4
- Clarity
- 3/4
- Significance
- 3/4
- Originality
- 2/4
- Contribution type
- theory
- Ethical concerns
- NO or VERY MINOR ethics concerns only
Read review
Summary
The paper develops a Bayesian theory for the emergence of a copy pattern in a simplified single-layer attention model trained on a synthetic copy task. By marginalizing over the weights, the authors derive an effective posterior over attention patterns and reduce it to two interpretable order parameters: uniform pooling and shift-by-one copying. The main result is a qualitative difference between linear and softmax attention. Linear attention first develops a uniform-pooling mode and then moves toward the copy pattern through a crossover, whereas softmax attention exhibits a discontinuous jump to the copy solution. The theoretical predictions are compared with Adam and SGLD experiments on the same controlled task, with good empirical agreement.
Strengths and weaknesses
Strengths
The paper is clearly written and technically interesting. The effective posterior over attention patterns is an appealing way to connect Bayesian feature learning with mechanistic descriptions of attention. The comparison between linear and softmax attention is also quite nice: the theory gives a simple explanation for why softmax attention can lead to an abrupt transition while linear attention shows a more gradual evolution. The numerical experiments are clean and support the theoretical picture in the studied regime.
Weaknesses
My main concern is the positioning of the contribution. The related work does not sufficiently clarify how this paper differs from recent solvable or statistical-mechanics analyses of attention models. For instance, I would expect a clearer comparison with works such as Cui et al., “A phase transition between positional and semantic learning in a solvable model of dot-product attention”; Troiani et al., “Fundamental limits of learning in sequence multi-index models and deep attention networks”; Boncoraglio et al., “Bayes optimal learning of attention-indexed models”; Boncoraglio et al., “Single-Head Attention in High Dimensions: A Theory of Generalization, Weights Spectra, and Scaling Laws”; and Marion et al., “Attention layers provably solve single-location regression”. These works also study simplified but tractable attention models, often with high-dimensional asymptotics, Bayes-optimal predictions, AMP/state-evolution methods, sharp threshold phenomena, spectral properties of learned weights, or provable token-localization mechanisms. In this context, it is hard to evaluate from the current presentation what is genuinely new at the methodological level. My understanding is that the main novelty is not simply the existence of a tractable Bayesian attention model with thresholds, but rather the derivation of an effective posterior directly over attention patterns and the classification of the transition order for linear versus softmax attention. This distinction should be stated more explicitly.
My second concern is the status of the two-order-parameter reduction. The reduction to uniform pooling and shift-by-one copying is natural for this task and is supported by the experiments, but the student attention matrix is not constrained to live in this two-dimensional subspace. The paper first introduces this reduction as a representation-theory-inspired ansatz, but later describes the two-dimensional posterior as obtained without information loss. This seems too strong as currently written. Appendix M gives useful numerical evidence, but it also shows that SGLD can explore directions outside the proposed subspace near the crossover region. I would like the authors to clarify whether the reduction is exact in the asymptotic limit, or whether it should be understood as an effective ansatz validated numerically in the studied regime.
Questions
- Could the authors better position the contribution relative to recent solvable Bayesian/statistical-mechanics models of attention, in particular those involving AMP/state evolution, Bayes-optimal thresholds, or high-dimensional attention models?
- Is the two-dimensional reduction to the uniform and copy modes an exact consequence of the symmetries in the relevant asymptotic limit, or an effective low-dimensional description? Relatedly, how should one interpret the out-of-subspace components observed for SGLD in Appendix M?
- Which aspects of the softmax first-order transition are expected to be robust beyond the current controlled setup?
My score could increase if the authors clarify the relation to the above-mentioned recent works and make the status of the two-order-parameter reduction more precise.
Limitations
The authors discuss the controlled nature of the setting, but I think the limitations could be made more explicit. In particular, the paper should more clearly state the status of the two-order-parameter reduction and whether it is exact or an effective approximation supported by numerics. It would also be useful to clarify how much of the predicted softmax transition is expected to survive beyond the specific synthetic copy task and the simplified single-layer setting considered here.
Final justification
After reading the rebuttal and the discussions, I am increasing my score from 3 to 4. The authors provided a detailed and convincing response to my main concerns, and the additional clarifications substantially improved my understanding of the contribution and of the assumptions behind the analysis. Given these explanations and the planned revisions, I now consider the paper borderline acceptable.
Formatting concerns
No major formatting concerns.
3 comments
Rebuttal
We thank the reviewer for their useful feedback and are glad they found the attention-pattern-centric Bayesian perspective appealing.
(W1 + Q1) Positioning of the contribution.
We thank the reviewer for the question on the relation to previous work and agree they help contextualize the contribution of the paper better. The reviewer's own reading is correct: our contribution is not the existence of a tractable Bayesian attention model with thresholds per se, but (i) an effective posterior derived directly over the attention pattern itself, instead of the weights, overlaps or a scalar risk/loss, and (ii) an explicit classification of transition order (second-order for linear attention, first-order for softmax).
The cited papers make important complementary contributions to the theory of attention. Cui et al. sharply characterize empirical-risk minima and identify a sample-complexity-driven transition between positional and semantic mechanisms. Troiani et al. formulate deep attention networks as sequence multi-index models and characterize Bayes-optimal and algorithmic learning thresholds, including the sequential recovery of different layers. The two works by Boncoraglio et al. extend this program to extensive-width attention matrices: one characterizes Bayes-optimal learning in attention-indexed models, while the other analyzes ERM generalization, recovery thresholds, and the spectral structure of the learned weights. Marion et al. introduce single-location regression and prove that a nonlinear attention predictor is asymptotically Bayes-optimal and learnable by projected gradient descent on the population risk.
On a technical level, these works use different methods, with distinct strengths and limitations compared to ours. Some of these results are obtained for different, and sometimes restricted, attention parameterizations. Cui et al., Troiani et al. and both Boncoraglio et al. impose and use no value or output weights. Marion et al. learn separate rank-one key and value directions, but use a fixed query and scalar readout rather than learning a full self-attention map. Our model does not impose , the query-key matrices are unconstrained, and the value/output transformation is learned. However, our work utilizes the EK approximation, which requires a large ridge, and our embedding layer is only lazily learned.
Another technical distinction concerns context length. With the exception of Marion et al., these high-dimensional results keep context length fixed or bounded, and evaluating their predictions becomes more computationally demanding as context length grows. In our theory, the final action is one-dimensional for softmax and two-dimensional for linear attention, with entering only as explicit scalar parameters. Similarly, Marion et al. obtain a scalar dependence on context length, but characterize the population-risk landscape and its optimization dynamics rather than a Bayesian posterior conditioned on a training dataset.
For completeness, we will also discuss two recent dynamical analyses. Arnaboldi et al. characterize online SGD dynamics for a sequence single-index model, complementing our equilibrium posterior perspective with a trajectory-based one. Sagitova et al. analyze the specialization of attention heads in a multi-head attention model, a setting related to our own multi-head extension (see our response to Reviewer VUAH).
We will discuss all of these in our Related Work section in the revision.
(W2+Q2) Status of the two-order-parameter reduction.
We thank the reviewer for raising this point. The phrasing as it appears in the manuscript is indeed regrettable. We agree that the sentence Together, Eqs. (15) and (12) reduce the high-dimensional inference problem to a two-dimensional posterior without information loss. (Sec. 3.3 after Eq. 15) is not supported in the manuscript; we will replace it by Together, Eqs. (15) and (12) reduce the inference problem to a closed-form two-dimensional posterior that is asymptotically exact assuming the ansatz in Eq.(11).
Addressing the question itself has multiple aspects:
First, the symmetries we exploit are only exact symmetries in the asymptotic EK limit together at a fixed . This implies that any experiment with a finite dataset will show components of the attention pattern that do not strictly respect the symmetry.
Second, in the asymptotic limit, where the symmetries of the prior on G are obeyed exactly, the question remains whether the action (our Eq. (10)) is minimized by an attention matrix which lives within our two-dimensional space. In this respect, we view the ansatz as an effective theory and an approximation. Identifying these two parameters is a substantial science-of-deep-learning contribution of our work, which we support experimentally (as in Fig.5). To be clear, it is not a result of the theory and is not derived within the theory in the current manuscript.
Nevertheless, we can argue for the asymptotic exactness of this ansatz under two limiting assumptions: (1) The attention pattern is sample-independent, . (2) No spontaneous symmetry breaking (SSB) in the out-of-space directions. Under Assumption 1, the prior is given in Eq.(112), which has enhanced compared to without this assumption. This symmetry is in turn broken by the likelihood/data term down to such that transforms as and the symmetry group is , i.e. the stabilizer . This group has two copies of the trivial irreducible representation spanning two-dimensional space , with the all-ones matrix, as in the manuscript. Under Assumption 2 and the results of the paper, the Bayesian posterior concentrates on this two-dimensional space, completing the argument. We have added an appendix with a detailed derivation under these assumptions, and we would be happy to share more details if the reviewer is interested. Additionally, we note that we believe it might be possible to derive Assumption 2 from Assumption 1.
We also agree this should be addressed explicitly as a limitation. Concretely, We will revise the opening of the Limitations paragraph to: To reduce the posterior to a low-dimensional order parameter space, we make several assumptions: First, the projection onto the two-dimensional subspace is an ansatz we support experimentally (see App. M) and do not prove. Second, while our Bayesian...
Regarding the question of out-of-subspace components observed for SGLD in the crossover region, this is an expected behavior: as the pooling minimum destabilizes and the copy minimum emerges, the posterior broadens and fluctuations grow; these fluctuations that exist near the phase transition populate directions off the subspace. This is an effect SGLD samples directly but Adam's point estimate does not see.
(Q3) Which aspects of the softmax first-order transition are expected to be robust beyond the current controlled setup?
We have tested several concrete directions suggested by other reviewers, e.g. changing the softmax temperature and probing where the EK approximation breaks by reducing . We found that changing the softmax inverse temperature plays the same role as changing the prior variance , and that can be reduced by x$30$ to (from used in the paper) while maintaining good agreement with our theory (but reducing it to showed significant deviations). These are, of course, only a fraction of the possible extensions we list in our outlook.
To the broader point: even the existence of emergent capabilities has been the subject of much debate in the community (see refs. 4-7); while we work in a simplified setting, our work can be seen as a constructive "existence proof" of real phase transitions in capability acquisition.
We hope these clarifications resolve the two concerns the reviewer identified and are happy to discuss further during the discussion period.
Dear Reviewer giTG,
As the discussion period draws to a close, we wanted to briefly follow up on our rebuttal. You noted that your score could increase if we clarified the paper’s positioning and the status of the two-order-parameter reduction; we addressed both points in detail and outlined the corresponding revisions.
We would appreciate hearing whether these clarifications resolve your main concerns and would be grateful if you would reconsider your score accordingly. We are also happy to discuss any remaining questions.
Thank you for the detailed response. I found the clarifications on both the positioning and the two-order parameters reduction very convincing, and my main concerns have been addressed. I will update my score accordingly.
- Rating
- 4/6
- Confidence
- 3/5
- Quality
- 3/4
- Clarity
- 3/4
- Significance
- 2/4
- Originality
- 3/4
- Contribution type
- theory
- Ethical concerns
- NO or VERY MINOR ethics concerns only
Read review
Summary
This work presents a novel bayessian approach to explain phase changes, and induction heads appearances, during attention based model’s training. Their framework is studied over models with 1 attention head per layer. Authors compared their method between linear attention and quadratic attention in order to highlight fundamental differences in their phase changing signature during training.
An empirical analysis was done which complements theoretical predictions with real training trajectories.
Strengths and weaknesses
Weaknesses
-This analysis was done for one attention head layers, which is unrealistic compared to real world models. They considered a one-hot kind of inputs which simplify the potential situations were this analysis holds. -Theoretical models for one layer attention models have been introduced in the past and these were not even referenced https://transformer-circuits.pub/2021/framework/index.html -The introduction promised an understanding of induction heads but all work was made over one head attention and one layer
Strenghts
-Notation is complete and easy to understand. The paper is really well written and easy to follow -Experiments show clear differences between the first order phase change on standard attention against a second order phase change in linear attention. I believe these are interesting results to further understand why some capabilities appear in one model and not in the other -I believe it is a promising path to analyse feature learning and phase transitions from a bayesian perspective
Minor comments
-I did not have time to check every result and formula, I hope these are okay. -Line 292: typo “are are accurate…”
Questions
How would you incorporate more complex tasks in your analysis? What are the main implications on model designs? Would you consider this analysis for hybrid models (attention + SSM)?
Limitations
Authors partially discussed limitations of this analysis. They did not mentioned anything regarding the kind of inputs or tasks where this approach applies. Authors could explain real scenarios where their actual analysis applies
Final justification
Considered as a theoretical contribution this work has a solid foundation and novel techniques applied to understanding copy head emergence. However, I still consider this kind of circuits too simple to consider this work a major contribution. Authors convinced me that more general contribution can be made in the future and therefore, this foundational work is justified as a borderline acceptance submission.
Formatting concerns
none
2 comments
Rebuttal
We thank the reviewer for their time and feedback. We are glad the reviewer found the notation clear and the paper easy to follow, and we appreciate the recognition of the empirical-theoretical agreement and the promise of the Bayesian perspective for studying feature learning and phase transitions.
Contribution Type: General
We would like to note that the contribution type was marked as "General," whereas our submission is a Theory paper: our central contribution is a Bayesian derivation of the phase transition governing copy subcircuit emergence, including an expression for the phase boundary and an analysis that the transition order (first- vs. second-order) differs qualitatively between softmax and linear attention. The empirical results validate these theoretical predictions rather than constituting an independent empirical contribution. We would appreciate it if the reviewer would reconsider the contribution type in light of this.
(W1) This analysis was done for one attention head layers, which is unrealistic compared to real world models. They considered a one-hot kind of inputs which simplify the potential situations were this analysis holds.
The single-head, single-layer setting is a deliberate simplification to isolate the copy subcircuit in closed form, consistent with common practice in the theoretical literature on transformers, several examples of which we cite in Related Work. In response to a related question from reviewer beA3, we also extended our derivation to multi-head attention: the order-parameter reduction transfers directly, and reveals a richer symmetry structure, indicating that the single-head setting is not a limiting special case but a foundation that extends naturally to the multi-head regime. Regarding the one-hot inputs, to the best of our knowledge this is always the case, even in production LLMs; we stress that while the raw tokens are one-hot, they are embedded into the -dimensional model space via before entering the attention mechanism, so the resulting token representations are not maximally simplified as the one-hot description alone might suggest.
(W2) Theoretical models for one layer attention models have been introduced in the past and these were not even referenced https://transformer-circuits.pub/2021/framework/index.html
We would like to note that we do already cite Olsson et al. (2022), "In-context Learning and Induction Heads," which is closely related and central to how we motivate our study, but agree that Elhage et al. (2021), "A Mathematical Framework for Transformer Circuits," is also directly relevant and we will add it in the revision. We note that our contribution differs in kind: Elhage et al. take a mechanistic-interpretability approach, reverse-engineering trained models to identify the QK/OV circuit decomposition and induction heads as compositions of two attention heads; our contribution is complementary and different in kind, we give a Bayesian theory that predicts when and how a single QK circuit concentrates onto the copy solution such compositional mechanisms rely on, as a function of data amount.
(W3) The introduction promised an understanding of induction heads but all work was made over one head attention and one layer
We would like to clarify the scope stated in the paper: the abstract and introduction motivate our study through induction heads, but explicitly scope the technical contribution to the copy subcircuit that constitutes their first layer. The single-head, single-layer analysis is therefore consistent with the stated scope. We agree that showing our theory extends to induction heads more directly strengthens the manuscript, and we generated new results toward this: we consider a task in which bigrams are embedded into the training sequence, composed of a fixed trigger token followed by a context-dependent follower token, so that predicting the follower requires genuine in-context use. We observe the emergence of induction heads proper in this setting, in particular of the copy attention pattern in the first layer; the order parameters capture the copy pattern albeit with differences in the last two positions due to the specific task structure including the trigger and follower token. We are, however, still investigating the phase transition behavior in this setting; a full characterization will be a subject of future work.
Typo in l. 292
We thank the reviewer for catching this and will fix the typo in the revision.
(Q1) How would you incorporate more complex tasks in your analysis?
The Bayesian framework is not tied to the copy task specifically: the copy task enters only through the data term (likelihood) of the effective action, while the NNGP prior over the attention logits and the approach of reducing the posterior to an order-parameter description are task-independent. The copy task was chosen deliberately because its permutation symmetry yields exactly two irreps, giving a low-dimensional, analytically tractable order-parameter space.
We are currently working on an extension to more complex tasks, applying the presented formalism to sequences generated from Markov processes that contain temporal correlations between tokens and to data from the random hierarchy model [Cagnetta et al. 2023]. In the revision we will present in an appendix the derivation of the effective EK action
for the Markov case, which exposes how the Markov transition matrix drive learning of temporal structures.
However, richer tasks will generally introduce additional order parameters (beyond the two irreps arising from the copy task's permutation symmetry), and we expect analytical tractability to become substantially more expensive as task complexity grows.
(Q2) What are the main implications on model designs?
As discussed in Sec. 5, the transition order determines whether capability emergence can be anticipated in advance: first-order transitions (softmax attention) give no precursor signal, while second-order transitions (linear attention) are preceded by diverging fluctuations that allow tracking before the capability is fully expressed. This has direct implications for the design of monitoring strategies for emergent capabilities.
(Q3) Would you consider this analysis for hybrid models (attention + SSM)?
The Bayesian formalism presented here in principle can be extended to hybrid models consisting of SSM with attention. An essential part of SSMs are recurrent linear networks, for which recently a Bayesian feature learning theory has become available [Bauer et al. 2026 ICML; Clark et al. 2026 arXiv]. Combining such feature learning theory with the theory of learning attention patterns from our work is a highly promising future direction, which is, however, outside the scope of the current manuscript.
(Limitations): Authors partially discussed limitations of this analysis. They did not mention anything regarding the kind of inputs or tasks where this approach applies. Authors could explain real scenarios where their actual analysis applies
We would like to point to where this is addressed in the manuscript, as we believe it may have been missed: we state that we focus on the single-head, single-layer setting and the supervised copy task specifically to isolate the copy subcircuit, which is our main object of study (with the multi-layer generalization outlined in App. J). We also explicitly flag extending from i.i.d. uniform to structured or natural-language-inspired token distributions as an open direction, with initial results on Markov sequences (see above), precisely to address the input-distribution point the reviewer raises. We would welcome a pointer to the specific scenario or input class the reviewer feels is missing, so that we can address it concretely.
We hope these clarifications and the additional results address the reviewer's concerns, and we would be happy to discuss further during the discussion period.
I appreciate your answers and clarifications to my concerns. I also apologize for miss classifying your work and, therefore, over demanding aplications of your methods. I understand now you achieved your main goal which was to isolate copy subcircuits. Moreover, you extended some results to the multi-head setting which I value as well.
Even that most concerns from the rest of the reviewers were also clarified, I still find consider the scope of this work a little bit narrow since copy circuits emergence do not explain induction heads. Therefore, I will upgrade my rating from 3 to 4 given that new promised results (and appendix extension) will be included in the final manuscript.
- Rating
- 5/6
- Confidence
- 3/5
- Quality
- 3/4
- Clarity
- 3/4
- Significance
- 3/4
- Originality
- 3/4
- Contribution type
- theory
- Ethical concerns
- NO or VERY MINOR ethics concerns only
Read review
Summary
This work concerns the emergence of the copy circuit in a single layer single head attention model when trained supervised on the shift by one task. The authors theoretically describe two different strategies for solving this task: Uniform pooling (suboptimal) and the copy circuit (optimal). They execute a Bayesian equilibrium analysis where they marginizalize out the attention scores while treating all other weights as Gaussian random variables. This allows them to describe the posterior over the attention scores in the space of two order parameters, which correspond to the two solutions and can be interpreted as an effective loss landscape. With this, they show that the emergence of the circuit is a first-order transition in the number of seen samples for softmax attention, whereas it is a slow crossover for linear attention.
Strengths and weaknesses
Strengths
- S1: The paper is well-written and contextualized, and carefully states its contributions.
- S2: The Bayesian equilibrium analysis marginalizing out the attention score is novel to the best of my knowledge. While there have been alternative gradient flow analysis of similar phenomena in attention before (as mentioned by the authors) it is interesting and theoretically valuable to see what this statistical mechanics approach can achieve. It might inspire follow up work that uses this approach.
- S3: This work gives a first-principle account of two types of emergences of the same mechanism under different architectures. It is interesting to observe that this abruptness can be a function of subtleties of the architecture, and not necessarily the data.
Weaknesses
- W1: The abrupt emergence of specific circuits in attention has been widely analyzed in the literature so far, therefore a contribution in the phenomenology of the copy circuit is rather incremental.
- W2: The authors show that the theory matches the empirics quantitatively. However, they do not show which of their assumptions are necessary, i.e. under which changed conditions the behavior would differ from their analysis. Are the results robust to the choice of initialization, embedding dimension, learning rate or is it an artifact of this setup?
- W3: As usual, the large limits that allow for the Gaussian Process analysis correspond to a very artificial setting, but I do not weigh this strongly.
Questions
Q1: The static analysis and the dynamically observed phenomena are slightly conflated in my opinion. When the emergence of the copy circuit was discrete (e.g. softmax, P=800), would the dynamics of GD/Adam exhibit the same first transition in terms of training steps as the loss over the P axis? For the runs that you excluded that did not end up in the global optimum, what did their dynamics look like?
Q2.1: See W2 - it would be interesting to slightly expand your numerical experiments so that the reader has a better understanding of where the assumptions break down in comparison to more realistic cases, where this discrete behavior was observed in practice. E.g.:
- How valid is your prediction of the phase transition empirically, when you change to the next token prediction instead of supervised learning?
- Could you expand on why the simplification from is valid? What result do you get empirically if you change this parameterization?
Limitations
yes - although I think the caveats of the static analysis could be highlighted a bit more explicitly.
Formatting concerns
none
2 comments
Rebuttal
We thank the reviewer for the thoughtful comments, and for recognizing the novelty in our Bayesian approach that characterizes the attention pattern.
(W1) Novelty of phase transition characterization
We thank the reviewer for the opportunity to clarify this point. "Abrupt emergence" is a well-documented phenomenon and was an important motivation for our work, but both its predictability and its underlying nature remain debated in the community (see Refs. 4–7). The conceptual advance we present here is to establish that the abrupt emergence of the copy subcircuit is a true phase transition in the statistical physics sense and to provide a full characterization of it. Additionally, holding the task and architecture fixed while varying only the attention nonlinearity, we find a second-order transition for linear attention and a first-order transition for softmax attention. This classification directly determines whether emergence can be predicted from observables under the precursor Bayesian states.
(W2+Q2.0) Which assumptions are necessary? Are the results robust?
We emphasize that our theory describes the Bayesian posterior, which is naturally insensitive to choices of learning rate and initialization (see Q1 for additional discussion). Specifically, the presented theory describes the result of training in the long-time limit. The initial condition in such a description is therefore forgotten and the good agreement between empirical results and theory thus demonstrates that the results hold independent of the initialization. Along the same lines, the learning rate can be changed such that the final distribution of the weights is maintained. This can be appreciated from Eq. (338), which shows that the introduction of a time scale requires a joint change of the temperature by to maintain the same stationary distribution. This is true as long as the ODE/SDE limit holds (sufficiently small learning rate), or alternatively, if the Robbins-Monro conditions hold.
The situation is quite different for the model dimension . We assume , an assumption we mostly use in Appendix B to make the prior rigid in directions that are irrelevant to the task, thereby mitigating some of the technical challenge; the framework itself does not require it. Specifically, without it (see Eq. (80)) could concentrate on a value different than . Similarly, the prior for would take a more complicated form (see Eq. (86), interpolating between Gaussian local concentration of the entries and exponential tails of the singular values when they are large. Pushing further into this regime, fluctuations in become significant, which could also be taken into account based on the framework of Refs. [30, 31]; investigating the interplay of such feature learning with the emergence of copy patterns is an interesting future direction.
To test this, we performed a new experiment: using linear attention and scanning the same range of but reducing by a factor of , we found similar agreement with the theory. We will add these figures to an appendix, and we are happy to share them anonymously.
Another limit we take in this work is the EK limit, which requires large , which reviewer fbCx asked about; we performed new experiments and detail the results in the response to fbCx.
(Q1.1) Static Analysis and Dynamic Phenomena
We would like to unpack this issue. Phases, and thus phase transitions, are canonically defined at equilibrium, which corresponds to the long training time limit of SGLD. A phase transition happens as a function of a control parameter: Changing this parameter (here, e.g., ) the equilibrium distribution is then qualitatively different for and for . This is the behavior we analyze here.
A separate question is how the system approaches its equilibrium state as a function of time. This question can be answered within non-equilibrium statistical physics (e.g., Hohenberg & Halperin 1977). Initializing a system in a configuration where the order parameter is zero (e.g., randomly initialized weights), but setting the control parameter , so that in the long-time limit the order parameter will be non-zero, one observes a dynamical evolution of the system as it approaches its equilibrium. Correspondingly, the order parameter evolves as a function of time until it settles into its final, equilibrium value.
This is precisely the case here. Fig. 7 in the appendix shows that the loss indeed changes rapidly at a certain time step in the training dynamics, but only in cases where is above the transition. This is particularly pronounced close to the phase transition, at where large variability in the crossing time between trajectories is visible, as generally expected in first-order phase transitions.
We generated a parallel figure that shows the order parameters and as a function of training steps (time), and they also show the rapid evolution and variability at the corresponding time point. In the revision, we will comment on these figures in the main text and clearly discuss the distinction between the equilibrium and the time dynamics.
Regarding the more general question: "why would we see a match at all?" the agreement follows from App. K, where we show that the large limit implies a zero-temperature limit, and the posterior action yields the same objective as gradient flow with weight decay. The important caveat is the order of limits. Gradient flow corresponds to whereas the zero-temperature equilibrium posterior corresponds to and these limits need not commute in general. This is important in the case of more than one minima. Gradient flow will converge to the same set of minima dictated by the action, but the distribution of minima it converges to depends on initial conditions. This is precisely why we expect Adam/GD to match our theory only after filtering: they get stuck in local minima that the Bayesian posterior accounts for, but assigns vanishing probability to.
(Q1.2) For the runs that you excluded that did not end up in the global optimum, what did their dynamics look like?
Fig. 6 in the appendix shows the dynamics of the loss for cases where it reached the global optimum and for those where the global optimum was not reached. As noted above, the order-parameter trajectories (all 10 seeds) show the same pattern. Additionally, we would like to draw the reviewers' attention to Fig.2 contour panel, where the white trajectories show the real trajectories taken by Adam, when projected to the action's two-dimensional space. The trajectories are essentially split into two groups: those that reach the global minimum, and those that reach the other local minimum (which is also described by ). Naturally, the Adam trajectories depend on the random initialization and may land in either minima, but the true Bayesian posterior concentrates exponentially on the global one; that is why we only expect Adam to match our theory after filtering.
(Q2.1) How valid is your prediction of the phase transition empirically, when you change to the next token prediction instead of supervised learning?
We interpret this as asking whether the framework extends to next-token prediction for tasks beyond exact copying. It does: in a new appendix we extend the analysis to next-token prediction on Markov sequences with a fixed transition matrix, and derive the resulting action, which shows the system learning the transition matrix directly. We note that the literal copy task is a degenerate case under next-token prediction as it requires the next token to equal the previous one, forcing strictly alternating sequences, which is why we treat the more general Markov setting as the natural extension. This example demonstrates that our approach is not confined to the copy task, and provides a template for extending the analysis to other structured next-token prediction settings in future work.
(Q2.2) Fused () and unfused attention weights
We note that the simplification , is only valid for inner attention dimension much larger than model dimension . We derive a more general result using large deviation theory in Appendix I. The more careful analysis in Eq. (323) shows that the prior due to can be decomposed into a regularization by the Frobenius norm at small singular values and a regularization by the nuclear norm at large ones. The crossover takes place when , so we expect it to hold when . This result can be understood intuitively based on the central limit theorem (CLT) as each entry of is then a sum of many independent random variables, making it asymptotically normal.
On the other hand, Appendix B subsection "Attention Layer" derives the result for the attention pattern, without assuming fused attention; see Eq.86 for an exact expression for the cumulant-generating function. As argued in the rest of this subsection, the resulting prior becomes Gaussian under the condition ; on an intuitive level, a CLT argument applies again. This is the same prior on as we would have gotten from using a single Gaussian , but the product of the weights themselves is not necessarily Gaussian in this case.
We also performed new experiments with , as separate matrices, for both linear and softmax attention, and found comparable agreement with the theory. We will add these figures in the revision, and can share them in the discussion anonymously if required.
We thank the reviewer again for their careful reading and constructive suggestions, which we believe have strengthened the paper.
Thank you for your detailed response and clarifications. I have also read the other reviews and your replies, which lead me to stand by my recommendation for acceptance.
Comments on the paper
1 comment
Dear Reviewers,
We thank you again for the thoughtful reviews. Across the reviews, the paper was recognized as clearly written and technically interesting, with a novel Bayesian posterior directly over attention patterns, an intuitive order-parameter description, a sharp distinction between linear and softmax attention, and strong agreement between theory and experiments.
We have addressed the main concerns raised in the reviews:
- Mathematical status of the reduction: We clarified precisely which components are exact and which rely on the order-parameter ansatz. Most importantly, we derived Eq. (112) analytically in closed form, with no fitted coefficients; the result is identical, and all downstream conclusions remain unchanged.
- Equilibrium, optimization, and scope: We clearly separated the equilibrium theory from training dynamics, explained the filtered Adam trajectories through the competing minima predicted by the action, and added SGD results showing comparable agreement. We also clarified that the paper studies the copy subcircuit required by an induction head, while providing extensions to multi-head attention, temporally structured next-token prediction, and a multi-layer setting.
- First-order-transition phenomenology: We characterized the complete sequence of spinodals and the crossing of the two minima, derived their asymptotic scaling, and explained the dependence on posterior noise, regularization, and softmax temperature.
- Positioning: We provided a detailed comparison with recent solvable attention models across their learned objects, asymptotic regimes, control parameters, and equilibrium-versus-dynamical analyses. This makes clear that our distinctive contributions are the posterior directly over attention patterns, the classification of transition order for linear versus softmax attention; we also detailed important technical differences.
We are grateful that Reviewers 2h5a and beA3 have confirmed that the rebuttal addressed their concerns and support acceptance. We look forward to hearing the remaining reviewers’ and AC's thoughts and to discussing any outstanding points during the discussion period.
From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.
Loading the discussion…
We thank the AC for the careful synthesis of the reviews and for identifying as the paper's central strengths the posterior of attention patterns and the linear/softmax transition-order contrast. Below we address the raised points one-by-one.
Reduction to two-dimensional order parameter
We thank the AC for raising this point. The phrasing as it appears in the manuscript is indeed regrettable. We agree that the sentence Together, Eqs. (15) and (12) reduce the high-dimensional inference problem to a two-dimensional posterior without information loss. (Sec. 3.3 after Eq. 15) is not supported in the manuscript; we will replace it by Together, Eqs. (15) and (12) reduce the inference problem to a closed-form two-dimensional posterior that is asymptotically exact assuming the ansatz in Eq. (11).
Beyond the wording, the question itself has two parts: (1) The symmetries we exploit are only exact symmetries in the asymptotic EK limit P,σ2→∞ together at a fixed P/σ2. This implies that any experiment with a finite dataset will show components of the attention pattern that do not strictly respect the symmetry. (2) In the asymptotic limit, where the symmetries of the prior on G are obeyed exactly, the question remains whether the action (our Eq. (10)) is minimized by an attention matrix G which lives within our two-dimensional space. In this respect, we view the ansatz as an effective theory and an approximation. Identifying these two parameters is a substantial science-of-deep-learning contribution of our work, which we support experimentally (as in Fig.5). To be clear, it is not a result of the theory and is not derived within the theory in the current manuscript.
We can argue for the asymptotic exactness of this ansatz under two limiting assumptions: (1) The attention pattern G is sample-independent, Gα≡G. (2) No spontaneous symmetry breaking (SSB) in the out-of-space directions. Under Assumption 1, the prior is given by Eq.(112) (whose exact analytical derivation we address separately below), which has enhanced symmetry SLkey×SLquery compared to SLdiag without this assumption. This symmetry is in turn broken by the likelihood/data term down to S{G\*}L such that G transforms as G→(G\*Pk⊤G\*−1)GPk and the symmetry group is (G∗Pk⊤G∗−1,Pk)∣˜P˜k∈SL, i.e. the stabilizer StabSLkey×SLquery(G\*)≅SL. This group has two copies of the trivial irreducible representation spanning the two-dimensional space {\rm span}\left\\{ G_{*},1_L\right\\} with 1L the all-ones matrix, as in the manuscript. Under Assumption 2 and the results of the paper, the Bayesian posterior concentrates on this two-dimensional space, completing the argument (which is identical to the one we gave in response to Reviewer fbCx (W2+Q2), reproduced here in full given its centrality to the AC's assessment). We wrote an appendix with a detailed derivation under these assumptions and will add it in future versions, and we are happy to share more details in the discussion period if the area chair is interested. Additionally, we note that we believe it might be possible to derive Assumption 2 from Assumption 1, but this is still a subject of ongoing work.
We also agree this should be addressed explicitly as a limitation. Concretely, we will revise the opening of the Limitations paragraph to: To reduce the posterior to a low-dimensional order parameter space, we make several assumptions: First, the projection onto the two-dimensional subspace is an ansatz we support experimentally (see App. M) and do not prove. Second, while our Bayesian...
Regarding the question of out-of-subspace components observed for SGLD in the crossover region, this is an expected behavior: as the pooling minimum destabilizes and the copy minimum emerges, the posterior broadens and fluctuations grow; these fluctuations that exist near the phase transition populate directions off the subspace. This is an effect of SGLD sampling in contrast to Adam's point estimate.