Transformers Implement Functional Gradient Descent to Learn Non-Linear Functions In Context

Xiang Cheng, Yuxin Chen, Suvrit Sra
Proceedings of the 41st International Conference on Machine Learning, PMLR 235:8002-8037, 2024.

Abstract

Many neural network architectures are known to be Turing Complete, and can thus, in principle implement arbitrary algorithms. However, Transformers are unique in that they can implement gradient-based learning algorithms under simple parameter configurations. This paper provides theoretical and empirical evidence that (non-linear) Transformers naturally learn to implement gradient descent in function space, which in turn enable them to learn non-linear functions in context. Our results apply to a broad class of combinations of non-linear architectures and non-linear in-context learning tasks. Additionally, we show that the optimal choice of non-linear activation depends in a natural way on the class of functions that need to be learned.

Cite this Paper


BibTeX
@InProceedings{pmlr-v235-cheng24a, title = {Transformers Implement Functional Gradient Descent to Learn Non-Linear Functions In Context}, author = {Cheng, Xiang and Chen, Yuxin and Sra, Suvrit}, booktitle = {Proceedings of the 41st International Conference on Machine Learning}, pages = {8002--8037}, year = {2024}, editor = {Salakhutdinov, Ruslan and Kolter, Zico and Heller, Katherine and Weller, Adrian and Oliver, Nuria and Scarlett, Jonathan and Berkenkamp, Felix}, volume = {235}, series = {Proceedings of Machine Learning Research}, month = {21--27 Jul}, publisher = {PMLR}, pdf = {https://raw.githubusercontent.com/mlresearch/v235/main/assets/cheng24a/cheng24a.pdf}, url = {https://proceedings.mlr.press/v235/cheng24a.html}, abstract = {Many neural network architectures are known to be Turing Complete, and can thus, in principle implement arbitrary algorithms. However, Transformers are unique in that they can implement gradient-based learning algorithms under simple parameter configurations. This paper provides theoretical and empirical evidence that (non-linear) Transformers naturally learn to implement gradient descent in function space, which in turn enable them to learn non-linear functions in context. Our results apply to a broad class of combinations of non-linear architectures and non-linear in-context learning tasks. Additionally, we show that the optimal choice of non-linear activation depends in a natural way on the class of functions that need to be learned.} }
Endnote
%0 Conference Paper %T Transformers Implement Functional Gradient Descent to Learn Non-Linear Functions In Context %A Xiang Cheng %A Yuxin Chen %A Suvrit Sra %B Proceedings of the 41st International Conference on Machine Learning %C Proceedings of Machine Learning Research %D 2024 %E Ruslan Salakhutdinov %E Zico Kolter %E Katherine Heller %E Adrian Weller %E Nuria Oliver %E Jonathan Scarlett %E Felix Berkenkamp %F pmlr-v235-cheng24a %I PMLR %P 8002--8037 %U https://proceedings.mlr.press/v235/cheng24a.html %V 235 %X Many neural network architectures are known to be Turing Complete, and can thus, in principle implement arbitrary algorithms. However, Transformers are unique in that they can implement gradient-based learning algorithms under simple parameter configurations. This paper provides theoretical and empirical evidence that (non-linear) Transformers naturally learn to implement gradient descent in function space, which in turn enable them to learn non-linear functions in context. Our results apply to a broad class of combinations of non-linear architectures and non-linear in-context learning tasks. Additionally, we show that the optimal choice of non-linear activation depends in a natural way on the class of functions that need to be learned.
APA
Cheng, X., Chen, Y. & Sra, S.. (2024). Transformers Implement Functional Gradient Descent to Learn Non-Linear Functions In Context. Proceedings of the 41st International Conference on Machine Learning, in Proceedings of Machine Learning Research 235:8002-8037 Available from https://proceedings.mlr.press/v235/cheng24a.html.

Related Material