Recurrent LLMs: Increasing Computational Depth with Shared Weights
Recurrent large language models reuse network weights to increase computational depth without adding independent layers. This article explains how recurrence works, why it requires training adaptation, and how it affects latency and memory. It also outlines controlled experiments for evaluating task quality, serving performance, and cost per successful task.
1. How Can a Model Compute More Deeply Without Adding Parameters?
Understanding recurrent architectures starts with separating three quantities: how many parameters must be stored after training, how many network transformations a forward pass executes, and how many resources an entire request consumes. These quantities are related, but they are not interchangeable.
The conventional approach is to add network layers, each with its own weights. Computational depth and parameter count therefore tend to grow together. A recurrent architecture reuses the same weights, partially decoupling the two.
Consider a model with an initial stage, a recurrent middle block, and a final stage. The initial stage converts the input into a hidden state. The middle block processes that state, then takes its own output as the input to a second iteration. The final stage uses the resulting state to produce the output.
In simplified notation:
h₁ = F(h₀; θ)
h₂ = F(h₁; θ)
Both iterations share the parameters θ, but the second receives the transformed state h₁, not the original h₀. This is not simply calculating the same result twice. It continues transforming the representation produced by the previous iteration.
If a 28-layer middle block runs twice, that section of the forward path executes 56 layer operations while storing only one set of weights for those 28 layers. Here, weight sharing means each layer reuses its own weights across iterations. It does not mean that all 28 layers within the block use the same parameters.
Nor is this equivalent to adding 28 independent layers. Independent layers can learn entirely different transformations, whereas shared weights constrain the transformations available at each iteration. Whether that constraint helps must be tested on the target tasks; layer execution counts alone cannot establish its value.
2. Why Not Just Run an Existing Model Block Again?
Adding recurrence to an existing base model does not require starting from random initialization. However, changing an iteration count is not enough to guarantee reliable gains.
During its original training, a network block typically receives inputs from the preceding stage. With recurrence, its second iteration receives inputs produced by the block itself. Those inputs may differ in both numerical distribution and representational content. The subsequent network stages must also adapt to the output of the final iteration.
Simply repeating the block may improve some examples, amplify errors in others, or degrade tasks that previously performed reliably.
At a minimum, a recurrent adaptation must answer three questions:
- Which section of the network should be repeated?
- How many iterations should it execute?
- Does training expose the model to the execution path that will actually be used in deployment?
Choosing a middle block is a testable design choice, not a universal rule. If the block is too short, the additional computation may not produce measurable gains. If it is too long, forward-pass costs rise quickly, and the final stage must adapt to a broader range of representation changes.
Likewise, a model trained only with two iterations should not be assumed to retain its quality when deployed with one iteration, or to become more accurate when deployed with three.
One publicly reported set of small-scale, equal-parameter comparisons found that enabling recurrence increased math reasoning accuracy from approximately 19% to 30% and science question-answering accuracy from approximately 48% to 56%. Average output length on the relevant benchmarks also fell by roughly 10% to 14%.
These results show that, in that experimental configuration, more internal computation and shorter generated outputs can occur together. Shorter outputs do not, however, prove that a particular reasoning step has moved inside the network. The figures also cannot be extrapolated to other model sizes, tasks, or serving workloads.
The distinction between comparison types is especially important: an equal-parameter comparison can show whether additional computation helps, but it cannot establish whether weight sharing is the best option under an equal compute budget.
3. Why Shorter Outputs Do Not Necessarily Mean Lower Latency
Recurrence adds computation within each forward pass. Longer reasoning text adds autoregressive generation steps: generating each new token typically requires another decoding pass.
The first makes each step more expensive; the second increases the number of steps. Whether a request becomes faster or slower depends on whether these costs offset each other. Input prefill, queueing, and tool execution must also be included.
A simplified relationship is:
End-to-end latency ≈ queueing time + input prefill time + sum of decoding-step times + external tool execution time
Suppose recurrence makes each decoding step 20% slower but reduces the number of generated tokens by 10%. Under the simplifying assumption that everything else remains unchanged, decoding takes approximately 1.2 × 0.9 = 1.08 times as long as before. It is still slower.
This example illustrates the calculation; it is not a measured result. In production, long inputs may make prefill the dominant cost, while complex tool-based tasks may be dominated by execution and retries. A streaming response that appears fast does not necessarily mean the entire task finishes quickly.
Memory usage also needs to be broken down by component. Compared with adding independent layers, shared weights reduce weight storage requirements. They do not mean that all intermediate results can be reused across iterations.
In a standard autoregressive attention implementation, the same layer receives different hidden states in different iterations. The resulting keys and values are therefore usually different as well. Their caches cannot be merged merely because the weights are identical.
During training, repeated execution of a network block may also require retaining separate activations for backpropagation through different iterations. Capacity planning should measure weight memory, attention caches, temporary buffers, and training activations separately rather than estimating everything from parameter count.
4. Long Context and Multimodal Capabilities Are Separate from Recurrence
Iteration count, context window, and input modalities are independent design dimensions.
Recurrence determines how many times a network block executes along the forward path. The context window determines how much input and output a request can accommodate, with exact limits depending on the implementation. Support for images and video depends on how the model encodes and integrates those inputs.
A recurrent architecture does not automatically expand the context window or give a model visual capabilities.
Consider a task that asks a model to modify a web page based on a screenshot. Evaluation should go beyond whether the model generates code. A more complete workflow is to:
- Provide the screenshot and existing code, then ask the model to submit changes.
- Render the page in a fixed runtime environment.
- Compare layout differences in key regions.
- Run interaction tests.
When the result is poor, distinguish among errors in visual understanding, errors in code changes, and inconsistencies in the runtime environment. Only by fixing the inputs, tools, and acceptance criteria can an experiment identify which part of the workflow benefits from additional computation.
For long-horizon tasks, a similar approach is to divide the final result into verifiable stages. In cross-file code changes, for example, separately record dependency identification, the scope of changes, test pass rates, and recovery outcomes after failures.
A longer initial response or more tool calls does not necessarily mean better task completion. More useful signals are whether the final deliverable is correct within the allotted time and tool-call budget, and whether the model can use specific failure feedback to make corrections rather than retrying without direction.
5. Designing Controlled Experiments That Inform Deployment
Separate Equal-Parameter and Approximately Equal-Cost Comparisons
An equal-parameter comparison reveals what additional execution with shared weights contributes, but the recurrent model also consumes more computation.
An approximately equal-cost comparison can constrain inference time or compute budget and compare recurrence with alternatives such as a larger generation budget or additional independent layers.
If the experiments adapt an existing base model, record differences in subsequent training across groups. Otherwise, improvements from extra training may be incorrectly attributed to recurrence.
Measure Quality Through Verifiable Task Outcomes
For math and question answering, compare final-answer accuracy. For programming, use build success rates, test pass rates, and regression defect counts. For multistep tasks, record final success rates, tool failure rates, and recovery rates after failures.
When reporting recovery rates, specify the denominator: all requests, or only requests that failed and were eligible for retries.
Stratify the test set by input length and task difficulty as well. An overall average can hide the fact that recurrence helps only a particular category of difficult examples.
Measure Tail Latency Under Realistic Concurrency
Collect time to first token, generation time, end-to-end latency, completed requests per unit of time, and peak memory usage separately.
Alongside averages, examine 95th- or 99th-percentile latency and report timed-out requests separately.
Additional computation may have a limited effect on an isolated request at low concurrency. As concurrency increases, however, it extends device occupancy and can worsen queueing. Measuring only single-request generation speed can underestimate this effect.
Calculate Cost per Successful Task
For interactive completion or simple format conversion, users often prioritize response speed, so extra recurrence may not be worthwhile.
For tasks that require cross-file analysis, have automatically verifiable results, and incur expensive manual rework, a slower individual request may still reduce overall costs if it substantially cuts retries and rework.
One useful measure is the total cost of task attempts, including failed attempts and retries, divided by the number of successful deliveries. Evaluate this alongside timeout rates and human intervention rather than relying only on per-token prices or generation speed.
Ultimately, recurrent architectures offer a resource trade-off: add fewer independent weights and execute more forward computation. Their value is not in translating a parameter count into a larger hypothetical number. It lies in reliably improving target-task outcomes within acceptable time and resource limits.
Additional computational depth becomes a practical benefit only when results can be verified, costs can be measured, and latency meets the requirements of the application.
