paper-with-me

홈 › Papers

How Do Nonlinear Transformers Learn and Generalize in In-Context Learning?

2024-02-23 · Hongkang Li, Meng Wang, Songtao Lu, Xiaodong Cui, Pin-Yu Chen

Transformer-based large language models have displayed impressive in-context learning capabilities, where a pre-trained model can handle new tasks without fine-tuning by simply augmenting the query with some input-output examples from that task. Despite the empirical success, the mechanics of how to train a Transformer to achieve ICL and the corresponding ICL capacity is mostly elusive due to the technical challenges of analyzing the nonconvex training problems resulting from the nonlinear self-attention and nonlinear activation in Transformers. To the best of our knowledge, this paper provides the first theoretical analysis of the training dynamics of Transformers with nonlinear self-attention and nonlinear MLP, together with the ICL generalization capability of the resulting model. Focusing on a group of binary classification tasks, we train Transformers using data from a subset of these tasks and quantify the impact of various factors on the ICL generalization performance on the remaining unseen tasks with and without data distribution shifts. We also analyze how different components in the learned Transformers contribute to the ICL performance. Furthermore, we provide the first theoretical analysis of how model pruning affects ICL performance and prove that proper magnitude-based pruning can have a minimal impact on ICL while reducing inference costs. These theoretical findings are justified through numerical experiments.

📄 PDF Abstract BibTeX arXiv:2402.15607

Code (0)

등록된 구현이 없습니다.

Tasks

Binary ClassificationIn-Context Learning

Methods 이 논문이 사용한 방법론

Linear Layer A Linear Layer is a projection $\mathbf{XW + b}$.
BPE Byte Pair Encoding, or BPE, is a subword segmentation algorithm that encodes rare and unknown words as sequences of subword units. The intuition is that various word…
Dropout Dropout is a regularization technique for neural networks that drops a unit (along with connections) at training time with a specified probability $p$ (a common value is…
Pruning 설명 없음
Dense Connections Dense Connections, or Fully Connected Connections, are a type of layer in a deep neural network that use a linear operation where every input is connected to every output…
Label Smoothing Label Smoothing is a regularization technique that introduces noise for the labels. This accounts for the fact that datasets may have mistakes in them, so maximizing the…
Adam 설명 없음
Attention 설명 없음

Similar Papers 제목 키워드 기반

When can in-context learning generalize out of task distribution?

2025-06-05 · Chase Goddard, Lindsay M. Smith, Vudtiwat Ngampruetikorn, David J. Schwab

In-context learning (ICL) is a remarkable capability of pretrained transformers that allows models to generalize to unseen tasks after seeing only a few examples. We investigate empirically the conditions necessary on th…

DiversityIn-Context Learningregression

In-Context Learning through the Bayesian Prism

2023-06-08 · Madhur Panwar, Kabir Ahuja, Navin Goyal

In-context learning (ICL) is one of the surprising and useful features of large language models and subject of intense research. Recently, stylized meta-learning-like ICL setups have been devised that train transformers …

Bayesian InferenceIn-Context LearningInductive BiasLanguage Modelling+2

How Can Mamba Learn In Context with Outliers and Generalize Provably?

2025-10-01 · Hongkang Li, Songtao Lu, Xiaodong Cui, Pin-Yu Chen 외 arxiv

The Mamba model has gained significant attention for its computational advantages over Transformer-based models, while achieving comparable performance across a wide range of language tasks. Like Transformers, Mamba exhi…

Binary Classification

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…

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…