In-context learning lets a sequence model adapt to a new task purely from examples in its input, without changing its weights. A prominent line of work has shown that self-attention can be constructed to implement gradient descent on a linear predictor fit to those examples. A new preprint extends this idea to a different family of architectures: linear recurrent networks.

The authors show that a linear recurrent network, when given a sequence of input–output pairs, can be designed to perform the same kind of gradient-descent update on a linear predictor. This means recurrent networks, which process inputs sequentially rather than through pairwise attention, are also capable of this form of in-context learning. The construction is explicit and mirrors the attention-based result, suggesting that the mechanism is not unique to attention.

The paper does not compare recurrent networks with attention empirically, but the theoretical result is significant. It points toward a unifying view: perhaps many sequence models achieve in-context learning through an implicit gradient-descent-like computation. If so, this could inform how we design and interpret both attention-based and recurrent architectures for few-shot adaptation.