Summary (Overview)
- This paper constructs a family of constant-bit-size looped transformers that interpolates between explicit chain-of-thought (CoT) reasoning and latent thought (internal hidden-state recurrence).
- For a prescribed loop count and fixed integer with , the transformer simulates a time-, space- Turing machine using a context window of and generated tokens—reducing both resources by a factor of relative to the corresponding unlooped queue-machine simulation.
- The construction works with hardmax attention and also holds with softmax attention at constant bit-size under a finite-precision kernel specified in the paper.
- The loop count acts as an "exchange rate" between the external trace (generated tokens) and internal computation (latent iterations), with explicit and latent reasoning being two placements of the same general-purpose computation.
- At , the bounds recover the results of Li and Wang [2025b, Thm 1].
Introduction and Theoretical Foundation
Background
Transformers can perform general-purpose computation through recurrence. Two forms of recurrence exist:
- Autoregressive generation (CoT): the model appends tokens to its sequence, using them for intermediate computation [Wei et et al., 2022].
- Looped transformers: a shared block is applied repeatedly to the hidden state, carrying intermediate results in latent representations [Giannou et al., 2023, Yang et al., 2024, Geiping et al., 2025].
Prior Work and Motivation
- Pérez et al. [2021] proved autoregressive transformers are Turing-complete, with precision growing with input.
- Li and Wang [2025a] achieved constant-bit-size Turing completeness with fixed relative offsets and context.
- Li and Wang [2025b] reduced CoT tokens to per simulated machine step by increasing the head–layer product.
- Saunshi et al. [2025] showed loop iterations can simulate CoT steps one-for-one.
Key question: How does moving computation from generated tokens into hidden-state recurrence change the context window and number of generated tokens required for Turing-machine simulation?
Theoretical Foundation
The paper simulates Turing machines through an intermediate synchronous multi-queue machine (Post machine variant). The conversion is cited from Li and Wang [2025b]:
Fact 2.2: For every fixed integer , a -time, -space -tape Turing machine converts to a synchronous -queue machine running in steps and total queue space.
Each tape becomes two stacks, each stack levels of queues. With , level uses two content-half queues of length and one buffer of length .
Methodology
Looped Transformer Model
A looped transformer consists of:
- A loop unit : a stack of decoder layers with shared weights
- Embedding emb and output head , applied outside the loop
- A loop count
The forward pass computes:
Per-Iteration Cache Reading Rule
The cache holds iteration- key and value entries of retained positions . Iteration of position attends only to same-iteration entries. A fixed iteration never reads another iteration's cache.
Key Construction Elements
Token layout: At nonterminal position , the token is where is the tuple appended at log index .
Embedding layout:
Positional encoding: With ,
so that , selecting the front of queue at a fixed relative offset.
Queue lengths: , with , ensuring .
Loop Invariant (Lemma 4.1)
For every position and iteration , the value entry encodes the -tuple at log index . The proof shows that head attends to position , whose iteration- entry is:
which is exactly the front of queue for step .
Empirical Validation / Results
Main Theorem (Theorem 4.3)
Any time-space bounded -tape Turing machine can be simulated by a constant-bit-size looped transformer with head–layer product and context window length , taking CoT steps for each simulated TM step, for a total CoT length of , for every loop count and fixed integer with .
Resource Accounting
| Quantity | (endpoint) | Admissible |
|---|---|---|
| Generated tokens | , exactly | |
| Visible positions (window) | ||
| Loop executions (serial block work) | , unchanged | |
| Total cached KV state | , unchanged | |
| Learned model size | , machine-dependent | , machine-dependent |
Concrete instance: For , , (admissible since ):
- generated tokens
- visible window positions
- cached entries
- loop executions
Worked Example (Section 4.5)
For one queue with , , :
| Pass | Window | Steps executed | Reads () | Emits |
|---|---|---|---|---|
| 2 | {0, 1, 2} | 6, 7, 8 | (at pos. 0) | |
| 3 | {1, 2, 3} | 9, 10, 11 | (at pos. 1) | |
| 4 | {2, 3, 4} | 12, 13, 14 | (at pos. 2) |
Softmax Extension (Section 5)
The construction holds under a max-first binary32 softmax kernel:
Lemma 5.1: If a score row has unique maximizer with score gap at least 256, then the max-first kernel's computed attention output is exactly , independently of row length.
Corollary 5.2: Setting in Section 4.2, every score row has scores in {256, 0}, a unique maximizer at distance , and shifted losers exactly −256, all exactly representable in binary32. Theorem 4.3 and Proposition 4.2 hold with softmax attention under this kernel.
Theoretical and Practical Implications
Theoretical Significance
- Interpolation result: The construction shows explicit CoT and latent thought are not fundamentally different capabilities but two placements of the same general-purpose computation realized by recurrence.
- Resource trade-off: The loop count is the "exchange rate" between external trace and internal computation—decreasing externalizes computation as tokens; increasing folds consecutive CoT steps into each token as latent iterations.
- Layer alignment: The key insight is that queue fronts must sit in the cache at the iteration that consumes them—a "layer-aligned" representation.
Practical Messages for Real LLMs (Conjectural)
- Looped transformers can internalize substantial parts of CoT into recurrent state, preserving general-purpose computation while separating reasoning from visible tokens.
- Generated CoT token count need not measure serial computation—one token can summarize consecutive steps.
- Learning difficulty at large : The explicit trace becomes strided (only every -th state is emitted), so intermediate latent steps are not supervised by next-token prediction, potentially making such computation difficult to acquire from pretraining alone.
- Design suggestion: Take the loop count as an explicit budget for latent computation and supervise only selected boundary states.
Conclusion
This paper constructs constant-bit-size looped transformers that simulate Turing machines with both context window and CoT length reduced by a factor of relative to unlooped queue-machine simulations. The construction interpolates between explicit CoT (at ) and increasingly latent thought (at larger ), with the loop count serving as the exchange rate between visible tokens and internal computation.
Key Limitations
- Loaded cache: Input is pre-loaded into the initial KV cache; initialization cost is excluded from bounds.
- Visible resources only: The factor- reduction applies only to generated tokens and visible window; total cached KV state and serial block work are unchanged.
- Kernel-conditional softmax: Results hold only under the specific max-first binary32 contract.
- No learning claims: Nothing shows such computations are learned by pretraining or other training signals.
- Bounds, not measurements: All quantitative statements are asymptotic bounds; no experiments were performed.
Future Directions
- Understanding how looped architectures can be trained to internalize reasoning steps
- Investigating supervision strategies for strided traces
- Exploring the relationship between loop count and learning difficulty in practical models
Related papers
- Accordion: Elastic-Depth Inference via Fixed-Prefix Layer Looping
Accordion enables one MoE model to serve five inference budgets via fixed-prefix layer looping, gaining 3.01 points across 37 tasks while retaining unlooped-path quality.
- LoopFold: Parallelizing Recurrent Depth in Looped Transformers
LoopFold decouples recurrent depth from sequential decoding depth by predicting and correcting parallel loop states, cutting latency 46% while improving zero-shot accuracy by 2.20 points.
- What Does a Harness Repair? A Preregistered Study of Visibility, Baseline Adequacy and Evaluation Defects
Preregistered harness-search studies show most accuracy gains are visibility artifacts, and searched harnesses failed to beat trivial constant-label baselines despite large nominal improvements.