In-Context Learning of Linear Systems: Generalization Theory and Applications to Operator Learning

Frank Cole, Yulong Lu, Wuzhe Xu, Tianhao Zhang
9/18/2024
8 citations
cs.LGmath.NAstat.ML
transformer-attention

Official code: LuGroupUMN/ICL-EllipticPDEs (1 star, Python, last commit 2024-10-13). 1 more implementation below.

Abstract

We study theoretical guarantees for solving linear systems in-context using a linear transformer architecture. For in-domain generalization, we provide neural scaling laws that bound the generalization error in terms of the number of tasks and sizes of samples used in training and inference.

Show full abstract

For out-of-domain generalization, we find that the behavior of trained transformers under task distribution shifts depends crucially on the distribution of the tasks seen during training. We introduce a novel notion of task diversity and show that it defines a necessary and sufficient condition for pre-trained transformers generalize under task distribution shifts. We also explore applications of learning linear systems in-context, such as to in-context operator learning for PDEs. Finally, we provide some numerical experiments to validate the established theory.

View on arXivView PDF

Code Implementations(2)

Code implementations of this paper
RepositoryTypeStarsLanguageLicenseLast commit
LuGroupUMN/ICL-EllipticPDEsOfficial1Python–2024-10-13
LuGroupUMN/ICL_Linear_SystemsOfficial0Jupyter Notebook–2025-05-08
10PythonOct 12, 20242 years ago
00Jupyter Notebook, PythonMay 8, 20251 years ago

Similar Papers

Cite this paper

@article{cole2024incontext,
  title  = {In-Context Learning of Linear Systems: Generalization Theory and Applications to Operator Learning},
  author = {Frank Cole and Yulong Lu and Wuzhe Xu and Tianhao Zhang},
  year   = {2024},
  eprint = {2409.12293},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2409.12293v3}
}

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

Discussion