Recurrent Transformer: Trading Architectural Depth for Temporal Intelligence

The Recurrent Transformer: Greater Effective Depth and Efficient Decoding

2026-04-01
Costin-Andrei Oncescu, Depen Morwani, Samy Jelassi, Alexandru Meterez, Mujin Kwun, Sham Kakade
Summary
Problem
Method
Results
Takeaways
Abstract

The paper introduces the Recurrent Transformer (RT), a novel architecture that achieves layerwise recurrence by computing persistent Key-Value (KV) pairs from a layer's output rather than its input. This design allows for greater effective temporal depth and superior parameter efficiency compared to standard Transformers.

TL;DR

The Recurrent Transformer (RT) reinvents the relationship between depth and time. By deriving Key-Value pairs from the output of a layer instead of the input, it allows a single layer to perform multiple "hops" of reasoning. Empirically, it enables a 6-layer model to outperform a 12-layer standard Transformer, effectively shrinking the KV cache by 30% and boosting inference efficiency without sacrificing representational power.

The "Shallow" Reality of Modern Transformers

Despite their dominance, Transformers are structurally shallow in the temporal dimension. At any position , a layer attends to keys and values generated by the previous layer. This means information can only undergo transformations (where is the number of layers) as it moves across positions.

While RNNs and State-Space Models (SSMs) offer infinite temporal depth, they often sacrifice the "global lookback" that makes Attention so robust, or they struggle with training stability. The Recurrent Transformer aims to provide the best of both worlds: the unbounded expressive potential of recurrence and the stable, parallelizable nature of Attention.

Methodology: The Persistent vs. Temporary Split

The core innovation is deceptively simple: Where do the KV pairs come from?

  • Standard Transformer: KV pairs at position are computed from input .
  • Recurrent Transformer: "Persistent" KV pairs at position are computed from the layer's output .

This creates a "circularity" problem—you can't attend to your own output before you've computed it. The authors solve this by introducing Temporary KV pairs (). At position , the model uses temporary KVs to compute the current attention output, then uses the resulting output to generate the persistent KVs that future tokens () will see.

Recurrent Transformer Architecture Figure 1: The layer-wise recurrence mechanism where output fuels the memory for future tokens.

Breaking the Sequential Bottleneck: Exact Tiling

A naive implementation of this recurrence would be strictly sequential, destroying training performance. However, the authors observed that within a layer, all queries () are available upfront.

By leveraging an IO-aware tiling algorithm (inspired by Flash Inference), they reorganize the computation. Instead of waiting for one token to finish before starting the next, they use available KV pairs to "eagerly" update a range of future query accumulators. This reduces High-Bandwidth Memory (HBM) traffic from to , making the model practically trainable.

Experimental Performance: Doing More with Less

The most striking result is the Depth-Width Tradeoff. Because RT layers are "smarter" (possessing more effective temporal depth), you need fewer of them.

300M Parameter C4 Pretraining

ModelLayersWidthVal CE ↓
Transformer1214082.896
Transformer620482.917
Recurrent Transformer620482.860

As shown in the table above, a 6-layer RT significantly beats even a 12-layer standard Transformer. In the world of LLM serving, this is a massive win: fewer layers mean a smaller KV cache, lower latency, and higher throughput.

Latency Comparison Figure 2: Forward-pass latency scaling. The tiled implementation (RT) maintains near-linear scaling compared to a naive recurrent approach.

Critical Insight: Training Stability

One might fear that recurrence introduces the dreaded "exploding/vanishing gradient" problem. The authors provide a path-based analysis showing that because the "one-hop" direct attention paths are still present, the model doesn't rely solely on the long recurrent chains. Combined with RMSNorm and residual scaling, RT remains as stable to train as a standard Transformer.

Conclusion & Future Outlook

The Recurrent Transformer is a "proof of concept" that we haven't reached the limit of Attention-based architectures. By simply changing where memory is derived from, the authors have shown we can build models that are shallower but more "thoughtful" per layer.

Future Directions:

  1. Scaling: Testing RT at the 7B-70B parameter scale.
  2. Hybridization: Combining layerwise recurrence with SSMs or Linear Attention.
  3. Kernel Optimization: Developing custom Triton/CUDA kernels to push the efficiency even further.

RT proves that the "memory" of a Transformer doesn't have to be a static snapshot of the past; it can be an evolving, processed representation that grows more useful with every hop.

Find Similar Papers

Try Our Examples

  • Search for recent papers that improve the depth-width tradeoff in Transformers using architectural modifications other than recurrence.
  • Which paper first introduced the concept of Feedback Transformers, and how does the Recurrent Transformer's "layerwise" approach specifically solve its computational bottlenecks?
  • Find studies that evaluate the scalability of tiled attention algorithms or "Flash Inference" techniques in large-scale language model pretraining.
Contents
Recurrent Transformer: Trading Architectural Depth for Temporal Intelligence
1. TL;DR
2. The "Shallow" Reality of Modern Transformers
3. Methodology: The Persistent vs. Temporary Split
4. Breaking the Sequential Bottleneck: Exact Tiling
5. Experimental Performance: Doing More with Less
5.1. 300M Parameter C4 Pretraining
6. Critical Insight: Training Stability
7. Conclusion & Future Outlook