The Effect of Training Task Diversity on In-Context Learning through the Lens of Low-Dimensional Subspaces

Soo Min Kwon, Alec S. Xu, Can Yaras, Dogyoon Song, Laura Balzano +1 more
6/5/2026
stat.MLcs.LGmath.ST
transformer-attention

No confident code implementation found for this paper.

Abstract

The transformer's emergent ability to perform in-context learning (ICL) has sparked a wide range of studies designed to understand its underlying mechanisms. Existing works often study how training task diversity, defined either as the number of ICL training task vectors or as the number of function classes from which the task vectors are drawn, shapes both the learning dynamics and generalization capabilities of ICL.

Show full abstract

While both definitions have uncovered many interesting phenomena, many observations under the latter definition remain theoretically unexplained. This paper presents a minimal analytical model under which these phenomena provably emerge from the properties of the training data. By modeling the training task vectors as a mixture of low-rank Gaussians, we show how training task diversity, defined by the number of non-overlapping columns between subspaces that parameterize the covariance matrices, improves both the generalization and optimization trajectory of ICL with linear attention. In particular, we show that our model can explain (i) why training with task diversity shortens the ICL plateau and (ii) why ICL appears to achieve out-of-distribution generalization. We conclude by empirically demonstrating how our results extend to nonlinear transformers and nonlinear function classes. Overall, our work presents a tractable framework to unify existing observations.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{kwon2026effect,
  title  = {The Effect of Training Task Diversity on In-Context Learning through the Lens of Low-Dimensional Subspaces},
  author = {Soo Min Kwon and Alec S. Xu and Can Yaras and Dogyoon Song and Laura Balzano and Qing Qu},
  year   = {2026},
  eprint = {2606.06814},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2606.06814v1}
}

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/2606.06814.svg)](https://codeofpaper.com/paper/2606.06814)

Discussion