atlas

Research map / Optimization / Implicit bias and generalization

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

NeurIPS 2024 · Optimization › Implicit bias and generalization · approach: In-context learning as gradient descent · 1 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Shows that Transformers trained on in-context linear regression converge at a rate matching Iterative Newton's method (second-order) rather than gradient descent, and constructs a Transformer implementing k Newton iterations with k+O(1) layers.

Problem

How Transformers perform in-context learning for linear regression: whether they implicitly run first-order gradient descent or a faster second-order method, and what convergence rate their layers achieve.

Approach

Compares layer-wise Transformer predictions and induced weights against iterative algorithms (GD, Iterative Newton, OGD, BFGS, CG) via best-matching steps; finds a linear layer-to-Newton-iteration correspondence and exponential mismatch with GD, and proves one attention+MLP layer can compute one Newton iteration with O(d) hidden size.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Train a Transformer for in-context linear regressionGPT-2 · In-context linear regressionconvergence rate relative to Iterative NewtonNo clear effect
Train a Transformer for in-context linear regressionGPT-2 · In-context linear regressionconvergence rate relative to Gradient DescentHelped
Use a Transformer instead of an LSTMIn-context linear regression · In-context linear regressionerror similarity to OGD: 0.954 (LSTM) vs 0.806 (Transformers)Mixed
Use a Transformer instead of an LSTMIn-context linear regression · In-context linear regressionmean-squared errorHelped
Increase hidden size to 32 or 64 (ablation)12-layer, 1-head Transformer on d=20 · In-context linear regressionability to mimic OLSHelped
Reduce hidden size below 32 (ablation)12-layer, 1-head Transformer on d=20 · In-context linear regressionability to mimic OLSHurt
Use ill-conditioned covariance with condition number 100 (ablation)Transformer · Ill-conditioned linear regressionconvergence relative to Iterative NewtonNo clear effect
Use ill-conditioned covariance with condition number 100 (ablation)Gradient Descent · Ill-conditioned linear regressionsteps required for convergence: 2,000 stepsHurt
Use one attention head per layer instead of eight (ablation)12-layer GPT-2 Transformer · In-context linear regressionconvergence-rate similarity to Iterative NewtonNo clear effect
Increase depth to 24 layers (ablation)GPT-2 Transformer · In-context linear regressionconvergence rateNo clear effect
Use a noisy regression target with σ = 0.1 (ablation)Transformer · Noisy linear regressionconvergence rateNo clear effect
Use a 2-layer ReLU neural-network function class instead of linear regression (ablation)Transformer · 2-layer neural-network regression with ReLUconvergence rate relative to Gradient DescentHelped

Surprising findings

Limitations

Experimental setup

Datasets: synthetic linear regression prompts (Gaussian x, w*)

Benchmarks: synthetic linear regression (isotropic and ill-conditioned covariance, noisy, 2-layer MLP)

Metrics: similarity of errors (cosine) similarity of induced weights (cosine) normalized MSE best-matching steps

Baselines: Gradient Descent Online Gradient Descent Iterative Newton BFGS L-BFGS Conjugate Gradient LSTM OLS

Builds on: Akyürek et al. 2022 (what learning algorithm do transformers implement) von Oswald et al. 2023 (transformers learn GD in context) Bai et al. 2023 (transformers as algorithms) Giannou et al. 2023 (looped transformers for Newton)

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy