Probing In-Context Learning: Impact of Task Complexity and Model Architecture on Generalization and Efficiency

Binwen Liu, Peiyu Xu, Quan Yuan, Yihong Chen
5/10/2025
cs.LG

No official code found. Best implementation: Binwen6/CS182_PROJECT_2025 (1 star, MIT, last commit 2025-05-06).

Abstract

We investigate in-context learning (ICL) through a meticulous experimental framework that systematically varies task complexity and model architecture. Extending beyond the linear regression baseline, we introduce Gaussian kernel regression and nonlinear dynamical system tasks, which emphasize temporal and recursive reasoning. We evaluate four distinct models: a GPT2-style Transformer, a Transformer with FlashAttention mechanism, a convolutional Hyena-based model, and the Mamba state-space model. Each model is trained from scratch on synthetic datasets and assessed for generalization during testing. Our findings highlight that model architecture significantly shapes ICL performance. The standard Transformer demonstrates robust performance across diverse tasks, while Mamba excels in temporally structured dynamics. Hyena effectively captures long-range dependencies but shows higher variance early in training, and FlashAttention offers computational efficiency but is more sensitive in low-data regimes. Further analysis uncovers locality-induced shortcuts in Gaussian kernel tasks, enhanced nonlinear separability through input range scaling, and the critical role of curriculum learning in mastering high-dimensional tasks.

View on arXivView PDF

Code Implementations(1)

MIT
11Shell, PythonMay 2, 20251 years agoMIT

Similar Papers

Cite this paper

@article{liu2025probing,
  title  = {Probing In-Context Learning: Impact of Task Complexity and Model Architecture on Generalization and Efficiency},
  author = {Binwen Liu and Peiyu Xu and Quan Yuan and Yihong Chen},
  year   = {2025},
  eprint = {2505.06475},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.06475v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2505.06475.svg)](https://codeofpaper.com/paper/2505.06475)

Discussion