atlas

Research map / Architectures and efficiency / Attention and transformers

In-context Learning on Function Classes Unveiled for Transformers

ICML 2024 · Architectures and efficiency › Attention and transformers · approach: Training dynamics of in-context learning

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.

Theoretical paper showing by construction that transformers with general activation functions can implement approximate gradient descent on n-layer neural networks in-context, enabling learning of linear, indicator, and smooth function classes and algorithm selection.

Problem

Explaining why transformer-based sequence models can learn different function classes in-context, via neural networks as intermediaries.

Approach

Constructs transformers (with general decay-condition activation functions) that implement approximate gradient descent steps on n-layer neural network parameters in context, with resource bounds on heads, hidden dimension, and layers; uses neural network approximation to cover indicator, linear, and smooth function classes, and a two-task indicator construction for algorithm selection.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use a 3-layer rather than a 2-layer neural network to approximate the indicator function (ablation)Transformer in-context learning of indicator functions of L2 balls · indicator functions of L2 ballsnumber of attention heads and hidden dimension: O(δ^−1/2) wide neural network; O(1/(δϵ^2)) versus O(exp(δ^−1/4)ϵ^−2)Helped
Use a deep network instead of a shallow network as the approximator (ablation)Transformer learning smooth functions · smooth functionsnumber of attention heads and hidden dimension: O(δ^−d/n) versus O(δ^−1/(L−1))Helped
Control neural-network width rather than depth while keeping nK^2 constant (ablation)Transformer approximate gradient descent on neural networks · n-layer neural networkscomputational resource: nK^2Helped
Pre-train on both linear regression and classification tasks and select the task-specific algorithm from the promptTransformer · linear regression and classificationprediction error: O(ϵ + δ)Helped

Surprising findings

Limitations

Experimental setup

Builds on: Bai et al. 2024 (transformers as algorithm selectors) Siegel & Xu 2020 (neural network approximation rates) Von Oswald et al. 2023 (transformers perform gradient descent in context) Safran & Shamir 2017 (depth-width trade-offs)

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