paper-with-me

홈 › Papers

Provable In-Context Learning of Nonlinear Regression with Transformers

2025-07-28 · Hongbo Li, Lingjie Duan, Yingbin Liang arxiv

The transformer architecture, which processes sequences of input tokens to produce outputs for query tokens, has revolutionized numerous areas of machine learning. A defining feature of transformers is their ability to perform previously unseen tasks using task specific prompts without updating parameters, a phenomenon known as in-context learning (ICL). Recent research has actively explored the training dynamics behind ICL, with much of the focus on relatively simple tasks such as linear regression and binary classification. To advance the theoretical understanding of ICL, this paper investigates more complex nonlinear regression tasks, aiming to uncover how transformers acquire in-context learning capabilities in these settings. We analyze the stage-wise dynamics of attention during training: attention scores between a query token and its target features grow rapidly in the early phase, then gradually converge to one, while attention to irrelevant features decays more slowly and exhibits oscillatory behavior. Our analysis introduces new proof techniques that explicitly characterize how the nature of general non-degenerate $L$-Lipschitz task functions affects attention weights. Specifically, we identify that the Lipschitz constant $L$ of nonlinear function classes as a key factor governing the convergence dynamics of transformers in ICL. Leveraging these insights, for two distinct regimes depending on whether $L$ is below or above a threshold, we derive different time bounds to guarantee near-zero prediction error. Notably, despite the convergence time depending on the underlying task functions, we prove that query tokens consistently attend to prompt tokens with highly relevant features at convergence, demonstrating the ICL capability of transformers for unseen functions.

📄 PDF Abstract BibTeX arXiv:2507.20443

Code (0)

등록된 구현이 없습니다.

Tasks

Binary Classification

Similar Papers 제목 키워드 기반

Understanding In-Context Learning for Nonlinear Regression with Transformers: Attention as Featurizer

2026-05-06 · Alexander Hsu, Zhaiming Shen, Wenjing Liao, Rongjie Lai arxiv

Pre-trained transformers are able to learn from examples provided as part of the prompt without any weight updates, a remarkable ability known as in-context learning (ICL). Despite its demonstrated efficacy across variou…

Provable In-context Learning for Mixture of Linear Regressions using Transformers

2024-10-18 · Yanhao Jin, Krishnakumar Balasubramanian, Lifeng Lai

We theoretically investigate the in-context learning capabilities of transformers in the context of learning mixtures of linear regression models. For the case of two mixtures, we demonstrate the existence of transformer…

In-Context Learning

Transformers Are Universally Consistent

2025-05-30 · Sagar Ghosh, Kushal Bose, Swagatam Das

Despite their central role in the success of foundational models and large-scale language modeling, the theoretical foundations governing the operation of Transformers remain only partially understood. Contemporary resea…

In-Context LearningLanguage ModelingLanguage Modelling

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

2024-08-19 · Tong Yang, Yu Huang, Yingbin Liang, Yuejie Chi

In-context learning (ICL) refers to a remarkable capability of pretrained large language models, which can learn a new task given a few examples during inference. However, theoretical understanding of ICL is largely unde…

In-Context Learning

Asymptotic Study of In-context Learning with Random Transformers through Equivalent Models

2025-09-18 · Samet Demir, Zafer Dogan arxiv

We study the in-context learning (ICL) capabilities of pretrained Transformers in the setting of nonlinear regression. Specifically, we focus on a random Transformer with a nonlinear MLP head where the first layer is ran…