stat.MLSep 6, 2026

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

Authors: Julie Huang, Maggie Chlon, Leon Chlon

Organizations: Hassana Labs · Department of Information Engineering, Oxford University

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ΔM_i satisfying yi=μi+ui⊤ΔMiy_i = μ_i + u_i^\top ΔM_i, where μiμ_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ρ= φ_1 to retain the 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.

Figures & tables

Explore similar work

CardsList
  1. Exact Finite Attention Responses From RoPE Derivatives

    Sep 12, 2026Julie Huang, Maggie Chlon, Gregory Gutin +1Causal Interventions in Language ModelsSoftmax Attention

  2. WavePrune: One period is often enough for RoPE

    Oct 3, 2026Guancheng Du, Luotian Huang, Shaowen Wang +2Rotary Positional EmbeddingsPositional Encoding

  3. LeRoPE: Learnable RoPE Frequencies Improve Language Modeling

    Jul 11, 2026Petros Karypis, Sean O'Brien, Shreyas Kadekodi +2Language Model PretrainingRotary Positional Embeddings