cd /news/artificial-intelligence/what-if-a-transformer-never-had-to-f… Β· home β€Ί topics β€Ί artificial-intelligence β€Ί article
[ARTICLE Β· art-130613] src=dev.to β†— pub= topic=artificial-intelligence verified=true sentiment=Β· neutral

What If a Transformer Never Had to Forget? Meet the Recurrent Looped Transformer (RLT)

Princeton researcher Yifan Zhang published a technical report on September 12, 2026 proposing the Recurrent Looped Transformer (RLT), an architecture that carries the decoder's final hidden state and sliding-window attention cache into the next token instead of resetting at each position. RLT pairs a causal encoder with a recurrent decoder, giving the state path a structural depth that grows with sequence length while per-token work stays fixed at 96 logical blocks. The report explicitly notes that RLT is an architectural specification only, with no measured efficiency, reasoning quality, or scaling results reported.

by read7 min views3 publishedSep 15, 2026

You ask a language model a one-line question β€” it processes it through 48 layers. You paste a 10,000-word document β€” it still processes it through 48 layers. Same depth. Same ceiling. Every single time.

That's the structural limit of every decoder-only Transformer in production today.

A technical report published September 12, 2026 by Princeton researcher Yifan Zhang β€” Recurrent Looped Transformer (RLT) β€” proposes closing that loop. In most decoder-only LLMs, nothing computed at the last layer of token t feeds the first layer of token t+1; positions communicate only through attention over cached keys and values. RLT changes this: the decoder's final hidden state and its layerwise sliding-window attention (SWA) cache are carried into the next token, across both prompt and response, with no reset at the boundary.

⚠️ Important: RLT is an architectural specification, not a trained system. The report explicitly states that no measured efficiency, reasoning quality, or scaling results are reported.

Recurrent Looped Transformer (RLT) pairs a causal encoder with a recurrent decoder.

The encoder processes tokens in parallel under a causal mask and produces representations for each position. These representations are projected into key-value memory that the decoder can query later. Memory groups can be:

This memory is encoder-derived β€” it depends only on input tokens, not on decoder states.

The decoder holds the recurrence. Its complete state has two components:

For each token, a gated merge combines the current encoder representation with the previous decoder output. The gate controls how much previous information is carried forward. Then each decoder block runs: The next-token distribution is read from the final decoder output. Initialization happens once before the beginning-of-sequence token with a learned start state and an empty cache.

πŸ’‘ Tip: RLT separates two memory stores because they serve different roles:

Encoder memory is immutable for a fixed prefix β€” think of it as a "textbook index" of what was said Decoder SWA cache changes every step and keeps only recent activations β€” think of it as the "last 2 pages of notes" Neither can replace the other.

The reference configuration uses:

Each token executes 96 logical blocks (48 encoder + 48 decoder). Zhang calls this parameter reuse, not activation copying. Two logical passes do not imply equal per-block compute β€” the decoder block adds cross-attention that the encoder doesn't have.

After processing t tokens, the state path traverses t Γ— 48 decoder blocks in the reference configuration.

Tokens Processed Normal Transformer Depth RLT State Path Depth
1 48 48
10 48 480
100 48 4,800
1,000 48 48,000

Per-token work stays fixed at 96 blocks, while the path's structural depth grows with the sequence. "Unbounded" means no fixed architectural upper bound on the recurrent computation path β€” it does not mean infinite computation per input.

The report warns that gates and contraction may suppress long paths. Structural depth is not a reasoning guarantee β€” it's a structural possibility that requires experimental validation.

πŸ’‘ Tip β€” Snowball Analogy: The same amount of snow is added during every rotation (fixed compute per token), but the snowball grows because information accumulates. After 100 rotations, you have a massive snowball β€” without needing a bigger hill.

Encoder features use token-parallel kernels β€” they can process known tokens in parallel. Decoder transitions stay sequential within a sequence, but independent sequences can be batched together:

Sequence A: Token 1 β†’ Token 2 β†’ Token 3 β†’ Token 4

Sequence B: Token 1 β†’ Token 2 β†’ Token 3 β†’ Token 4

Sequence C: Token 1 β†’ Token 2 β†’ Token 3 β†’ Token 4

↓

BATCHED ON GPU

The report states plainly:

πŸ’‘ Tip for Practitioners: RLT's decoder is inherently sequential per sequence. Throughput optimization comes from batching independent sequences, not from parallelizing within one sequence. This is closer to RNN-style serving than standard transformer serving.

Pretraining, supervised fine-tuning (SFT), sampling, and reinforcement learning (RL) replay share one state transition.

During sampling:

During training:

The trainer computes the current policy probability and forms an importance ratio comparing it to the behavior policy probability. Proposition 3.1 formalizes the payoff: moving the prompt-response split leaves the conditional distribution unchanged for a fixed token history. This is mathematical equivalence β€” different kernels and numerical precision can still cause numerical discrepancies.

πŸ’‘ Tip for ML Engineers: If your architecture has any recurrent component, old states become stale after parameter updates. Reconstruct states from the sequence start under current parameters. Record behavior log-probabilities including all sampling transformations β€” metadata alone cannot restore missing support from truncated sampling.

Pretraining is full-sequence next-token prediction with full backpropagation through time (BPTT). Independent documents reset:

Loss is masked to assistant targets only, but state updates are never masked. Gradients from assistant losses backpropagate through user and tool tokens. The state is not reset at an assistant boundary.

πŸ’‘ Tip β€” The SFT Insight: The model learns how to "think about" the user's message, not just how to respond to it. Loss masking removes the loss term, not the computation or the gradient path.

Appendix B shows why partial detaching is risky. The state-to-state Jacobian has cross terms through the decoder key-value cache. The recurrent state has two components:

Detaching only the final decoder output leaves gradient paths through the SWA cache. Therefore, any truncated-BPTT scheme must explicitly identify every detached tensor.

πŸ’‘ Tip: Detaching the recurrent hidden state alone is NOT sufficient to cut temporal gradient dependencies. The decoder SWA cache also carries gradient information. A complete detach requires stop-gradient on both components of the recurrent state.

An exact prefix snapshot includes:

A fixed-weight snapshot can be reused because the state is independent of the serving split. Weight updates invalidate old states. Editing a prefix forces recomputation from an earlier checkpoint. External tokens in multi-turn RL update the state but get no importance-ratio factors.

Encoder-derived memory follows: RLT keeps the encoder-derived memory but drops prompt-wide decoder skipping β€” every prompt token gets its full decoder update.

Temporal feedback builds on:

RLT instead feeds the previous final decoder output into the next decoder input and runs recurrence over the prompt too.

Depth-wise reuse connects to: The RL replay argument extends Zhang's prefill-decode kernel mismatch note (2026).

Feature Standard Transformer YOCO (2024) Feedback Transformer Recurrent Transformer RLT (2026)
Per-token depth Fixed Fixed Fixed Fixed Fixed βœ…
Depth grows with sequence? ❌ ❌ ❌ ❌ βœ… Yes (t Γ— decoder depth)
Memory type KV cache (one type) Encoder KV reuse Layer feedback Layerwise KV Encoder memory (global) + SWA cache (local) + Recurrent state
Prompt-response boundary Different phases Different Different Different Same transition, no reset
RL training consistency Mismatch (stale states) Not addressed Not addressed Not addressed Exact replay under current params
Hardware co-design Generic KV reuse Not addressed Tiling schedule Explicit parallel/sequential split
Prompt-wide decoder skip? No Yes (early exit) No No No β€” full recurrence
Empirical validation βœ… Extensive βœ… Some βœ… Some βœ… Some ❌ Not yet

RLT carries the full decoder state β€” final output plus layerwise SWA cache β€” across every prompt and response token with no boundary reset

Reference configuration: 48 tied encoder + 48 tied decoder layers = 96 logical blocks per token. State path has structural depth of 48t blocks after t tokens

Hardware opportunities: Encoder parallelism and batching across sequences. No parallel scan or reduced-prefill speedup is claimed

RL replay rebuilds all states under current parameters while keeping recorded behavior log-probabilities as ratio denominators

No measured results: Reasoning quality, efficiency, and RL scaling remain open validation targets

More rounds mean more reasoning passes through the model's layer stack on accumulated context. Instead of one massive prompt, build context iteratively through back-and-forth conversation.

When AI contradicts earlier context or forgets constraints, don't just rephrase. Instead:

If building RL training pipelines, check: Reconstruct states from the sequence start under current parameters β€” never reuse old states after parameter updates.

Check out the Technical Report, GitHub repository, and Project Page. All credit goes to the researcher of this project.

── more in #artificial-intelligence 4 stories Β· sorted by recency
── more on @yifan zhang 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/what-if-a-transforme…] indexed:0 read:7min 2026-09-15 Β· β€”