NTH

StateLoop: Persistent State for Looped Transformers

AuthorsFeichen Song, Boyi Zeng, He Li, Shixiang Song, Yiqin Hao, Zitong Wang, Yizhou Yang, Yifan Liu, Ziwei He, Zhouhan Lin

AffiliationsShanghai Jiao Tong University · Sun Yat-sen University · Shanghai Innovation Institute

November 5, 2026 2 min read
Watch on YouTube
The one-line take

StateLoop gives repeatedly applied Transformers a persistent memory to carry useful information across computation loops.

Key results

0.18
Pile perplexity reduction

At 1.4B parameters, StateLoop improves on Vanilla Looped.

0.97%
Zero-shot Avg-8 accuracy gain

Percentage-point gain over Vanilla Looped across eight tasks.

1.43%
Attention-mixer Avg-8 gain

Percentage-point gain over Vanilla Looped in zero-shot evaluation.

1.44%
Mamba-2-mixer Avg-8 gain

Percentage-point gain over Vanilla Looped in zero-shot evaluation.

0.30
Loop-depth Pile perplexity gap

StateLoop advantage over Vanilla Looped at 7 iterations, up from 0.14 at 3.

18.86%
Latency reduction versus extra iteration

StateLoop uses less decoding latency than Vanilla Looped with 5 iterations.

What the paper found

StateLoop adds one persistent state per token to a looped Transformer, preserving information across repeated applications of a shared backbone. A learned selective state-space update gates retention of the previous state against new backbone output; the resulting state is projected back into the direct recurrent stream and used in the final prediction. Optional causal-attention and Mamba-2 mixers let states exchange information across tokens. In models trained on the Pile with a LLaMA-style backbone and GPT-NeoX tokenizer, the 1.4B-parameter StateLoop reduces Pile perplexity by 0.18 and raises zero-shot accuracy averaged across eight tasks by 0.97 percentage points over Vanilla Looped. Causal-attention and Mamba-2 mixers raise that accuracy gain to 1.43 and 1.44 percentage points. The advantage also grows with loop depth: at 410M scale, the Pile perplexity gap expands from 0.14 at 3 iterations to 0.30 at 7. At decoding time, StateLoop’s state branch adds just 1.42% latency, while using 18.86% less latency than a Vanilla Looped model with one extra iteration. Ablations show that carrying state across iterations matters: resetting it worsens perplexity from 9.04 to 9.25.

Original abstract

Looped Transformers offer a parameter-efficient approach to language modeling by repeatedly applying a shared backbone. Vanilla looped Transformers use each backbone output directly as the input to the next iteration. These outputs may contain information useful several iterations later, but retaining it across the loop depends entirely on the single hidden state. We introduce StateLoop, which maintains one additional persistent state per token to retain information across iterations. At each iteration, a learned gate controls how much of the previous state is retained and how much information from the backbone output is incorporated. The updated state is projected back and added to the backbone output for subsequent iterations and final prediction. This design reduces Pile perplexity and improves average accuracy across eight zero-shot tasks over Vanilla Looped. Its perplexity advantage over Vanilla Looped grows with trained loop depth, consistent with persistent state becoming increasingly useful as recurrent computation deepens.

Read the original paper

More in Transformers

Browse all 51 papers →