Recurrent Transformer Architecture in Large Language Models: Deeper Reasoning with Fewer Tokens

    This article explains how a recurrent Transformer architecture enables large language models to achieve greater reasoning depth without increasing parameter count. It covers the core design principle of weight sharing with recursive layer execution, three key engineering optimizations—per-token gated progressive write-back, cross-pass KV Cache sharing, and sparse attention index reuse—and the resulting shift of reasoning from explicit token streams to implicit computational depth. It also discusses the model's improved accuracy on math and science benchmarks, reduced output length, coding-adjacent use cases, and the practical implications of deploying trillion-parameter-class models efficiently.

    Recurrent Transformer Architecture in Large Language Models: Deeper Reasoning with Fewer Tokens

    At the current stage of large language model (LLM) development, scaling up parameter counts and increasing computational depth remain the two core paths for raising a model’s intelligence ceiling. However, simply adding parameters leads to exponential growth in GPU memory and compute costs. Recently, a major AI platform released a new base model built on a recurrent Transformer architecture. By sharing weights and executing layers recursively, it increases the model’s computational depth without adding parameters, achieving the impressive result of “thinking deeper with fewer tokens.” This article takes a deep dive into the technical principles and engineering practice behind this architecture.

    1. The Principles and Motivation Behind the Recurrent Transformer

    Traditionally, Transformer models have been scaled by stacking more layers and widening their dimensions. But at the hundreds-of-billions scale (around 750B parameters), every additional layer brings enormous pretraining compute and deployment memory costs. The recurrent Transformer architecture offers a new way around this bottleneck.

    The core idea dates back to the Universal Transformer paper, first proposed in 2018 and formally published at ICLR in 2019: use weight sharing so that the same set of neural network layers is executed recursively across multiple time steps. In this implementation, rather than pretraining a new recurrent model from scratch, the engineers extracted 28 layers from an already-pretrained base model of hundreds of billions of parameters, converted them into a weight-shared stack, and ran the loop for two passes.

    The elegance of this design lies in three points:

    1. Zero parameter growth: The model’s total parameter count stays at roughly 750B, and the physical storage of the base model’s weights is unchanged.
    2. Doubled effective depth: The second pass continues reasoning from the first pass’s outputs, making the model logically equivalent to a much deeper network.
    3. Manageable compute overhead: Through post-training adaptation, a relatively small amount of compute was enough to make the model work with the recurrent execution mode, in exchange for a substantial boost in reasoning capability.

    2. Engineering Challenges and Optimizations for Recurrent Inference at Scale

    The main cost of a recurrent structure shows up in inference memory usage and latency. For a model at the 750B scale, naively looping twice would nearly double the context state and KV Cache, making deployment costs unsustainable. The solution introduced three key engineering changes:

    1. Per-Token Gated Progressive Write-Back

    In conventional layer-to-layer information flow, each layer’s output either fully replaces the residual stream or is added to it directly. Under a recurrent architecture, however, writing back directly could cause information overload or feature collapse. This model adopts a “per-token gated progressive write-back” mechanism.

    Specifically, the system writes each pass’s candidate changes back into the residual stream proportionally. During the first pass, the model mainly establishes a global context state, capturing coarse-grained semantic features; in the second pass, the gating mechanism refines those features and fully writes back the final results. This mechanism resembles the human process of “drafting” and then “double-checking”—effectively balancing information retention with feature refinement.

    2. Cross-Pass KV Cache Sharing

    KV Cache is one of the biggest consumers of GPU memory during LLM inference. If the second pass had to recompute and store all Key and Value matrices, memory requirements would double outright.

    To solve this, the architecture implements a cross-pass KV Cache sharing strategy. The second pass reuses the sparse KV cache generated by the first pass, and only maintains one additional sliding window of KV entries for the current pass—no full duplicate cache is kept. This design significantly reduces peak memory usage, keeping the deployment cost increase of the recurrent model relative to its non-recurrent predecessor within a controllable range. In real deployments, elastic compute orchestration platforms such as Baidu AI Cloud’s container service can efficiently manage this dynamic memory demand and maximize resource utilization.

    3. Sparse Attention Index Reuse

    For very long contexts, sparse attention is a common technique for reducing computational complexity, but it usually comes with retrieval overhead. Since the first pass has already scanned the global context thoroughly and established the relevant state, the second pass doesn’t need to perform global attention retrieval again.

    The model directly reuses the sparse attention indices generated in the first pass during the second pass. This design builds on the industry-common practice of sharing cross-layer indexing (for example, reusing an indexer every four layers), completely eliminating second-pass index retrieval overhead and minimizing the latency cost of the added computational depth.

    3. A Shift in Reasoning Paradigm: From Token Streams to Computational Depth

    The most striking result is that the recurrent architecture changes how the model “thinks.” In traditional chain-of-thought mechanisms, a model performs logical reasoning by generating more intermediate tokens. In this recurrent model, part of the reasoning process has shifted from an explicit token stream into implicit recurrent computational depth.

    Benchmark data shows that in controlled experiments with the same parameter count and similar training compute overhead (about 10% more), enabling recurrence significantly improved accuracy on complex tasks such as mathematical reasoning and scientific QA. More importantly, across multiple mainstream benchmarks, the model’s average output length dropped by 10% to 14%, with the reduction coming mostly from redundant chain-of-thought tokens.

    In other words, the model learned to “think in its head” rather than “think on paper (via token output).” Fewer output tokens reduce network transfer latency and improve overall throughput. On speed, the model reaches up to 200 tokens/s during off-peak hours and maintains 70–80 tokens/s at peak, balancing depth with efficiency.

    4. Broad Applications in Code-Adjacent Scenarios

    With its increased computational depth, the model is positioned as unlocking “broad coding” capability—meaning code is no longer just about writing in programming languages, but serves as a foundational capability for accomplishing a wider range of complex tasks.

    In practice, this broader coding capability has shown strong cross-domain potential:

    1. Real-time multimedia generation: Rendering visuals in real time through front-end code, while invoking third-party music models, to automatically produce MVs and other multimedia content.
    2. 3D interactive scene construction: Using mathematical geometry and shader code to dynamically generate 3D interactive scenes with a high degree of physical realism, greatly lowering the barrier to developing games and VR content.
    3. Industrial-grade modeling and simulation: Generating control code that directly drives common open-source modeling tools to perform high-precision robotic arm modeling and physical motion simulation, supporting industrial automation.

    5. Conclusion

    The production rollout of this recurrent inference architecture marks a new path toward raising a model’s intelligence ceiling without blindly expanding parameter scale. Through lower-level optimizations—per-token gating, KV Cache sharing, and index reuse—the model successfully shifted part of its reasoning workload from token generation into implicit computational depth, achieving the breakthrough of “fewer tokens, deeper thinking.” This trend not only points the way for the future evolution of large models, but also provides a highly referenceable engineering blueprint for efficiently deploying ultra-large models in the cloud.