aiqbench analysis
This paper introduces GRIL, a diagonal linear recurrent network architecture that successfully implements in-context learning via gradient-descent-like updates, bridging the gap between state-space models and self-attention mechanisms. By factorizing supervised gradient steps into specific write and readout operations, the model achieves linear time complexity while recovering analytically predicted behaviors on both synthetic tasks and general benchmarks like Long Range Arena. The work establishes windowed cross-product self-attention as a viable inductive bias for efficient sequence modeling without relying on quadratic attention mechanisms.
Learning in the Recurrent State: Gradient Descent with Linear Recurrent Networks
arXiv:2410.11687v4 Announce Type: replace Abstract: In-context learning lets a sequence model adapt to a new task from examples in its input. A prominent line of work shows how self-attention can be constructed to implement gradient descent on a linear predictor fit to the in-context examples during the forward pass. State-space models (SSMs) and other linear recurrent networks (LRNNs) model sequences at linear time cost, but it is unclear how their recurrent update could carry out the same in-context gradient descent. We introduce Gradient-based Recurrent In-context Learner (GRIL), a diagonal LRNN that factorizes a supervised gradient step into a short-window cross-product write and a multiplicative readout of the next query. For linear regression, this construction accumulates the context gradient in a matrix state and applies it in a single forward pass, with $O(f^2)$ learned degrees of freedom. The same design extends to multi-step updates and cross-entropy classification, with a limited MLP-based extension to non-linear regression. We show empirically that trained GRILs recover the behavior and parameters analytically predicted by the construction on synthetic ICL tasks. Furthermore, the same architecture can be extended and trained on general-purpose benchmarks, including Long Range Arena, language modeling and associative recall. Together, these results establish windowed cross-product self-attention as a concrete inductive bias that lets LRNNs learn in context through gradient-descent-like updates, while remaining trainable on general-purpose tasks.
Abstract:In-context learning lets a sequence model adapt to a new task from examples in its input. A prominent line of work shows how self-attention can be constructed to implement gradient descent on a linear predictor fit to the in-context examples during the forward pass. State-space models (SSMs) and other linear recurrent networks (LRNNs) model sequences at linear time cost, but it is unclear how their recurrent update could carry out the same in-context gradient descent. We introduce Gradient-based Recurrent In-context Learner (GRIL), a diagonal LRNN that factorizes a supervised gradient step into a short-window cross-product write and a multiplicative readout of the next query. For linear regression, this construction accumulates the context gradient in a matrix state and applies it in a single forward pass, with $O(f^2)$ learned degrees of freedom. The same design extends to multi-step updates and cross-entropy classification, with a limited MLP-based extension to non-linear regression. We show empirically that trained GRILs recover the behavior and parameters analytically predicted by the construction on synthetic ICL tasks. Furthermore, the same architecture can be extended and trained on general-purpose benchmarks, including Long Range Arena, language modeling and associative recall. Together, these results establish windowed cross-product self-attention as a concrete inductive bias that lets LRNNs learn in context through gradient-descent-like updates, while remaining trainable on general-purpose tasks.
Machine Learning (cs.LG); Artificial Intelligence (cs.AI); Neural and Evolutionary Computing (cs.NE)
arXiv:2410.11687 [cs.LG]
(or arXiv:2410.11687v4 [cs.LG] for this version)
https://doi.org/10.48550/arXiv.2410.11687 Focus to learn more arXiv-issued DOI via DataCite
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.
Full text under the publisher's open licence · 317 words
Related coverage
Learning in the Recurrent State: Gradient Descent with Linear Recurrent Networks
arXiv · Jun 16, 2026
Pre-Training Hybrid LLMs from Scratch in Primus on AMD Instinct™ GPUs
AMD · Oct 8, 2026
Gradient descent dynamics for deep equilibrium models
arXiv · Oct 6, 2026
Improving the Performance and Learning Stability of Parallelizable RNNs Designed for Ultra-Low Power Applications
arXiv · Jun 9, 2026