Recurrent Looped Transformer
Yifan Zhang, Jichen Feng, Shihan Qin, Sun-Yuan Kung, Mengdi Wang
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 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 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 from 100% to 20%.
Create a lesson
Metadata
- Categories
- cs.CL, cs.AI, cs.LG
- Comments
- Project Page: https://github.com/yifanzhang-pro/recurrent-looped-tranformer
Related papers
Learning from Recurrence: Internalizing Depth-Induced Preferences in Looped Language Models
Shared title terminologycs.CLHui Chen, Joshua Elsdon, Can Goksen
Stable Gated DeltaNet-2: Understanding and Mitigating Recurrent State Instability
Shared title terminologycs.CLXichong Zhang, Xixuan Hao, Zhichen Liu et al.
Implementation of Machine Translation for the Uzbek Language Based on Transformer Models
Shared title terminologycs.CLMukhammadjon Musaev, Mannon Ochilov
Unlocking the Power of Loops in Pretrained LLMs with Loop Residuals
Shared title terminologycs.CLXuanlei Zhao, Hailun Xu, Kai Wang et al.
SARA: An Auditor-in-the-Loop LLM Recommender for Sustainability Reports
Shared title terminologycs.CLLars Hillebrand, Thiago B. F. de Oliveira, Tim Dilmaghani et al.
Learning the Loop, Not Just the Page: Execution-Grounded Loop Learning for Web Generation
Shared title terminologycs.CLYuxin Meng, Ruixu Zhang, Junjie Wang et al.