atlas

Research map / Architectures and efficiency / Attention and transformers

Towards Understanding How Transformers Learn In-context Through a Representation Learning Lens

NeurIPS 2024 · Architectures and efficiency › Attention and transformers · approach: Training dynamics of in-context learning · 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 one softmax attention layer's ICL inference equals one gradient step on a kernel "dual model" (via positive random features), derives a generalization bound in demonstration count, and proposes contrastive-inspired attention modifications tested on synthetic regression.

Problem

Understanding the mechanism of in-context learning in softmax-attention Transformers without restrictive assumptions on weights or input token structure (prior gradient-descent links were restricted to linear attention and linear regression).

Approach

Use kernel feature maps of the softmax kernel to define a dual linear model f(x)=W phi(x); the ICL output of one softmax attention layer equals the test prediction after one SGD step on this dual model with a cosine-style loss over demonstration key/value pairs. This representation-learning view is then linked to contrastive learning without negatives, and used to motivate regularized, augmented,

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
use the dual model's one-step gradient descent process to represent one softmax attention layerOne softmax attention layer · Synthetic linear regressionequivalenceHelped
add positive regularization (α > 0) (ablation)Attention layer · Synthetic linear regressionfinal performanceHurt
use negative regularization (α < 0) (ablation)Attention layer · Synthetic linear regressionconvergence speedHelped
apply a single-layer MLP augmentation to keys only (ablation)Attention layer · Synthetic linear regressionconvergence speedHelped
use a two-layer MLP for key augmentation (ablation)Attention layer · Synthetic linear regressionconvergence speedMixed
subtract negative-sample values using k=3 and β = 0.1 (ablation)Attention layer · Synthetic linear regressionconvergence speedHelped

Surprising findings

Limitations

Experimental setup

Datasets: synthetic linear regression tasks

Benchmarks: synthetic linear regression

Metrics: L2 distance between dual-model test prediction and ICL outpu MSE training loss

Baselines: normal (unregularized) attention model ICL as implicit fine-tuning (linear attention)

Builds on: Performer (positive random features) linear attention dual form (Irie et al.) Dai et al. ICL as implicit fine-tuning von Oswald et al. transformers learn in-context by gradient descent

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