atlas

Research map / Architectures and efficiency / Attention and transformers

In-Context Learning with Representations: Contextual Generalization of Trained Transformers

NeurIPS 2024 · Architectures and efficiency › Attention and transformers · approach: Training dynamics of in-context learning · 0 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.

Analyzes gradient-descent training of a one-layer multi-head softmax-attention transformer on noisy non-linear regression ICL with partial prompts, proving linear convergence and showing the trained model implements ridge regression over basis functions.

Problem

How transformers learn contextual (template) information to predict unseen examples when prompts contain only a few noisy query-answer pairs that underdetermine the template; prior provable ICL training-dynamics work requires long prompts or restrictive assumptions.

Approach

Model ICL as regression where labels are a linear combination of m basis functions with Gaussian label noise; prove GD on a one-layer multi-head softmax transformer converges linearly to a global minimum without orthogonal-token or long-prompt assumptions, and that the learned model performs ridge regression over the basis at inference time.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Train a 1-layer or 4-layer transformer with multi-head attentionTransformer on synthetic regression ICL · In-domain and OOD test setsinference lossHelped
Evaluate on OOD tasks sampled from N(1_m, 4I_m) instead of in-domain tasks1-layer and 4-layer transformers · OOD test set vs. in-domain test setinference lossHurt
Set the representation dimension m closer to prompt length NPretrained 1-layer transformer · Synthetic regression ICL; N from 50 to 150, m=100performance gap to best predictionHelped
Use fewer than N attention heads (ablation)1-layer transformer · Synthetic regression ICL; N=30training lossHurt
Set the number of attention heads to H=30 (ablation)1-layer transformer · Synthetic regression ICL; N=30training lossHelped
Increase the number of attention heads to H=400 (ablation)1-layer transformer · Synthetic regression ICLtraining lossHurt
Increase the number of attention heads in the 4-layer transformer (ablation)4-layer transformer · Synthetic regression ICL; fixed 100-second training timetraining and inference lossHurt
Use H=4 rather than larger head counts in the 4-layer transformer (ablation)4-layer transformer · Synthetic regression ICL; fixed 100-second training timefinal training lossHelped

Surprising findings

Limitations

Experimental setup

Datasets: synthetic Gaussian tokens and representations synthetic regression tasks with Gaussian lambda

Benchmarks: synthetic in-domain and out-of-domain regression test sets

Metrics: training loss inference loss (1/K ||y_hat - y_hat*||^2) performance gap to best ridge estimator

Baselines: Huang et al. one-layer softmax ICL dynamics Li et al. multi-task linear regression dynamics Zhang et al. linear attention dynamics

Builds on: Transformers learn in-context by gradient descent Training dynamics of one-layer softmax attention ICL (Huang et al.) Transformers as statisticians / representation-based ICL

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