Manuscript Offprint

arXiv:2609.06685

RoPE attention is an exact forward-pass gradient step with softmax intact

Julie Huang, Maggie Chlon, Leon Chlon

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

We derive an exact gradient-step representation of the RoPE-softmax forward pass. For every deterministic RoPE-softmax attention head with arbitrary affine projection weights, we construct a query-dependent effective matrix ΔMi\Delta M_i satisfying yi=μi+ui⊤ΔMiy_i = \mu_i + u_i^\top \Delta M_i, where μi\mu_i is the uniform mean of the attended values and uiu_i is the augmented query input. The construction applies the classical exponential divided difference ρ=φ1\rho = \varphi_1 to retain softmax exactly. Its positive coefficients give a unit gradient-step representation on a query-conditioned quadratic objective. The same function connects the RoPE generator to exact positional finite differences. We derive a tokenwise formula for the error of reusing one query's matrix and prove that a nonconstant finite-cache head cannot admit a globally exact affine query readout. Reconstruction checks and frozen-reuse calibration on one pretrained Qwen2.5-0.5B layer verify the representation and quantify the correction required when one query's matrix is reused.

1 Contribution and relation to existing constructions

We apply the exponential divided difference to express full RoPE-softmax attention in the original projection-weight coordinates, including biases. This yields an exact query-conditioned matrix, its per-token decomposition, and the corresponding quadratic gradient-step representation. A boundedness proposition characterises the obstruction to a globally shared affine readout; a matrix-function identity connects the same construction to positional derivatives and finite differences.

The construction uses the classical φ1\varphi_1 function from exponential integrators [1] to factorise the softmax readout. Softmax attention is a Nadaraya-Watson-type normalised kernel average [2, 3]: with κij=exp⁡(sij)\kappa_{ij} = \exp(s_{ij}), its output is ∑jκijvj/∑jκij\sum_j \kappa_{ij} v_j / \sum_j \kappa_{ij}. RoPE enters sijs_{ij} through the relative rotation inside the exponential.

Von Oswald et al. [4] construct a least-squares gradient step using linear self-attention. Schlag et al. [5] develop the fast-weight view of linear attention, and Dai et al. [6] use a linearised attention expression to obtain an implicit weight update. Here the coefficients retain the exponential and its normalisation for arbitrary projection weights. Modern Hopfield networks give an exact softmax-attention correspondence [7]; the object derived here is a query-conditioned effective matrix in input coordinates, together with its score-shift family and exact reuse residual.