arXiv(opens in a new tab)cs.CLOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.07591

Recurrent Looped Transformer

Yifan Zhang, Jichen Feng, Shihan Qin

Abstract

State tracking requires an update at every input, but the depth a Transformer applies to each token is fixed regardless of sequence length. We introduce the Recurrent Looped Transformer (RLT), which splits its layers between a parallel causal encoder and a recurrent decoder. At each token, the decoder merges the encoder output with the previous token's final decoder state, so the computation path grows with sequence length at a fixed per-token cost. On six algorithmic tasks, we compare five splits of eight layers with an eight-layer Transformer over three seeds. Trained on at most 40 bits, two RLT splits generalize parity to 256 bits with 100% accuracy in every seed, while the Transformer stays at chance. On swap-based S5S_{5} permutation tracking at eight times the training length, RLT reaches 97% final-state accuracy versus under 1% for the Transformer, and accuracy increases with decoder depth. On modular arithmetic beyond the training lengths, RLT reaches up to 93% versus 33% for the Transformer. Ablations show that these gains depend on the feedback: removing it drops parity and swap-based S5S_{5} to chance at every split. Updating the feedback once per four-token chunk lets known tokens in a chunk run in parallel and keeps 64-bit parity at 99%, while permutation tracking depends on per-token feedback: chunking lowers length-64 swap-based S5S_{5} from 100% to 20%.

Project Page: https://github.com/yifanzhang-pro/recurrent-looped-transformer

Causal encoder

Parallel causal encoding of observed tokens

Figure

Recurrent decoder

Prompt and response use the same transition

Read encoder KV up to the current token

Merge uses s; SWA uses layerwise cached KV.

Figure 1 Recurrence across prompt and response. The encoder builds causal key-value (KV) memory; the decoder processes tokens in order. Orange arrows carry the decoder state Ht=(st,CtD)H_t = (s_t, C_t^D): the merge reads sts_t, and each SWA layer reads its own cache. Blue arrows supply encoder memory up to the current position. The drawing shows the last two prompt updates and the first response update.

∗^{*}Revised: October 5, 2026

Causal encoder

Causal prefix x1:tx_{1:t}

Causal masking allows parallel encoder prefill across positions.

Figure

References (18)