Pretrained Transformer Efficiently Learns Low-Dimensional Target Functions In-Context
Abstract
Transformers can efficiently learn in-context from example demonstrations. Most existing theoretical analyses studied the in-context learning (ICL) ability of transformers for linear function classes, where it is typically shown that the minimizer of the pretraining loss implements one gradient descent step on the least squares objective. However, this simplified linear setting arguably does not demonstrate the statistical efficiency of ICL, since the pretrained transformer does not outperform directly solving linear regression on the test prompt. In this paper, we study ICL of a nonlinear function class via transformer with nonlinear MLP layer: given a class of single-index target functions , where the index features are drawn from a -dimensional subspace, we show that a nonlinear transformer optimized by gradient descent (with a pretraining sample complexity that depends on the information exponent of the link functions ) learns in-context with a prompt length that only depends on the dimension of the distribution of target functions ; in contrast, any algorithm that directly learns on test prompt yields a statistical complexity that scales with the ambient dimension . Our result highlights the adaptivity of the pretrained transformer to low-dimensional structures of the function class, which enables sample-efficient ICL that outperforms estimators that only have access to the in-context data.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
11 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Transformers learn to implement preconditioned gradient descent for in-context learning cites Language Models are Few-Shot Learners
- Transformers learn to implement preconditioned gradient descent for in-context learning cites Transformers Learn In-Context by Gradient Descent
- How Can Mamba Learn In Context with Outliers and Generalize Provably? cites Transformers learn to implement preconditioned gradient descent for in-context learning
- How Can Mamba Learn In Context with Outliers and Generalize Provably? cites Language Models are Few-Shot Learners
- How Can Mamba Learn In Context with Outliers and Generalize Provably? cites Transformers Learn In-Context by Gradient Descent
- Transformers are almost optimal metalearners for linear classification cites Transformers learn to implement preconditioned gradient descent for in-context learning
- Transformers are almost optimal metalearners for linear classification cites Language Models are Few-Shot Learners
- Transformers are almost optimal metalearners for linear classification cites Transformers Learn In-Context by Gradient Descent
- In-Context Learning Is Provably Bayesian Inference: A Generalization Theory for Meta-Learning cites Language Models are Few-Shot Learners
- In-Context Learning Is Provably Bayesian Inference: A Generalization Theory for Meta-Learning cites Transformers Learn In-Context by Gradient Descent
- When Do Transformers Outperform Feedforward and Recurrent Networks? A Statistical Perspective cites Transformers learn to implement preconditioned gradient descent for in-context learning
- Transformers Learn In-Context by Gradient Descent cites Language Models are Few-Shot Learners
- High-dimensional Asymptotics of Feature Learning: How One Gradient Step Improves the Representation cites Beyond Linearization: On Quadratic and Higher-Order Approximation of Wide Neural Networks
Cited by top-tier papers11
- In-Context Learning Is Provably Bayesian Inference: A Generalization Theory for Meta-LearningTomoya Wakayama, Taiji SuzukiICML 2026 · 12 citations
- From Shortcut to Induction Head: How Data Diversity Shapes Algorithm Selection in TransformersRyotaro Kawata, Yujin Song, Alberto Bietti, Naoki Nishikawa et al.NeurIPS 2025 · 7 citations
- When Do Transformers Outperform Feedforward and Recurrent Networks? A Statistical PerspectiveAlireza Mousavi-Hosseini, Clayton Sanford, Denny Wu, Murat A. ErdogduNeurIPS 2025 · 6 citations
- How Can Mamba Learn In Context with Outliers and Generalize Provably?Hongkang Li, Songtao Lu, Xiaodong Cui, Pin-Yu Chen et al.ICML 2026 · 2 citations
- Transformers are almost optimal metalearners for linear classificationRoey Magen, Gal VardiNeurIPS 2025 · 2 citations
Builds on10
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- Transformers Learn In-Context by Gradient DescentJohannes von Oswald, Eyvind Niklasson, Ettore Randazzo, João Sacramento et al.ICML 2023 · 729 citations
- Transformers learn to implement preconditioned gradient descent for in-context learningKwangjun Ahn, Xiang Cheng, Hadi Daneshmand, Suvrit SraNeurIPS 2023 · 324 citations
- High-dimensional Asymptotics of Feature Learning: How One Gradient Step Improves the RepresentationJimmy Ba, Murat A. Erdogdu, Taiji Suzuki, Zhichao Wang et al.NeurIPS 2022 · 173 citations
- Beyond Linearization: On Quadratic and Higher-Order Approximation of Wide Neural NetworksYu Bai, Jason D. LeeICLR 2020 · 128 citations
Related papers
- Nonlinear transformers can perform inference-time feature learningNaoki Nishikawa, Yujin Song, Kazusato Oko, Denny Wu et al.ICML 2025
- Transformers are Minimax Optimal Nonparametric In-Context LearnersJuno Kim, Tai Nakamaki, Taiji SuzukiNeurIPS 2024 · 42 citations
- In-Context Learning with Representations: Contextual Generalization of Trained TransformersTong Yang, Yu Huang, Yingbin Liang, Yuejie ChiNeurIPS 2024 · 45 citations
- Efficient and Minimax Optimal In-context Nonparametric Regression with TransformersMichelle Ching, Ioana Popescu, Nico Smith, Tianyi Ma et al.ICML 2026 · 6 citations
- In-context Learning on Function Classes Unveiled for TransformersZhijie Wang, Bo Jiang, Shuai LiICML 2024 · 8 citations
