mlsanityData to 14 Oct 2026

Gradient Dynamics of Attention: How Cross-Entropy Sculpts Bayesian Manifolds

arXiv 2512.22473 ↗First posted 27 Dec 2025stat.ML cs.AI cs.LGcited by 6

Not on the map. Why?

Abstract (arXiv)

Transformers empirically perform precise probabilistic reasoning in carefully constructed ``Bayesian wind tunnels'' and in large-scale language models, yet the mechanisms by which gradient-based learning creates the required internal geometry remain opaque. We provide a complete first-order analysis of how cross-entropy training reshapes attention scores and value vectors in a transformer attention head. Our core result is an advantage-based routing law for attention scores, [ fracpartial Lpartial sij = αijbigl(bij-mathbbEαi[b]bigr), qquad bij := ui^top vj, ] coupled with a responsibility-weighted update for values, [ Delta vj = -ηsumi αij ui, ] where ui is the upstream gradient at position i and αij are attention weights. These equations induce a positive feedback loop in which routing and content specialize together: queries route more strongly to values that are above-average for their error signal, and those values are pulled toward the queries that use them. We show that this coupled specialization behaves like a two-timescale EM procedure: attention weights implement an E-step (soft responsibilities), while values implement an M-step (responsibility-weighted prototype updates), with queries and keys adjusting the hypothesis frame. Through controlled simulations, including a sticky Markov-chain task where we compare a closed-form EM-style update to standard SGD, we demonstrate that the same gradient dynamics that minimize cross-entropy also sculpt the low-dimensional manifolds identified in our companion work as implementing Bayesian inference. This yields a unified picture in which optimization (gradient flow) gives rise to geometry (Bayesian manifolds), which in turn supports function (in-context probabilistic reasoning).

Key facts. Cited by 6 papers in the map (data through 14 Oct 2026). Builds on 3 of its 18 references that are in the map. First posted on arXiv 27 Dec 2025.

Builds on

3 of 18 references.

References · 3

  1. 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 938
  2. 2017The Implicit Bias of Gradient Descent on Separable Datacited by 655
  3. 2022High-dimensional Asymptotics of Feature Learning: How One Gradient Step Improves the Representationcited by 150

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 1; 2026: 5.

6 papers.