When can in-context learning generalize out of task distribution?
Chase Goddard, Lindsay M. Smith, Vudtiwat Ngampruetikorn, David J. Schwab

TL;DR
This paper empirically investigates the conditions under which in-context learning (ICL) in transformers generalizes out-of-distribution, focusing on task diversity, model depth, and problem dimensionality, revealing a phase transition in generalization capabilities.
Contribution
It introduces a new notion of task diversity and demonstrates its role in enabling transformers to transition from in-distribution to out-of-distribution generalization in ICL.
Findings
Increased task diversity leads to a phase transition in ICL capabilities.
Transformers can generalize out-of-distribution after a critical level of task diversity.
Model depth and problem dimensionality influence the transition point.
Abstract
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 the pretraining distribution for ICL to emerge and generalize \emph{out-of-distribution}. Previous work has focused on the number of distinct tasks necessary in the pretraining dataset. Here, we use a different notion of task diversity to study the emergence of ICL in transformers trained on linear functions. We find that as task diversity increases, transformers undergo a transition from a specialized solution, which exhibits ICL only within the pretraining task distribution, to a solution which generalizes out of distribution to the entire task space. We also investigate the nature of the solutions learned by the transformer on both sides of the transition, and observe…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
Taxonomy
TopicsDomain Adaptation and Few-Shot Learning · Generative Adversarial Networks and Image Synthesis · Stochastic Gradient Optimization Techniques
