Internalizing Chain-of-thought into Looped Transformers
Organizations: Institute for Theoretical Computer Science Shanghai University of Finance and Economics
Abstract
Chain-of-thought (CoT) enables constant-bit-size transformers to perform general-purpose computation through generated tokens (Li and Wang, 2025a), whereas looped transformers carry out the same computation by recurrence in hidden states (latent thought). We construct a family of constant-bit-size looped transformers that interpolates between CoT and latent thought. For a prescribed loop count and a fixed integer satisfying , our 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 also holds with softmax attention at constant bit-size, under the finite-precision kernel specified in this paper.
Figures & tables
| 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 |
| Pass | Window | Steps executed | Reads ( ) | Residual advances from | Emits |
|---|---|---|---|---|---|
| 2 | 6, 7, 8 | (at pos. 0) | 6, 7, 8 | ||
| 3 | 9, 10, 11 | (at pos. 1) | 9, 10, 11 | ||
| 4 | 12, 13, 14 | (at pos. 2) | 12, 13, 14 |
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
| Source | Precision | Dim. | Depth | Window | CoT per TM-step |
|---|---|---|---|---|---|
| Pérez et al. 2021 | |||||
| Bhattamishra et al. 2020 | unbounded | ||||
| Merrill & Sabharwal 2024 | |||||
| Li et al. 2024 | amort. | ||||
| Qiu et al. 2025 | amort. | ||||
| Li & Wang 2025a |
Recurrent Transformers
Recurrent Transformers reuse layers or state across steps to extend context, reasoning depth, and sequence modeling with less parameter growth.
See all 179 papers