HackerPapers

arXiv:2310.17086cs.LG

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

Deqing Fu, Tian-Qi Chen, Robin Jia, Vatsal Sharan

Early discovery. Linked by one identifiable commenter. This paper is outside the main ranking; a mention is not an endorsement.

Abstract

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 $k$ iterations of Newton's method with $k + \mathcal{O}(1)$ layers.

arXiv comments
Accepted to NeurIPS 2024
Journal reference
DOI
Subjects
cs.LGMachine Learning cs.AIArtificial Intelligence cs.CLComputation and Language

On Hacker News

Linked by 1 identifiable commenter in 1 comment across 1 thread, from Nov 2023 to Nov 2023.

Comments linking this paper, per year.

Discussed in comments1 thread

    • >how many books is 500gb at, say, a few bits per character? In what reality is a character taking up only a few bits ? Certainly isn't this one. Your denial is so weird. Why does ICL use Higher-Order Optimization Methods when it's just a lookup table ?…

      famouswafflesView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.