Trained Transformer Classifiers Generalize and Exhibit Benign Overfitting In-Context
摘要
Transformers have the capacity to act as supervised learning algorithms: by properly encoding a set of labeled training ("in-context") examples and an unlabeled test example into an input sequence of vectors of the same dimension, the forward pass of the transformer can produce predictions for that unlabeled test example. A line of recent work has shown that when linear transformers are pre-trained on random instances for linear regression tasks, these trained transformers make predictions using an algorithm similar to that of ordinary least squares. In this work, we investigate the behavior of linear transformers trained on random linear classification tasks. Via an analysis of the implicit regularization of gradient descent, we characterize how many pre-training tasks and in-context examples are needed for the trained transformer to generalize well at test-time. We further show that in some settings, these trained transformers can exhibit "benign overfitting in-context": when in-context examples are corrupted by label flipping noise, the transformer memorizes all of its in-context examples (including those with noisy labels) yet still generalizes near-optimally for clean test examples.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 11 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selection 引用了 Language Models are Few-Shot Learners
- Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selection 引用了 Transformers Learn In-Context by Gradient Descent
- Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selection 引用了 What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
- Short-length Adversarial Training Helps LLMs Defend Long-length Jailbreak Attacks: Theoretical and Empirical Evidence 引用了 Language Models are Few-Shot Learners
- Short-length Adversarial Training Helps LLMs Defend Long-length Jailbreak Attacks: Theoretical and Empirical Evidence 引用了 Transformers Learn In-Context by Gradient Descent
- Short-length Adversarial Training Helps LLMs Defend Long-length Jailbreak Attacks: Theoretical and Empirical Evidence 引用了 What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
- Transformers are almost optimal metalearners for linear classification 引用了 Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selection
- Transformers are almost optimal metalearners for linear classification 引用了 Gradient Descent Maximizes the Margin of Homogeneous Neural Networks
- Transformers are almost optimal metalearners for linear classification 引用了 Language Models are Few-Shot Learners
- Transformers are almost optimal metalearners for linear classification 引用了 Transformers Learn In-Context by Gradient Descent
- Transformers are almost optimal metalearners for linear classification 引用了 What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
- Adversarially Pretrained Transformers May Be Universally Robust In-Context Learners 引用了 Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selection
- Adversarially Pretrained Transformers May Be Universally Robust In-Context Learners 引用了 Short-length Adversarial Training Helps LLMs Defend Long-length Jailbreak Attacks: Theoretical and Empirical Evidence
- Adversarially Pretrained Transformers May Be Universally Robust In-Context Learners 引用了 Language Models are Few-Shot Learners
- Adversarially Pretrained Transformers May Be Universally Robust In-Context Learners 引用了 On the Robustness of Transformers against Context Hijacking for Linear Classification
- Adversarially Pretrained Transformers May Be Universally Robust In-Context Learners 引用了 Transformers Learn In-Context by Gradient Descent
- Adversarially Pretrained Transformers May Be Universally Robust In-Context Learners 引用了 What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
- On the Robustness of Transformers against Context Hijacking for Linear Classification 引用了 Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selection
- On the Robustness of Transformers against Context Hijacking for Linear Classification 引用了 Language Models are Few-Shot Learners
- On the Robustness of Transformers against Context Hijacking for Linear Classification 引用了 Transformers Learn In-Context by Gradient Descent
- On the Robustness of Transformers against Context Hijacking for Linear Classification 引用了 What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
- Provably Transformers Harness Multi-Concept Word Semantics for Efficient In-Context Learning 引用了 Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selection
- Provably Transformers Harness Multi-Concept Word Semantics for Efficient In-Context Learning 引用了 Transformers Learn In-Context by Gradient Descent
- Transformers Learn In-Context by Gradient Descent 引用了 Language Models are Few-Shot Learners
- Transformers Learn In-Context by Gradient Descent 引用了 What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
- What Can Transformers Learn In-Context? A Case Study of Simple Function Classes 引用了 Language Models are Few-Shot Learners
引用它的顶会 Paper11
- Short-length Adversarial Training Helps LLMs Defend Long-length Jailbreak Attacks: Theoretical and Empirical EvidenceShaopeng Fu, Liang Ding, Jingfeng Zhang, Di WangNeurIPS 2025 · 15 次引用
- Provably Transformers Harness Multi-Concept Word Semantics for Efficient In-Context LearningDake Bu, Wei Huang, Andi Han, Atsushi Nitanda 等NeurIPS 2024 · 11 次引用
- On the Robustness of Transformers against Context Hijacking for Linear ClassificationTianle Li, Chenyang Zhang, Xingwu Chen, Yuan Cao 等NeurIPS 2025 · 7 次引用
- Transformers are almost optimal metalearners for linear classificationRoey Magen, Gal VardiNeurIPS 2025 · 2 次引用
- Adversarially Pretrained Transformers May Be Universally Robust In-Context LearnersSoichiro Kumano, Hiroshi Kera, Toshihiko YamasakiICLR 2026 · 2 次引用
它引用的 Paper16
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
- What Can Transformers Learn In-Context? A Case Study of Simple Function ClassesShivam Garg, Dimitris Tsipras, Percy Liang, Gregory ValiantNeurIPS 2022 · 883 次引用
- Transformers Learn In-Context by Gradient DescentJohannes von Oswald, Eyvind Niklasson, Ettore Randazzo, João Sacramento 等ICML 2023 · 729 次引用
- Gradient Descent Maximizes the Margin of Homogeneous Neural NetworksKaifeng Lyu, Jian LiICLR 2020 · 402 次引用
- Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm SelectionYu Bai, Fan Chen, Huan Wang, Caiming Xiong 等NeurIPS 2023 · 356 次引用
相关 Paper
- Linear Transformers are Versatile In-Context LearnersMax Vladymyrov, Johannes von Oswald, Mark Sandler, Rong GeNeurIPS 2024 · 37 次引用
- Transformers Efficiently Perform In-Context Logistic Regression via Normalized Gradient DescentChenyang Zhang, Yuan CaoICML 2026 · 1 次引用
- In-context Learning on Function Classes Unveiled for TransformersZhijie Wang, Bo Jiang, Shuai LiICML 2024 · 8 次引用
- Pretrain–Test Task Alignment Governs Generalization in In-Context LearningMary Letey, Jacob A Zavatone-Veth, Yue M. Lu, Cengiz PehlevanICLR 2026 · 6 次引用
- Transformers learn to implement preconditioned gradient descent for in-context learningKwangjun Ahn, Xiang Cheng, Hadi Daneshmand, Suvrit SraNeurIPS 2023 · 324 次引用
