Closing the Loop with
Fixed-Point Self-Attention
Standard Transformers compute attention once and move on. FPSA turns each attention layer into a self-refining equilibrium—giving hard tokens room to think, with zero added parameters.
Attention depends on representations — and vice versa
In a standard Transformer layer, queries examine keys, pull values once, and immediately hand off to the next layer. Every token gets the exact same single pass, whether it is trivial punctuation or an ambiguous pronoun.
Fixed-Point Self-Attention (FPSA) closes this loop inside a single attention module. The value vectors V = X WV are computed once from the layer input and held fixed. Meanwhile, Qt and Kt are repeatedly recomputed from the evolving state Zt until the representation settles into an equilibrium Z* = f(Z*).
Press Play Loop or Step +1 to watch Qt, Kt re-query the locked V until the state stops changing.
Math Formal fixed-point update equation
Given layer input X, FPSA precomputes the value matrix once, V = X WV, initializes Z0 = X, and iterates the attention operator:
With optional damping α ∈ (0, 1], the iterate updates as Zt+1 = (1 − α)Zt + α · f(Zt; X) (alongside residual/norm stabilization) until the per-token relative change ‖Zt+1 − Zt‖ / ‖Zt‖ falls below tolerance ε.
Watch easy tokens freeze while hard tokens keep thinking
Because convergence is measured per token, FPSA produces adaptive computation depth without any learned halting network.
Below is a live Fixed-Point Self-Attention dynamical system running directly in your browser. Pick a sentence, scrub the iteration slider, and click any token to see how its attention sharpens from an uncertain first pass into a clean fixed point.
Why hold Values fixed — and when does the loop settle?
Iterating an arbitrary attention block can fail in two ways: representations either collapse to a single average vector, or bounce around forever without converging.
FPSA avoids both traps through two clean geometric choices: holding V anchored to the input preserves token identity and prevents rank collapse, while keeping the local map contractive (spectral radius ρ < 1, aided by damping) guarantees convergence to a unique equilibrium.
Every starting state Z₀ spirals smoothly into the same unique fixed point Z* anchored by V.
Theory Banach fixed-point theorem & damping
If the attention update map f is a contraction with Lipschitz constant Lf < 1, Banach's theorem guarantees a unique equilibrium Z* = f(Z*) and geometric convergence ‖Zt − Z*‖ ≤ Lft ‖Z0 − Z*‖ from any initialization.
When raw attention updates oscillate, damped iteration Zt+1 = (1 − α)Zt + α f(Zt) averages the current state with the new proposal, shrinking oscillation modes without changing the fixed point itself (since Z* = f(Z*) still satisfies Z* = (1 − α)Z* + α f(Z*)).
Backpropagating through a loop in constant O(1) memory
Normally, iterating a layer T times means storing T copies of intermediate activations for backpropagation — exploding GPU memory.
Because FPSA solves for an equilibrium Z* = f(Z*), it can bypass unrolling entirely. Using the Implicit Function Theorem, gradients are computed directly at the converged state Z* regardless of how many forward iterations it took to get there.
Must keep every intermediate state Z₁ … Z_T in VRAM to trace gradients backward through time.
Runs the forward loop under no_grad(), then computes gradients analytically at the equilibrium Z*.
Code Drop-in PyTorch diff: Standard MHA → FPSA (~15 lines)
FPSA reuses the exact same W_Q, W_K, W_V, W_O weights — zero new parameters, localized to the attention module:
def forward(self, x, mask=None):
# 1. Compute V once from input and hold fixed
v = split_heads(self.W_V(x))
# 2. Iterate Q, K from evolving state z under no_grad
z = x
with torch.no_grad():
for _ in range(self.max_iter):
z_next = self._attn_step(z, v, mask)
if rel_residual(z_next, z) < self.tol:
break
z = (1 - self.alpha) * z + self.alpha * z_next
# 3. Attach O(1) implicit gradient at equilibrium z*
z_star = self._attn_step(z.detach(), v, mask)
return adjoint_or_phantom_grad(z_star, z, v, mask)
Math Implicit Function Theorem gradient formula
Differentiating both sides of the equilibrium equation Z* = fθ(Z*, X) with respect to parameters θ yields:
No intermediate states Z1, …, ZT−1 appear in this expression. The inverse Jacobian-vector product can be approximated with a 1-step phantom gradient or refined via a short Neumann / adjoint solve in constant memory.
One primitive, consistent gains across modalities
Rather than overwhelming you with wall-to-wall tables, explore the paper's key empirical findings one domain at a time.
Over scale-matched reproduced encoder baselines, using the exact same parameter count.
Question answering benefits strongly from iterative query-key disambiguation over passage context.
Why encoders shine here: Tasks like natural language inference, linguistic acceptability, and extractive QA frequently require resolving subtle cross-sentence dependencies where a single attention pass under-commits.
Consistent gains across Vision & Vision-Language
Plugging FPSA directly into Vision Transformers (e.g., ViT-B/16) and multimodal vision-language architectures delivers consistent accuracy improvements with zero added parameters.
Just like text tokens, uniform background patches stabilize in 2–3 steps while complex object boundaries and cross-modal alignments naturally spend more iterations refining.
Evaluated under matched LoRA fine-tuning — no full pretraining required to unlock iterative intra-layer refinement.
Allows pretrained autoregressive models to spend extra refinement cycles inside attention on harder reasoning steps.
Practical takeaway: Because FPSA keeps the exact W_Q, W_K, W_V, W_O parameter layout, existing pretrained weights transfer cleanly into the closed-loop regime via lightweight LoRA adaptation.
Compared to repeating entire Transformer blocks (which duplicates FFN, LayerNorm, and residual overhead), FPSA iterates only the attention sub-layer. At a median of 3–6 steps per layer relative to a scale-matched BERT-Base baseline:
Cite this paper
@inproceedings{mathur2026closing,
title = {Closing the Loop with Fixed-Point Self-Attention},
author = {Mathur, Mrinal and Pearlmutter, Barak A. and Plis, Sergey},
booktitle = {Advances in Neural Information Processing Systems (NeurIPS)},
year = {2026},
eprint = {2611.40535},
archivePrefix = {arXiv}
}