- Rating
- 4
- Clarity
- 3
- Confidence
- 3
- Originality
- 3
- Quality
- 3
- Significance
- 2
Read review
Summary
This paper present a theoretical analysis to explain the poor performance of transformer when tested with out-of-distribution (OOD) inputs. By characterizing the OOD error through the transformer's confidene in identifying the correct and incorrect features, the authors theoretically found that the OOD error for each feature depends on all pairwise interactions between the training features and OOD features. In addition, the authors further examize the performance of transformer when finetuned with the OOD data. The experiments are conducted carefully and the results show consistency with the theoretical insights.
Strengths and weaknesses
Strength
-
Clear theoretical characterization of OOD errors. I particularly like the decomposition of attention into -type and -type weights introduced in Sec. 5. Rather than treating OOD failure as a single phenomenon, Theorem 5.1 explicitly characterizes the OOD prediction error through the interaction between these two types of attention weights, providing an interpretable explanation of how feature geometry affects OOD generalization.
-
Unified analysis of OOD generalization and finetuning. Beyond the OOD analysis, the paper further studies finetuning under distribution shift. In particular, Theorems 5.5 and 5.6 characterize both the improvement on the shifted domain and the forgetting behavior on the original domain within the same analytical framework. This makes the extension more coherent than treating forgetting as a separate problem.
-
The experiments are well aligned with the theoretical claims. The synthetic experiments directly validate predictions from Theorem 5.1 and the forgetting analysis, while additional evaluations on TinyTransformer, BERT, MNLI, and SNLI demonstrate that the observed behaviors remain visible beyond the idealized theoretical setting.
Weaknesses
-
Limited scope of the theoretical guarantees. Most theoretical results, including Theorems 5.1, 5.5 and 5.6, are derived under a one-layer softmax transformer together with linear regression and orthogonal feature assumptions. Although the empirical section considers deeper architectures, it remains unclear which parts of these results are expected to transfer to practical multi-layer transformers.
-
Some assumptions appear stronger than necessary. The analysis simultaneously assumes linear tasks, orthogonal feature representations and the structured feature-shift condition in Assumption 5.4. Since these assumptions are introduced together, it is difficult to identify which assumption is fundamentally required by the proofs and which is mainly adopted for analytical convenience.
Questions
Which assumptions would be the hardest to relax when extending the analysis to standard multi-layer transformers? For example, is the one-layer attention architecture essential for the proofs, or do the arguments mainly rely on the linear feature assumptions?
Limitations
yes
Paper formatting concerns
N/A
Final justification
The responses clarify the role of the different assumptions and better explain which parts of the analysis are fundamental versus introduced mainly for analytical convenience. I still view the limited theoretical scope beyond the one-layer setting as the main limitation, but the rebuttal does not materially change my overall assessment. Therefore, I keep my overall recommendation unchanged.
We thank the reviewer for the insightful feedback. Below we provide our detailed responses to the reviewer’s comments. If our responses addressed your concerns, we would greatly appreciate your kind consideration in increasing your score.
Q1: Limited scope of the theoretical guarantees. Most theoretical results, including Theorems 5.1, 5.5 and 5.6, are derived under a one-layer softmax transformer together with linear regression and orthogonal feature assumptions. Although the empirical section considers deeper architectures, it remains unclear which parts of these results are expected to transfer to practical multi-layer transformers.
A1: Thank you for the thoughtful comment. The training dynamics of a one-layer softmax Transformer combined with linear regression are tractable using current analytical techniques. These assumptions are commonly made by [1,2,3].
We also want to point out Assumption 5.4 (on structured feature shift) is not essential to our main theoretical development; rather, it is introduced only to simplify the final fine-tuning results and make them more interpretable. In particular, the assumption is not required for the OOD results in Theorem 5.1 and Corollary 5.2, nor for the core α/β attention dynamics established in Lemma 5.3, which underpin the fine-tuning analyses in Theorems 5.5 and 5.6. Assumption 5.4 imposes orthogonality between the source and target features, thereby eliminating their cross-correlation terms. Without this assumption, Theorems 5.5 and 5.6 could still be derived by retaining the corresponding cross-correlation terms throughout the analysis. This would not introduce a fundamental technical obstacle, but it would lead to substantially more complicated expressions that would obscure the key insights into forgetting behavior.
Our experiments with deeper TinyTransformers and BERT are intended to examine whether similar qualitative trends provided by theory can still be observed in multi-layer models. In a multi-layer transformer, later-layer attention still operates on learned representations, and OOD behavior should continue to depend on how target representations align with the source representation geometry, how strongly attention concentrates on task-relevant features, and how much interference is induced by competing features. From this perspective, the α- and β-type quantities should be viewed as tractable surrogates for two broader mechanisms: amplification of task-relevant representations and suppression of irrelevant or conflicting representations. Similarly, during fine-tuning, updates to shared representations and attention modules can simultaneously improve target-domain discrimination and alter source-domain interference, which is the mechanism underlying the positive- versus negative-forgetting regimes identified by our theory.
However, the exact expression in Theorem 5.1 or the precise update formulas in Theorems 5.5 and 5.6 won’t transfer directly to deeper models. A rigorous extension would require tracking both representation evolution across layers and the induced attention dynamics, which we will be excited to pursue in the future.
Q2: Which of the assumptions—linear tasks, orthogonal feature representations, and the structured feature-shift condition in Assumption 5.4—are fundamentally essential for the proofs, and which are mainly adopted for analytical convenience?
A2: Thank you for the thoughtful comment. We agree that it is important to clarify the role of each assumption.
First, the linear-task setting is widely adopted in recent theoretical studies of Transformer-based in-context learning [4–6], and we use it as a standard, analytically tractable framework for investigating the OOD ICL. There are promising directions for relaxing this assumption, for example, by considering unknown feature representations [7] or more general nonlinear target functions [8]. However, existing studies along these directions focus primarily on vanilla ICL. Extending such analyses to our OOD setting introduces substantial additional challenges, which we leave for future work.
Second, the orthogonal-feature assumption is more central to our current analysis. Without this assumption, the training dynamics may change substantially, and, to the best of our knowledge, a complete characterization of the training dynamics of a one-layer softmax Transformer under arbitrary feature representations has not yet been established even for the vanilla ICL. Nevertheless, we believe that this assumption could be relaxed by explicitly tracking the correlations among features throughout the analysis. Doing so would, however, considerably complicate the proof and might require introducing additional training phases, which we leave for future work.
Finally, Assumption 5.4 is not essential, and mainly introduced for analytical clarity. See more details in the second paragraph of A1 to Q1.
Q3: Which assumptions would be the hardest to relax when extending the analysis to standard multi-layer transformers? For example, is the one-layer attention architecture essential for the proofs, or do the arguments mainly rely on the linear feature assumptions?
A3: Thank you for the question. As discussed in our response to Q2, the linear-regression and feature assumptions may be relaxed to some extent. The more fundamental obstacle to extending our guarantees to standard multi-layer Transformers is the one-layer architecture. Our proof relies critically on the tractable training dynamics of a single attention layer. With multiple layers, the attention dynamics become coupled across layers, and the dynamical characterization underlying our analysis no longer applies. Relaxing this assumption would therefore require substantially new technical tools. To the best of our knowledge, a complete training-dynamics analysis of multi-layer softmax-attention Transformers remains largely unexplored. We view this as an important direction for future work.
We thank the reviewer again for the insightful comments. We hope our responses addressed your concerns. Certainly, we will be more than happy to answer any further questions you might have.
[1] Chen, Zheng-An, Pengxiao Lin, Zhi-Qin John Xu, and Tao Luo. "Focus and Dilution: The Multi-stage Learning Process of Attention." The Forty-Third International Conference on Machine Learning (ICML) 2026.
[2] He, Jianliang, Xintian Pan, Siyu Chen, and Zhuoran Yang. "In-Context Linear Regression Demystified: Training Dynamics and Mechanistic Interpretability of Multi-Head Softmax Attention." The Forty-Second International Conference on Machine Learning (ICML) 2025.
[3] Huang Yu, Yuan Cheng, and Yingbin Liang. "In-context Convergence of Transformers." International Conference on Machine Learning(ICML) 2024.
[4] Zhang, Yedi, et al. "Training Dynamics of In-Context Learning in Linear Attention." International Conference on Machine Learning(ICML) 2025.
[5] Huang, Ruomin, and Rong Ge. "Task Descriptors Help Transformers Learn Linear Models In-Context." The Thirteenth International Conference on Learning Representations(ICLR) 2025.
[6] Huang, Jianhao, Zixuan Wang, and Jason D. Lee. "Transformers Learn to Implement Multi-step Gradient Descent with Chain of Thought." The Thirteenth International Conference on Learning Representations(ICLR) 2025
[7] Tong Yang, Yu Huang, Yingbin Liang, Yuejie Chi. "In-context learning with representations: Contextual generalization of trained transformers", Proc. Advances in Neural Information Processing Systems (NeurIPS), 2024.
[8] Li, Hongbo, Lingjie Duan, and Yingbin Liang. "Provable In-Context Learning of Nonlinear Regression with Transformers." arXiv preprint arXiv:2507.20443 (2025).