In-context Learning of Single-index Targets: Comparing Kernel and Feature Learners
Haotian Gu, Yizhou Xu, Lenka Zdeborová
Key points
From the paper's conclusion- Together, these results clarify how architectural choices interact with the dataset and govern nonlinear in-context learning.
Abstract
In-context learning (ICL) enables a pretrained model to infer a task from demonstrations without updating its parameters. While much of the existing theory focuses on linear target functions, in this paper we study nonlinear cases by comparing two one-layer attention architectures on the same family of single-index tasks. A kernel learner first maps inputs through a fixed nonlinear feature map and then applies linear attention, whereas a feature learner applies attention to the original input, followed by a learned nonlinear readout. We derive predictions for their memorization and generalization errors using the replica method, retaining the effects of pretraining size, task-pool diversity, and training and inference context lengths. The resulting predictions closely match numerical experiments across a broad range of regimes. Our analysis yields phase diagrams that characterize when each architecture is advantageous as the amount of pretraining data, task diversity, and context lengths vary. We further identify qualitatively different context-length scalings for the two learners. Together, these results clarify how architectural choices interact with the dataset and govern nonlinear in-context learning.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- You Don't Need Feature Learning to Do In-Context LearningarXiv · 2026
- Transformers as Adaptive Kernel Learners across Tasks for In-Context LearningarXiv · 2026
- Nonparametric In-Context Learning and Inference via Measure-Indexed Kernel Ridge RegressionarXiv · 2026
- Characterizing In-Context Learning: When Can Transformers Match Standard Learning Algorithms?2026
- What can linear attention learn from nonlinear teachers in-context?arXiv · 2026
- When Thoughts Become Memory: Unifying In-Context Learning and Fine-TuningarXiv · 2026