Computer Science > Machine Learning
[Submitted on 11 Dec 2023 (v1), revised 26 Dec 2023 (this version, v3), latest version 4 Jun 2024 (v6)]
Title:Transformers Implement Functional Gradient Descent to Learn Non-Linear Functions In Context
View PDFAbstract:Many neural network architectures have been shown to be Turing Complete, and can thus implement arbitrary algorithms. However, Transformers are unique in that they can implement gradient-based learning algorithms \emph{under simple parameter configurations}. A line of recent work shows that linear Transformers naturally learn to implement gradient descent (GD) when trained on a linear regression in-context learning task. But the linearity assumption (either in the Transformer architecture or in the learning task) is far from realistic settings where non-linear activations crucially enable Transformers to learn complicated non-linear functions. In this paper, we provide theoretical and empirical evidence that non-linear Transformers can, and \emph{in fact do}, learn to implement learning algorithms 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. Interestingly, we show that the optimal choice of non-linear activation depends in a natural way on the non-linearity of the learning task.
Submission history
From: Xiang Cheng [view email][v1] Mon, 11 Dec 2023 17:05:25 UTC (155 KB)
[v2] Thu, 14 Dec 2023 17:19:55 UTC (156 KB)
[v3] Tue, 26 Dec 2023 21:20:12 UTC (158 KB)
[v4] Thu, 15 Feb 2024 22:45:28 UTC (209 KB)
[v5] Fri, 19 Apr 2024 21:05:34 UTC (257 KB)
[v6] Tue, 4 Jun 2024 00:20:05 UTC (244 KB)
References & Citations
Bibliographic and Citation Tools
Bibliographic Explorer (What is the Explorer?)
Litmaps (What is Litmaps?)
scite Smart Citations (What are Smart Citations?)
Code, Data and Media Associated with this Article
CatalyzeX Code Finder for Papers (What is CatalyzeX?)
DagsHub (What is DagsHub?)
Gotit.pub (What is GotitPub?)
Papers with Code (What is Papers with Code?)
ScienceCast (What is ScienceCast?)
Demos
Recommenders and Search Tools
Influence Flower (What are Influence Flowers?)
Connected Papers (What is Connected Papers?)
CORE Recommender (What is CORE?)
IArxiv Recommender
(What is IArxiv?)
arXivLabs: experimental projects with community collaborators
arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.
Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.
Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.