CausalLM is not optimal for in-context learning
Nan Ding, Tomer Levinboim, Jialin Wu, Sebastian Goodman, Radu Soricut
摘要
Recent empirical evidence indicates that transformer based in-context learning performs better when using a prefix language model (prefixLM), in which in-context samples can all attend to each other, compared to causal language models (causalLM), which use auto-regressive attention that prohibits in-context samples to attend to future samples. While this result is intuitive, it is not understood from a theoretical perspective. In this paper we take a theoretical approach and analyze the convergence behavior of prefixLM and causalLM under a certain parameter construction. Our analysis shows that both LM types converge to their stationary points at a linear rate, but that while prefixLM converges to the optimal solution of linear regression, causalLM convergence dynamics follows that of an online gradient descent algorithm, which is not guaranteed to be optimal even as the number of samples grows infinitely. We supplement our theoretical claims with empirical experiments over synthetic and real tasks and using various types of transformers. Our experiments verify that causalLM consistently underperforms prefixLM in all settings.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 16 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Looped Transformers are Better at Learning Learning Algorithms 引用了 An Explanation of In-context Learning as Implicit Bayesian Inference
- Looped Transformers are Better at Learning Learning Algorithms 引用了 Language Models are Few-Shot Learners
- Looped Transformers are Better at Learning Learning Algorithms 引用了 What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
- Measuring Massive Multitask Language Understanding 引用了 Language Models are Few-Shot Learners
- A Theoretical Understanding of Self-Correction through In-context Alignment 引用了 What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
- Towards Understanding How Transformers Learn In-context Through a Representation Learning Lens 引用了 An Explanation of In-context Learning as Implicit Bayesian Inference
- Towards Understanding How Transformers Learn In-context Through a Representation Learning Lens 引用了 Language Models are Few-Shot Learners
- Towards Understanding How Transformers Learn In-context Through a Representation Learning Lens 引用了 What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
- A Survey on In-context Learning 引用了 An Explanation of In-context Learning as Implicit Bayesian Inference
- A Survey on In-context Learning 引用了 Language Models are Few-Shot Learners
- A Survey on In-context Learning 引用了 What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
- An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale 引用了 Language Models are Few-Shot Learners
- An Explanation of In-context Learning as Implicit Bayesian Inference 引用了 Language Models are Few-Shot Learners
- How Transformers Utilize Multi-Head Attention in In-Context Learning? A Case Study on Sparse Linear Regression 引用了 An Explanation of In-context Learning as Implicit Bayesian Inference
- How Transformers Utilize Multi-Head Attention in In-Context Learning? A Case Study on Sparse Linear Regression 引用了 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 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- What Can Transformers Learn In-Context? A Case Study of Simple Function Classes 引用了 An Explanation of In-context Learning as Implicit Bayesian Inference
- What Can Transformers Learn In-Context? A Case Study of Simple Function Classes 引用了 Language Models are Few-Shot Learners
引用它的顶会 Paper16
- A Survey on In-context LearningQingxiu Dong, Lei Li, Damai Dai, Ce Zheng 等EMNLP 2024 · 479 次引用
- Looped Transformers are Better at Learning Learning AlgorithmsLiu Yang, Kangwook Lee, Robert D. Nowak, Dimitris PapailiopoulosICLR 2024 · 82 次引用
- A Theoretical Understanding of Self-Correction through In-context AlignmentYifei Wang, Yuyang Wu, Zeming Wei, Stefanie Jegelka 等NeurIPS 2024 · 69 次引用
- Towards Understanding How Transformers Learn In-context Through a Representation Learning LensRuifeng Ren, Yong LiuNeurIPS 2024 · 26 次引用
- How Transformers Utilize Multi-Head Attention in In-Context Learning? A Case Study on Sparse Linear RegressionXingwu Chen, Lei Zhao, Difan ZouNeurIPS 2024 · 19 次引用
它引用的 Paper8
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
- An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn 等ICLR 2021 · 21,477 次引用
- Measuring Massive Multitask Language UnderstandingDan Hendrycks, Collin Burns, Steven Basart, Andy Zou 等ICLR 2021 · 7,905 次引用
- An Explanation of In-context Learning as Implicit Bayesian InferenceSang Michael Xie, Aditi Raghunathan, Percy Liang, Tengyu MaICLR 2022 · 1,030 次引用
- What Can Transformers Learn In-Context? A Case Study of Simple Function ClassesShivam Garg, Dimitris Tsipras, Percy Liang, Gregory ValiantNeurIPS 2022 · 883 次引用
相关 Paper
- Is attention required for ICL? Exploring the Relationship Between Model Architecture and In-Context Learning AbilityIvan Lee, Nan Jiang, Taylor Berg-KirkpatrickICLR 2024 · 16 次引用
- On Mesa-Optimization in Autoregressively Trained Transformers: Emergence and CapabilityChenyu Zheng, Wei Huang, Rongzhen Wang, Guoqiang Wu 等NeurIPS 2024 · 10 次引用
- Transformers Efficiently Perform In-Context Logistic Regression via Normalized Gradient DescentChenyang Zhang, Yuan CaoICML 2026 · 1 次引用
- On the Training Convergence of Transformers for In-Context Classification of Gaussian MixturesWei Shen, Ruida Zhou, Jing Yang, Cong ShenICML 2025
- How Many Pretraining Tasks Are Needed for In-Context Learning of Linear Regression?Jingfeng Wu, Difan Zou, Zixiang Chen, Vladimir Braverman 等ICLR 2024 · 94 次引用
