Depth State Passing: Training Looped Language Models on the Latent States They Will Meet at Test Time

Some small language models "think longer" by looping. Instead of writing out reasoning as text, they run the same block of layers over their own hidden state many times before answering. In principle, more loops at test time should mean better answers from the same parameters. In practice, these models get worse once they run more loops than they saw in training. Ouro-1.4B loses about a fifth of its GSM8K accuracy when pushed from 4 to 8 loops, and a 3.5B looped model stops improving after roughly 64 loops. This note argues that much of this failure is a familiar problem in disguise. Recurrent sequence models such as Mamba break on long inputs because training only ever starts them from an empty state, so at long contexts they wander into "mature" hidden states they have never been trained on. That problem was fixed cheaply by starting training sequences from the final state of an earlier sequence, a trick called state passing. We propose the same fix along the depth axis. The looped block is trained starting from deep hidden states cached from earlier training steps, so it learns to act sensibly in the region of state space that long test-time loops actually reach.

The proposal makes two contributions. The first is a diagnostic: does accuracy collapse at depth track how far the hidden states have moved from anything seen in training (a coverage failure), or does it track how unstable the loop dynamics are (a stability failure)? The second is a parameter-efficient method, depth state passing. It trains low-rank adapters on the looped block, starting from a rotating cache of deep latent states, at a cost on the order of the roughly 0.1% of pretraining compute that sufficed for sequence-length state passing. If the coverage explanation is right, this should let compact looped models keep gaining accuracy, or at least stop losing it, well past their training depth, and it should combine with existing stability fixes rather than duplicate them.

Core Claim

A looped model applies a core block $R$ repeatedly: $h_{t+1} = R(h_t, e(x))$. Here $e(x)$ is the embedding of the prompt produced by the first few layers, $h_t$ is the per-token hidden state after $t$ loops, and the final layers read an answer off $h_T$. Training samples a loop count $T$ up to some horizon $T_{\max}$, so the core block only receives gradients at states with $t \le T_{\max}$. Our claim is that the degradation beyond $T_{\max}$ is driven largely by distribution shift: $h_t$ for $t \gg T_{\max}$ falls outside the training-visited state distribution. Exposing the core block to such states, without unrolling to that depth inside one backward pass, removes most of the degradation.

Understanding and Improving Length Generalization in Recurrent Models is the source of this framing. It formulated the "unexplored states hypothesis" for Mamba and Gated Linear Attention along the sequence axis and showed that state passing restores accuracy to 256k tokens on BABILong and Passkey Retrieval. Earlier, Random State Passing in long-form speech recognition (Narayanan et al.) carried states across mini-batches for the same reason. Neither work touches depth recurrence. The file's own gap analysis lists exactly this transfer as uninvestigated, and our work addresses it.

Research Program

The method keeps a cache of detached hidden states. For a rotating subset of training prompts, it stores $h_{\tau}$ reached at some accumulated depth $\tau$. When a cached prompt is drawn, training starts the loop from $h_\tau$ instead of from the default initial state, runs $T$ further loops, and backpropagates only through the last $k$ of them. This is the same truncated backpropagation used by Scaling up Test-Time Compute with Latent Reasoning, which builds a 3.5B model with a shallow input stage, a looped core, and an output stage, and trains it with random loop counts. The resulting $h_{\tau+T}$ is written back to the cache, so the effective depth seen by the core block grows each time a prompt is revisited, while memory and per-step compute stay those of a $T$-loop unroll.

Cached states come from older parameters. To keep them useful we cap staleness by refreshing entries older than a fixed number of optimizer steps. We mix cached and fresh starts, roughly half each, so behaviour at shallow depth is not sacrificed. The loss is the ordinary answer loss at the end of the loop.

Only low-rank adapters (LoRA) on the core block are trained. This mirrors the single-GPU budget of LSRL, which fine-tuned a looped model with process rewards on 500 GSM8K problems, and it tests whether the depth problem can be repaired as cheaply as the length problem was. Storage is the practical constraint. Per-token states for the full training set are large, so the cache covers a rotating slice of on the order of ten thousand prompts kept in half precision on CPU or disk. Cache size is one of the ablations.

The diagnostic half of the program runs on unmodified models. At each test depth $t$ we measure two quantities. Coverage is the distance from test states $h_t$ to their nearest neighbours among states visited during training at depths $\le T_{\max}$, using a fixed random projection to keep this tractable. Stability is the local expansion rate of $R$, estimated with the same single-step power iteration on Jacobian-vector products that STARS uses. We then ask which of the two predicts the accuracy drop across depths, prompts, and models. This matters because the two explanations recommend different fixes, and the file contains a working fix for each.

The models are Ouro-1.4B, the STARS backbone, and the 3.5B recurrent-depth model.

Baselines

The naive reference point is the released checkpoint with no further training, evaluated at every depth. We also report the same checkpoint fine-tuned with standard supervised training and random loop sampling on the same data, which isolates what extra training alone buys. For Ouro-1.4B this is the supervised baseline STARS reports.

The strongest existing competitor is STARS (Stabilizing Recurrent Dynamics for Test-Time Scalable Latent Reasoning in Looped Language Models). STARS adds a penalty on the largest eigenvalue of the core block's Jacobian, pushing the loop toward contracting dynamics, and fine-tunes Ouro-1.4B on a 400k subset of NuminaMath-1.5. It reports that the base model's GSM8K accuracy drops by 20.47% from 4 to 8 loops while the STARS model drops only 8.26%, and that peak GSM8K accuracy rises by 4.01% over supervised fine-tuning. STARS is the strongest competitor because it targets exactly the beyond-horizon collapse we target, under a different explanation. We run it on the same NuminaMath subset, with the same adapter rank, the same number of optimizer steps, and the same hyperparameter search budget for its penalty weight as for our staleness and mixing ratio. Because STARS's published numbers come from its own full training run, they serve as a sanity anchor for our reproduction rather than the comparison itself.

Beating STARS means two things on GSM8K and MATH500 at depths of 2 to 8 times the training horizon. Our degradation from peak must be smaller than our reproduced STARS degradation, and our peak accuracy must be no lower. Combining both methods should do better than either alone if the two failure causes are distinct.

The ablation that isolates the key ingredient is a compute-heavy counterpart, chained unrolling. For each batch it unrolls to the same accumulated depth that cached states would represent, using fresh forward passes with gradients through only the last $k$ loops. This gives the same state exposure as depth state passing, with no staleness, at much higher forward cost. If chained unrolling matches depth state passing, the cache is purely a cost saving. If it beats it, staleness is hurting us. A second ablation starts from random noise of matched norm instead of cached states, to test whether mature states matter or any perturbation would do. A third varies cache size.

For context on the 3.5B model, its paper reports GSM8K accuracy rising from near zero at 1 loop to over 40% at 32 loops. We do not have a reported number for its behaviour after task-specific fine-tuning beyond 64 loops: no reported result found on Lacuna for that setting.

Why not just…?

Why not just train with more loops? Random loop sampling with truncated backpropagation, as in the 3.5B recurrent-depth model, already exposes states up to the sampled depth. Raising the horizon is the obvious fix, but forward compute grows linearly with depth on every step, and that model still saturates around 64 loops. This is a real threat. If, at matched training compute, raising the horizon gives the same depth curves, our contribution reduces to a cheaper path to the same place. The matched-FLOP comparison against chained unrolling and against an enlarged training horizon is designed to settle this directly, and we would report a tie as a tie.

Why not just regularize stability with STARS? A contracting loop keeps activations bounded, but contraction toward an attractor the output layers have never been trained to read is still a failure. That would be consistent with STARS's own report of non-monotonic accuracy on AMC23 and MATH500 even after the collapse is removed. If our diagnostic finds that the stability measure alone explains the accuracy drop and coverage adds nothing, then STARS is the right fix and depth state passing should add nothing on top of it. That is a falsifiable outcome we would accept.

Why not just initialize from noise? Noise widens the set of starting states, but in arbitrary directions. Mature states plausibly lie in a structured region near the "orbits" the 3.5B model's paper observed in projections of the hidden-state trajectory. The noise-start ablation at matched norm tests this distinction directly.

Why not just exit early? Stopping when successive output distributions stop changing, as the 3.5B paper does zero-shot, avoids the collapse, but it caps accuracy at the shallow peak. The question here is whether deeper loops can add accuracy for hard prompts. We therefore report early-exit accuracy for every method alongside fixed-depth curves, and we count a win only if depth state passing raises the accuracy reached at the exit point.

Proposed Experiments

The cleanest test uses the one-dimensional cellular-automaton sandbox from Beyond Memorization. The task is to predict the state of a 20-cell Boolean lattice after $k$ applications of an unseen update rule, which separates step-by-step reasoning from memorized facts. That paper shows vanilla transformers falling from over 95% at one step to about 40% at two, and it reports that adaptive computation adds roughly one step of depth. Because the number of required steps is known exactly there, we train small looped models with loop horizons sized for $k \le 2$ and ask whether depth state passing lets extra test-time loops solve $k = 3, 4, 5$. We have no reported result on Lacuna for looped transformers extrapolating past their training depth on this task, so the baseline curves will be our own. The synthetic 4-digit arithmetic task from STARS, where STARS holds 100% accuracy over thousands of loops, serves as a ceiling check that our method does not break what already works.

On natural data, we fine-tune Ouro-1.4B on the STARS NuminaMath subset and the 3.5B model on GSM8K training data. We evaluate GSM8K, MATH500, SVAMP, and AMC23 at depths from half the training horizon to sixteen times it. Metrics are accuracy at each depth, peak accuracy, drop from peak at the deepest setting, and accuracy under early exit. Each configuration uses three seeds.

Three findings would be decisive. First, in the diagnostic run on unmodified models, coverage distance should predict per-prompt failure at depth better than the stability measure does. If it does not, the premise is wrong and the method should not help. Second, depth state passing should shrink coverage distance at test depths. It should also cut degradation relative to our reproduced STARS run, at matched compute, on both Ouro-1.4B and the 3.5B model. Third, the combination with STARS should beat either component alone, which would show that coverage and stability are separate failure causes rather than one. A negative result on the first finding is itself informative: it would mean the sequence-length story from recurrent models does not carry over to depth, and that the depth ceiling is a capacity limit of the fixed core block.