Saved in:
Bibliographic Details
Main Authors: Dragutinović, Sara, Saxe, Andrew M., Singh, Aaditya K.
Format: Preprint
Published: 2025
Subjects:
Online Access:https://arxiv.org/abs/2510.10425
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866914089462136832
author Dragutinović, Sara
Saxe, Andrew M.
Singh, Aaditya K.
author_facet Dragutinović, Sara
Saxe, Andrew M.
Singh, Aaditya K.
contents The remarkable ability of transformers to learn new concepts solely by reading examples within the input prompt, termed in-context learning (ICL), is a crucial aspect of intelligent behavior. Here, we focus on understanding the learning algorithm transformers use to learn from context. Existing theoretical work, often based on simplifying assumptions, has primarily focused on linear self-attention and continuous regression tasks, finding transformers can learn in-context by gradient descent. Given that transformers are typically trained on discrete and complex tasks, we bridge the gap from this existing work to the setting of classification, with non-linear (importantly, softmax) activation. We find that transformers still learn to do gradient descent in-context, though on functionals in the kernel feature space and with a context-adaptive learning rate in the case of softmax transformer. These theoretical findings suggest a greater adaptability to context for softmax attention, which we empirically verify and study through ablations. Overall, we hope this enhances theoretical understanding of in-context learning algorithms in more realistic settings, pushes forward our intuitions and enables further theory bridging to larger models.
format Preprint
id arxiv_https___arxiv_org_abs_2510_10425
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Softmax $\geq$ Linear: Transformers may learn to classify in-context by kernel gradient descent
Dragutinović, Sara
Saxe, Andrew M.
Singh, Aaditya K.
Machine Learning
The remarkable ability of transformers to learn new concepts solely by reading examples within the input prompt, termed in-context learning (ICL), is a crucial aspect of intelligent behavior. Here, we focus on understanding the learning algorithm transformers use to learn from context. Existing theoretical work, often based on simplifying assumptions, has primarily focused on linear self-attention and continuous regression tasks, finding transformers can learn in-context by gradient descent. Given that transformers are typically trained on discrete and complex tasks, we bridge the gap from this existing work to the setting of classification, with non-linear (importantly, softmax) activation. We find that transformers still learn to do gradient descent in-context, though on functionals in the kernel feature space and with a context-adaptive learning rate in the case of softmax transformer. These theoretical findings suggest a greater adaptability to context for softmax attention, which we empirically verify and study through ablations. Overall, we hope this enhances theoretical understanding of in-context learning algorithms in more realistic settings, pushes forward our intuitions and enables further theory bridging to larger models.
title Softmax $\geq$ Linear: Transformers may learn to classify in-context by kernel gradient descent
topic Machine Learning
url https://arxiv.org/abs/2510.10425