Lune

NeurIPS2024顶会

Transformers Learn to Achieve Second-Order Convergence Rates for In-Context Linear Regression

Deqing Fu, Tianqi Chen, Robin Jia, Vatsal Sharan

摘要

Transformers excel at in-context learning (ICL) -- learning from demonstrations without parameter updates -- but how they do so remains a mystery. Recent work suggests that Transformers may internally run Gradient Descent (GD), a first-order optimization method, to perform ICL. In this paper, we instead demonstrate that Transformers learn to approximate second-order optimization methods for ICL. For in-context linear regression, Transformers share a similar convergence rate as Iterative Newton's Method, both exponentially faster than GD. Empirically, predictions from successive Transformer layers closely match different iterations of Newton's Method linearly, with each middle layer roughly computing 3 iterations; thus, Transformers and Newton's method converge at roughly the same rate. In contrast, Gradient Descent converges exponentially more slowly. We also show that Transformers can learn in-context on ill-conditioned data, a setting where Gradient Descent struggles but Iterative Newton succeeds. Finally, to corroborate our empirical findings, we prove that Transformers can implement kk iterations of Newton's method with k+O(1)k + \mathcal{O}(1) layers.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 19 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Improving Model Representation and Reducing KV Cache via Skip Connections with First Value Heads 引用了 A Survey on In-context Learning
  • Improving Model Representation and Reducing KV Cache via Skip Connections with First Value Heads 引用了 Language Models are Few-Shot Learners
  • Improving Model Representation and Reducing KV Cache via Skip Connections with First Value Heads 引用了 Transformers Learn In-Context by Gradient Descent
  • 'Oh LLM, I'm Asking Thee, Please Give Me a Decision Tree': Zero-Shot Decision Tree Induction and Embedding with Large Language Models 引用了 A Survey on In-context Learning
  • 'Oh LLM, I'm Asking Thee, Please Give Me a Decision Tree': Zero-Shot Decision Tree Induction and Embedding with Large Language Models 引用了 Language Models are Few-Shot Learners
  • Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity 引用了 Language Models are Few-Shot Learners
  • Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity 引用了 Calibrate Before Use: Improving Few-shot Performance of Language Models
  • A Survey on In-context Learning 引用了 Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity
  • A Survey on In-context Learning 引用了 Language Models are Few-Shot Learners
  • A Survey on In-context Learning 引用了 Transformers Learn In-Context by Gradient Descent
  • A Survey on In-context Learning 引用了 Calibrate Before Use: Improving Few-shot Performance of Language Models
  • Linear Transformers Implicitly Discover Unified Numerical Algorithms 引用了 Language Models are Few-Shot Learners
  • Linear Transformers Implicitly Discover Unified Numerical Algorithms 引用了 Transformers Learn In-Context by Gradient Descent
  • Transformers Learn Latent Mixture Models In-Context via Mirror Descent 引用了 Towards Automated Circuit Discovery for Mechanistic Interpretability
  • Transformers Learn Latent Mixture Models In-Context via Mirror Descent 引用了 Language Models are Few-Shot Learners
  • Transformers Learn Latent Mixture Models In-Context via Mirror Descent 引用了 Transformers Learn In-Context by Gradient Descent
  • Transformers Learn In-Context by Gradient Descent 引用了 Language Models are Few-Shot Learners
  • Calibrate Before Use: Improving Few-shot Performance of Language Models 引用了 Language Models are Few-Shot Learners
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper19

  1. A Survey on In-context LearningQingxiu Dong, Lei Li, Damai Dai, Ce Zheng 等EMNLP 2024 · 479 次引用
  2. Improving Model Representation and Reducing KV Cache via Skip Connections with First Value HeadsZhoutong Wu, Yuan Zhang, Yiming Dong, Chenheng Zhang 等NeurIPS 2025 · 4 次引用
  3. 'Oh LLM, I'm Asking Thee, Please Give Me a Decision Tree': Zero-Shot Decision Tree Induction and Embedding with Large Language ModelsRicardo Knauer, Mario Koddenbrock, Raphael Wallsberger, Nicholas M. Brisson 等KDD 2025 · 3 次引用
  4. Linear Transformers Implicitly Discover Unified Numerical AlgorithmsPatrick Lutz, Aditya Gangrade, Hadi Daneshmand, Venkatesh SaligramaNeurIPS 2025 · 3 次引用
  5. Transformers Learn Latent Mixture Models In-Context via Mirror DescentFrancesco D'Angelo, Nicolas FlammarionICLR 2026 · 2 次引用

它引用的 Paper24

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
  2. Calibrate Before Use: Improving Few-shot Performance of Language ModelsZihao Zhao, Eric Wallace, Shi Feng, Dan Klein 等ICML 2021 · 1,843 次引用
  3. Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order SensitivityYao Lu, Max Bartolo, Alastair Moore, Sebastian Riedel 等ACL 2022 · 1,494 次引用
  4. Towards Automated Circuit Discovery for Mechanistic InterpretabilityArthur Conmy, Augustine N. Mavor-Parker, Aengus Lynch, Stefan Heimersheim 等NeurIPS 2023 · 861 次引用
  5. Transformers Learn In-Context by Gradient DescentJohannes von Oswald, Eyvind Niklasson, Ettore Randazzo, João Sacramento 等ICML 2023 · 729 次引用

相关 Paper

  1. On the Learn-to-Optimize Capabilities of Transformers in In-Context Sparse RecoveryRenpu Liu, Ruida Zhou, Cong Shen, Jing YangICLR 2025
  2. In-Context Deep Learning via Transformer ModelsWeimin Wu, Maojiang Su, Jerry Yao-Chieh Hu, Zhao Song 等ICML 2025
  3. What learning algorithm is in-context learning? Investigations with linear modelsEkin Akyürek, Dale Schuurmans, Jacob Andreas, Tengyu Ma 等ICLR 2023 · 85 次引用
  4. Transformers Efficiently Perform In-Context Logistic Regression via Normalized Gradient DescentChenyang Zhang, Yuan CaoICML 2026 · 1 次引用
  5. Towards Understanding In-Context Learning of Transformers Under Non-I.I.D. ScenariosQilu Shen, Yingjie Wang, Jinhai XiangAAAI 2026
黄昏的海面,两侧是细线勾勒的悬崖