Transformers as Algorithms: Generalization and Stability in In-context Learning. Li, Y., Ildiz, M. E., Papailiopoulos, D., & Oymak, S. In Proceedings of the 40th International Conference on Machine Learning, pages 19565–19594. PMLR.
Transformers as Algorithms: Generalization and Stability in In-context Learning [link]Paper  abstract   bibtex   
In-context learning (ICL) is a type of prompting where a transformer model operates on a sequence of (input, output) examples and performs inference on-the-fly. In this work, we formalize in-context learning as an algorithm learning problem where a transformer model implicitly constructs a hypothesis function at inference-time. We first explore the statistical aspects of this abstraction through the lens of multitask learning: We obtain generalization bounds for ICL when the input prompt is (1) a sequence of i.i.d. (input, label) pairs or (2) a trajectory arising from a dynamical system. The crux of our analysis is relating the excess risk to the stability of the algorithm implemented by the transformer. We characterize when transformer/attention architecture provably obeys the stability condition and also provide empirical verification. For generalization on unseen tasks, we identify an inductive bias phenomenon in which the transfer learning risk is governed by the task complexity and the number of MTL tasks in a highly predictable manner. Finally, we provide numerical evaluations that (1) demonstrate transformers can indeed implement near-optimal algorithms on classical regression problems with i.i.d. and dynamic data, (2) provide insights on stability, and (3) verify our theoretical predictions.
@inproceedings{li-arxiv23b,
	title = {Transformers as Algorithms: Generalization and Stability in In-context Learning},
	url = {https://proceedings.mlr.press/v202/li23l.html},
	shorttitle = {Transformers as Algorithms},
	abstract = {In-context learning ({ICL}) is a type of prompting where a transformer model operates on a sequence of (input, output) examples and performs inference on-the-fly. In this work, we formalize in-context learning as an algorithm learning problem where a transformer model implicitly constructs a hypothesis function at inference-time. We first explore the statistical aspects of this abstraction through the lens of multitask learning: We obtain generalization bounds for {ICL} when the input prompt is (1) a sequence of i.i.d. (input, label) pairs or (2) a trajectory arising from a dynamical system. The crux of our analysis is relating the excess risk to the stability of the algorithm implemented by the transformer. We characterize when transformer/attention architecture provably obeys the stability condition and also provide empirical verification. For generalization on unseen tasks, we identify an inductive bias phenomenon in which the transfer learning risk is governed by the task complexity and the number of {MTL} tasks in a highly predictable manner. Finally, we provide numerical evaluations that (1) demonstrate transformers can indeed implement near-optimal algorithms on classical regression problems with i.i.d. and dynamic data, (2) provide insights on stability, and (3) verify our theoretical predictions.},
	eventtitle = {International Conference on Machine Learning},
	pages = {19565--19594},
	booktitle = {Proceedings of the 40th International Conference on Machine Learning},
	publisher = {{PMLR}},
	author = {Li, Yingcong and Ildiz, Muhammed Emrullah and Papailiopoulos, Dimitris and Oymak, Samet},
	urldate = {2024-08-30},
	date = {2023-07-03},
	langid = {english},
	file = {Full Text PDF:/Users/ukreddy/Zotero/storage/RSMM83CF/Li et al. - 2023 - Transformers as Algorithms Generalization and Sta.pdf:application/pdf},
}

Downloads: 0