Looped Reasoning: Completing Reasoning with Fewer Tokens

    Looped reasoning shifts part of a model’s reasoning from visible tokens into additional internal rounds of computation. This article examines the design constraints that make that trade-off practical—per-token residual write-back, KV sharing with a round-two sliding window, and reuse of sparse attention indexes—and covers training, evaluation, deployment fallbacks, and applications to programming workflows.

    Why “Thinking Longer” Is Not the Same as “Writing More”

    When large models tackle difficult problems, a common approach is to write intermediate steps explicitly into the output: list the conditions first, then branch into cases, and finally give the conclusion. This chain of thought is readable for humans and useful for alignment training, but the computation is spread across tokens. Every additional generated token requires another forward pass, consumes more bandwidth, and increases user wait time. For code repair, multi-step planning, and problems that require repeated self-checking, length often grows faster than accuracy.

    Looped reasoning does not aim to “cancel thinking.” It changes where reasoning is carried. The network performs one or more additional internal rounds of computation over the same context, and a later round reads the results already written into the hidden state by the previous round, then refines them. Effectively, depth increases, but the number of user-visible tokens does not have to grow proportionally. Some of the trial, fallback, and proofreading steps that would otherwise be written out become state updates in the residual stream.

    This is not the same path as simply making a model wider or fixing more layers up front. Fixed deepening makes every forward pass pay the cost of the full depth. Looping turns extra depth into computation that can be switched on or off and allocated by difficulty. Simple requests can use fewer rounds or no loops at all; difficult problems can enable a second round.

    From Post-Training Gains Back to How the Base Model Computes

    There are two common paths to capability improvement. One keeps the base model unchanged and relies on instruction data, preference optimization, and inference-time sampling strategies to squeeze out existing capabilities. This path shows results quickly, but its ceiling is constrained by the base model’s computation graph: each token can only pass through a fixed number of layers.

    The other path changes the computation graph itself. The core assumption behind looped architectures is that many errors are not caused by missing knowledge, but by an insufficient single scan. The first round is good for building global context: what is related to what, where the constraints are, and which positions need closer inspection. The second round does not start from zero. It continues reasoning from the first-round state, specifically for disambiguation, filling gaps, and consistency checks.

    In engineering practice, the more realistic approach is often not to discard pretraining and train a new architecture from scratch, but to take an already pretrained base model and use additional training to adapt its weights into a form that can execute in loops. Compute is mainly spent on “learning to use the second round,” not on relearning language and code distributions. The cost is handling the mismatch between training and inference computation graphs, and verifying whether the second round actually uses new information rather than copying the first round again.

    Three Design Choices That Determine Feasibility

    If looping simply means “run the same network again and copy the cache as-is,” memory and bandwidth will nearly double, which is hard to accept in deployment. A usable design usually constrains three things at the same time: how much is written back, how much cache is shared, and whether retrieval must be redone.

    Per-Token Gating and Progressive Residual Write-Back

    The two rounds should not be a hard switch. A more robust approach is to decide per token and per channel what fraction of the current round’s candidate update is written back to the residual stream.

    The first round is more responsible for “building state.” It sees the full context (or sparsely selected key positions) and writes the topic, constraints, and preliminary hypotheses into the hidden representation. At this point, gating can be conservative, avoiding overwriting the context with unverified conclusions right away.

    The second round is more responsible for “refining and writing back fully.” It reads a residual that already carries global state, and its computation is more like revising a draft. Gating can be more open in this round, allowing corrections to actually enter subsequent layers and the final readout.

    The purpose of gating is to stabilize training. If the second round always overwrites everything, gradients can easily treat the first round as a disposable draft, and the model degenerates into “trusting only the last round.” If write-back is too weak, the loop is idle and only adds latency. In practice, observe whether the difference between the second-round hidden state and the first round grows with difficulty, and whether gate values approach zero on simple sentences while rising on multi-constraint samples.

    Illustrative only; this is not an interface from any specific framework:

    1. h0 = embed(tokens)
    2. for round in [1, 2]:
    3. delta = block(h0, shared_kv, index) # candidate update for this round
    4. g = gate(h0, delta, round) # per-token, learnable
    5. h0 = h0 + g * delta # progressive write-back, not full replacement
    6. logits = head(h0)

    Share KV Across Rounds and Add a Sliding Window Only for Round Two

    During decoding, the most expensive part is often not matrix multiplication itself, but KV reads and writes. If the second round keeps a full new cache, memory grows roughly linearly with the number of rounds, and long contexts hit the wall first.

    A tighter approach is this: the second round reuses the sparse KV already built in the first round, representing “long-range, already-filtered memory”; only a limited sliding-window KV is added for the second round, representing “the local state just refined in this round.” Outside the window, no second full cache is kept. In this way, incremental cost mainly comes from window length and a small amount of extra computation, rather than from multiplying context length by another round.

    This creates an explicit accuracy boundary. If the window is too short, the second round cannot see the neighboring tokens it just modified, and refinement breaks into fragments. If the window is too long, the cost advantage disappears. The window should be tuned together with attention sparsity, not set as an isolated number.

    Reuse Sparse Attention Indexes in Round Two

    Sparse attention first has to decide “which positions to look at.” If indexes are recomputed in every round and every layer, retrieval overhead will eat the token savings from looping.

    A reasonable division of labor is: compute the index once in the first round (or per layer group), and let the second round reuse that sparse index without adding retrieval. The premise is that the “set of relevant positions” attended to in both rounds is broadly stable—looping changes the representations at those positions, not suddenly switching to a completely different set of evidence. If the task itself requires the second round to overturn a conclusion and look at another part of the context, a small proportion of index refresh should be allowed, rather than recomputing by default in all layers.

    Cross-layer index reuse (for example, several layers sharing one index result) is an extension of the same idea: relevance changes more slowly than representations update. The reuse interval needs to be validated with long-context probes, avoiding a situation where later layers still look at outdated positions when the interval is too large.

    Training: Make the Model Actually Use Extra Depth

    Adding loops does not automatically produce reasoning gains. A common failure is that the second-round output is almost identical to the first round, or the second round only adds longer boilerplate. Training objectives must push the model to put difficulty into the loop.

    • Use the same base model and parameter scale as a control, enabling only looping and its corresponding training, to avoid mistaking data or size differences for architectural gains.
    • Evaluate “thinking mode” after long-context supervised fine-tuning; otherwise loop gains become entangled with context-length capability.
    • Record accuracy, output token count, chain-of-thought proportion, time to first token, and peak memory together. Looking only at accuracy encourages longer chains; looking only at length encourages saying less but saying it wrong.
    • Report separately on math, science QA, multi-constraint instructions, and real code tasks. Looping is usually more sensitive to tasks that require revisiting conditions than to fact recall.
    • Extra training compute should be accounted for separately. If the added compute only buys a few leaderboard points while slowing every online request, it should not be on by default.

    In public discussions, same-scale comparisons often show higher accuracy on hard problems while total output gets shorter; the reduction mainly comes from chain of thought rather than the final answer. This fits the explanation of “internalized computation depth,” but it cannot be treated as a guarantee for all tasks. Shorter output may also mean the model gives up earlier. Evaluation must inspect error types: fewer wasted steps, or fewer necessary steps.

    Deployment: Controllable Cost Increase and Easy Fallback

    The online value of looping depends on whether incremental cost is lower than the tokens and retries it saves. Practical controls include:

    • Default to one round, and enter the second round only when difficulty classification, tool-call failure, or self-check inconsistency triggers it.
    • Force the second round to reuse sparse KV and indexes, and prohibit silent fallback to full cache.
    • Set a hard cap for the sliding window. When exceeded, degrade to one round and return the existing result rather than growing the window without bound.
    • Measure off-peak and peak throughput separately. At peak, compute and cache bandwidth are both tight, and the extra reads introduced by looping may become a bottleneck before parameter count does.
    • Count shorter output in capacity: with the same GPU time, a shorter chain of thought can raise concurrency, but if second-round computation is heavier, net throughput may not rise. Look at end-to-end tokens/s and successful requests together.

    Safety evaluation should not be relaxed just because fewer tokens are generated. Internalized reasoning is more opaque. If policy filtering scans only final answers, it may miss harmful plans that have entered state but were not written out. Before launch, tool calls, code execution, and sensitive domains should receive the same scrutiny as with long chain of thought, rather than substituting length reduction for review.

    How This Connects to General-Purpose Programming Scenarios

    When code becomes the basic action for completing general tasks—querying data, changing configuration, running validation, and revising based on errors—the request is no longer a single completion but a short closed loop. The pain point of this workload is that every step requires explaining the plan, the token budget is quickly consumed by process text, and the patch actually submitted to the interpreter is pushed to the back.

    Looped reasoning should be used with restraint here:

    • Round one reads repository context and errors, establishing state: which files to change and what constraints apply.
    • Round two fixes inconsistencies on the same index and directly produces a shorter patch or command, instead of writing another design explanation.
    • Keep executable results external: tests, type checks, and diff review are not left to hidden states alone. Looping reduces narration, not verification.

    If the task requires auditing, the model can be asked to output only conclusions and diffs after looping, with the process kept internal. When teaching or compliance traceability is needed, explicitly turn on chain of thought; do not disable visible reasoning just to save tokens. The two modes should be configurable, not hard-wired into the architecture.

    Implementation Checklist

    1. Draw the computation graphs for one round and two rounds, marking whether KV is shared, windowed, or fully copied.
    2. Run ablations on the same base model: no loop, loop with frozen gates, and loop with index recomputation. Distinguish gains from depth versus gains from doing retrieval again.
    3. Report accuracy together with average output length, chain-of-thought length, and P95 latency.
    4. Prepare fallbacks: return to one round when cache pressure, timeout, or safety policy triggers.
    5. For code tasks, measure test pass rate; do not substitute “shorter answer” for correctness.

    The value boundary of looped reasoning is clear: it replaces part of externalized thinking with controllable extra depth, creating an opportunity to complete the same reasoning with fewer tokens. It does not replace data quality, nor does it automatically reduce peak cost. Only when write-back, caching, and indexing are constrained together, and evaluation watches both correctness and length, is this architecture an engineering choice rather than another form of longer waiting.