A GD-trained linear layer is exactly linear attention over its own training history

ShahabBakht · x · 2026-10-12

mtavitschlegel highlights a beautiful but little-known dual view: a linear layer trained with gradient descent computes exactly the same function as its initial weights plus linear attention over its own training history — each test input attends to every training input (as keys) and recombines the backpropagated errors stored with them (as values).

The connection has been discovered and revisited before but remains poorly known. Taking it seriously and replacing the linear attention with more powerful kernels (e.g., softmax attention — nontrivial in practice) leads to a new paradigm. The attached slide, from Google's "Paradigms of Intelligence" talk on Retrieval centric deep learning in growing nonparametric networks, lays out the linearization-to-nonlinearization derivation and the shift from W·x to attention(K, V, x).

Related event: Gradient-Trained Linear Layers Are Equivalent to Linear Attention(2 posts)→

Original post →

More from Models

Models channel →