atlas

Research map / Architectures and efficiency / Attention and transformers

In-Context Learning with Transformers: Softmax Attention Adapts to Function Lipschitzness

NeurIPS 2024 · Architectures and efficiency › Attention and transformers · approach: Training dynamics of in-context learning · 2 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 theoretically and empirically that softmax attention pretrained on regression ICL tasks learns an attention-window scale tied to task Lipschitzness and noise, and a projection onto the low-rank subspace of linear tasks, which linear attention cannot do.

Problem

How softmax attention learns during pretraining to perform in-context learning on regression tasks, i.e., what shared structure of pretraining tasks it recovers that enables ICL on downstream tasks.

Approach

Views pretrained softmax attention as a Nadaraya-Watson nearest-neighbor regressor whose bandwidth (attention window) is meta-learned; proves that the optimal window scale grows inversely with task Lipschitzness and with noise, and that for low-rank linear tasks the optimal key-query matrix projects onto the task subspace, while linear attention provably fails.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Pretrain softmax attention on tasks with Lipschitzness LSoftmax attention · D(Faff_L), D(F+_L)attention scale |wKQ|: Case 1: Ω(Λ^α) ≤ | w_{KQ} | ≤ O(Λ^{\frac{2α}{1-β} }); Case 2: Ω(Λ^β) ≤ |w_{KQ}|≤ O(Λ^{2β})Helped
Pretrain on tasks with Lipschitzness matching the downstream taskSoftmax attention · Downstream L-Lipschitz tasksICL loss: \uL ≤ \uO(\frac{L^2}{\Lambda^{\beta}})Helped
Use downstream tasks with higher Lipschitzness than pretraining tasksSoftmax attention pretrained on D(F+_L) · D(F+_L') with L' > LICL loss: \uL\ge\Omega(\frac{L'^2}{\Lambda^{2\beta}})Hurt
Use downstream tasks with lower Lipschitzness than pretraining tasksSoftmax attention pretrained on D(F+_L) · D(F+_L') with L' < LICL loss: \uL\ge\Omega(\frac{\Lambda^{\beta d/2}}{n})Hurt
Replace softmax activation with identityAttention for tasks from D(F+_L) · D(F+_L), covariates from U^dpretraining loss: \mathcal{L}_{LA}(\mathbf{M}) = \Omega({L^2})Hurt
Increase task Lipschitzness L (ablation)Softmax attention pretrained on D(F+_L) or D(Fcos_L) · Lipschitzness ablationattention matrix spectral norm ||M||Helped
Increase noise standard deviation σ (ablation)Softmax attention · Noise ablationattention matrix spectral norm ||M||Hurt
Increase number of context samples n (ablation)Softmax attention · Context-size ablationattention matrix spectral norm ||M||Helped
Pretrain on a different function class with the same Lipschitzness (ablation)Softmax attention · 1-Lipschitz affine, ReLU, and cosine taskstest ICL errorNo clear effect
Pretrain on cosine tasks with Lipschitzness 0.1 or 10 instead of 1 (ablation)Softmax attention evaluated on D(Fcos_1) · D(Fcos_1) test taskstest ICL errorHurt
Train on low-rank affine, quadratic, or cosine tasksSoftmax attention · Low-rank affine, quadratic, and cosine taskstest errorHelped
Replace softmax with linear attentionAttention on low-rank affine, quadratic, and cosine tasks · Low-rank affine, quadratic, and cosine tasksrecovery of low-rank structureHurt

Surprising findings

Limitations

Experimental setup

Datasets: synthetic regression tasks (affine, ReLU, cosine, quadratic GLM function classes)

Benchmarks: synthetic ICL regression tasks

Metrics: ICL test squared error attention window scale ||M|| subspace recovery metric rho(M,B)

Baselines: linear attention

Builds on: linear attention ICL analyses Nadaraya-Watson estimator

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