Chain-of-Thought Tokens are Computer Program Variables
On the map: LLM reasoning → Prompting and chain-of-thought reasoning
Abstract (arXiv)
Chain-of-thoughts (CoT) requires large language models (LLMs) to generate intermediate steps before reaching the final answer, and has been proven effective to help LLMs solve complex reasoning tasks. However, the inner mechanism of CoT still remains largely unclear. In this paper, we empirically study the role of CoT tokens in LLMs on two compositional tasks: multi-digit multiplication and dynamic programming. While CoT is essential for solving these problems, we find that preserving only tokens that store intermediate results would achieve comparable performance. Furthermore, we observe that storing intermediate results in an alternative latent form will not affect model performance. We also randomly intervene some values in CoT, and notice that subsequent CoT tokens and the final answer would change correspondingly. These findings suggest that CoT tokens may function like variables in computer programs but with potential drawbacks like unintended shortcuts and computational complexity limits between tokens. The code and data are available at https://github.com/solitaryzero/CoTs_are_Variables.
Key facts. Cited by 6 papers in the map (data through 14 Oct 2026). Placed in Prompting and chain-of-thought reasoning, one of 17 directions in LLM reasoning. Builds on 10 of its 30 references that are in the map. First posted on arXiv 8 May 2025.
Builds on
10 of 30 references.
Closest ancestors · 4
Same direction, newest first
- 2025Chain of Draft: Thinking Faster by Writing Less25 Feb
- 2024Training Large Language Models to Reason in a Continuous Latent Space9 Dec
- 2024From Explicit CoT to Implicit CoT: Learning to Internalize CoT Step by Step23 May
- 2022Text and Patterns: For Effective Chain of Thought, It Takes Two to Tango16 Sep
Other references · 6
- 2024DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Modelscited by 9,379
- 2025DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learningcited by 6,330
- 2024Qwen2.5 Technical Reportcited by 4,942
- 2025rStar-Math: Small LLMs Can Master Math Reasoning with Self-Evolved Deep Thinkingcited by 313
- 2024LLaMA-Berry: Pairwise Optimization for O1-like Olympiad-Level Mathematical Reasoningcited by 91
- 2024Theoretical limitations of multi-layer Transformercited by 45
Built on by
Citing papers per year: 2026: 6.
6 papers.
- 2026KG-Hopper: Empowering Compact Open LLMs with Knowledge Graph Reasoning via Reinforcement Learningcited by 2
- 2026Reading Between the Dots: Decoding Hidden Computation across Filler Tokenscited by 2
- 2026CoLT: Reasoning with Chain of Latent Tool Callscited by 1
- 2026Internalized Reasoning for Long-Context Visual Document Understandingcited by 0
- 2026KG-Reasoner: A Reinforced Model for End-to-End Multi-Hop Knowledge Graph Reasoningcited by 0
- 2026From Candidate Tokens to Final Outcomes: Decoding Relative Long-Horizon Candidate Value from Reasoning Model Representationscited by 0
- 2026From Candidate Tokens to Final Outcomes: Decoding Relative Long-Horizon Candidate Value from Reasoning Model Representations11 Oct 2026
- 2026Reading Between the Dots: Decoding Hidden Computation across Filler Tokens3 Jul 2026
- 2026KG-Reasoner: A Reinforced Model for End-to-End Multi-Hop Knowledge Graph Reasoning14 Apr 2026
- 2026Internalized Reasoning for Long-Context Visual Document Understanding31 Mar 2026
- 2026KG-Hopper: Empowering Compact Open LLMs with Knowledge Graph Reasoning via Reinforcement Learning22 Mar 2026
- 2026CoLT: Reasoning with Chain of Latent Tool Calls4 Feb 2026
Similar, not cited
Close in wording, no citation either way
- 2024To CoT or not to CoT? Chain-of-thought helps mainly on math and symbolic reasoning
- 2024LLMs Faithfully and Iteratively Compute Answers During CoT: A Systematic Analysis With Multi-step Arithmetics
- 2025Token Signature: Predicting Chain-of-Thought Gains with Token Decoding Feature in Large Language Models
- 2024Understanding Chain-of-Thought in LLMs through Information Theory
- 2026Structural Anchors and Reasoning Fragility:Understanding CoT Robustness in LLM4Code
- 2023Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspective
- 2023Measuring Faithfulness in Chain-of-Thought Reasoning
- 2026Fragile Thoughts: How Large Language Models Handle Chain-of-Thought Perturbations