Recurrent Depth Extension Architecture: Fewer Tokens for Reasoning

    This article breaks down recurrent depth extension, an architecture that turns selected contiguous layers of a pretrained base model into a shared-weight recurrent block executed multiple times, increasing effective depth without increasing parameter count. It covers three key engineering changes that make the loop practical—per-token gated progressive write-back, cross-loop KV cache sharing, and reuse of sparse attention indices—alongside controlled same-parameter benchmark results showing higher scores and roughly 10–14% shorter outputs on science and multi-discipline reasoning tasks. It closes with a deployment checklist and the task boundaries where the approach pays off.

    1. The Starting Point: Why a Deeper Network Is Not the Same as More Parameters

    Across the last two generations of flagship models, capability gains have mostly come from continued refinement during post-training while the base architecture stays fixed. This is low-risk from an engineering standpoint, but it runs into diminishing returns quickly: post-training can correct behavior and align preferences, yet it cannot change how many “reasoning steps” a model can execute within a single forward pass.

    Making the network deeper is the classic alternative, but it carries two direct costs: a larger parameter count increases memory and bandwidth pressure, and compute cost rises in lockstep for both training and inference. That is why the industry has started revisiting a middle ground—fixed parameters, variable depth—known as recurrent depth extension (loop / recurrent depth).

    The core idea is to convert several contiguous layers of an already pretrained base model into a recurrent block with shared weights. The same set of weights is executed for multiple rounds, with the second round continuing to reason on top of the residual stream produced by the first, effectively yielding a deeper network. Taking a base model at roughly the 750B parameter scale as an example, converting 28 of its layers into a shared-weight block run for two loops leaves the parameter count almost unchanged while doubling the computational depth.

    Worth stressing: this structure is not a new invention. Deep recurrent architectures with weight sharing were proposed in a public paper in 2018 and formally published at an academic conference the following year. The real engineering difficulty is not whether you can loop, but how to avoid blowing up memory and latency once you do.

    2. Three Key Engineering Changes That Make the Loop Practical

    2.1 Per-Token Gated Progressive Write-Back

    The naive approach has the second round overwrite the hidden state from the first, which wipes out the global context established in round one and tends to make training oscillate. A more stable approach introduces a per-token gate coefficient that writes each round’s candidate update back into the residual stream proportionally:

    1. # Illustration: gated write-back in the recurrent block (not a real API)
    2. for t in range(num_loops): # num_loops = 2
    3. h_cand = block(h) # the same layers with shared weights
    4. g = gate(h, t) # per-token scalar gate, value in 0~1
    5. h = h + g * (h_cand - h) # progressive write-back, not replacement

    The design intent is a division of labor: the first round establishes the global context state and writes back by a smaller margin; the second round refines and writes back its result more fully. The gate turns “reasoning depth” into a per-token learnable quantity—simple tokens can be computed less, hard tokens more.

    2.2 Cross-Loop KV Cache Sharing

    The most obvious cost of looping is that the second round has to store another copy of the KV. After the change, the second round reuses the sparse KV already computed in the first round and only adds the KV within a sliding window, without retaining the full cache. This keeps the deployment cost increase relative to the previous generation within a manageable range, and keeps the memory curve in long-context scenarios from rising linearly with the number of loops.

    2.3 Cross-Loop Attention Index Reuse

    The retrieval cost of sparse attention would also double. Building on the existing idea of reusing the indexer once every few layers, the second round directly reuses the sparse attention indices from the first round and performs no additional retrieval. The tradeoff is that the second round cannot reselect which regions to attend to; the benefit is that latency and bandwidth barely increase.

    3. Measuring the Effect: A Controlled Comparison at the Same Parameter Count

    The only credible way to tell whether a recurrent structure actually “buys intelligence” is to control variables. A common industry practice is to build a control model at a smaller scale (around 30B) with an architecture identical to the large base model, then enable thinking mode for evaluation after roughly 200K tokens of long-text supervised fine-tuning, with only about a 10% increase in training compute. Public comparison results show that with looping enabled:

    • Math competition benchmarks: 19.17 → 30.42
    • Graduate-level science Q&A: 47.58 → 56.26
    • Multi-discipline reasoning: 71.65 → 75.05

    More notable is the output length: on the science and multi-discipline benchmarks, average output length drops by roughly 10%–14%, with the reduction coming mainly from the chain of thought. This means part of the reasoning has shifted from the “token stream” to the extra computational depth provided by looping—the model completes its reasoning with fewer tokens. For cost-sensitive online services, fewer output tokens often reduces the bill more directly than optimizing time-to-first-token.

    4. Engineering Deployment Checklist

    • Capacity planning: The number of loops directly multiplies the compute per token, so size the GPU count by working backward from peak QPS, and set separate throughput expectations for peak and off-peak (the publicly stated tiers for this architecture are roughly 200 token/s off-peak and 70–80 token/s at peak).
    • Caching strategy: Confirm that the inference framework supports cross-loop KV reuse and incremental sliding-window writes; otherwise the memory savings will not materialize.
    • Gate observability: Bring the mean per-token gate value into monitoring and alerting—a gate that stays near its lower bound over a long period indicates the loop is not being used effectively.
    • Evaluation criteria: Record both accuracy and average output length, so you do not chase score improvements while missing cost drift.
    • General cloud deployment: Model weights can be distributed via object storage, and the serving side can scale elastically on a container platform, with logging and monitoring/alerting services providing end-to-end observability. If you use the relevant general capabilities of Baidu AI Cloud, you can assemble the stack along the categories above; no proprietary interface is required to close the loop.

    5. Applicability Boundaries

    Recurrent depth extension does not deliver universal gains. It suits reasoning-heavy tasks with verbose output, such as complex code generation, math and geometry modeling, and cross-tool orchestration; for short Q&A and high-concurrency, low-latency scenarios, the extra computational depth may not pay off. At the same time, weight sharing weakens differentiation between layers, so if the base model already has low inter-layer redundancy, the gains from the change narrow noticeably. The practical recommendation: first validate on a small-scale, same-parameter control that “scores go up and output gets shorter,” then decide whether to invest compute in modifying the base model.