đ¤ AI Summary
This paper investigates the intrinsic mechanisms of chain-of-thought (CoT) tokens in large language models (LLMs), focusing on combinatorial reasoning tasks such as multi-digit multiplication and dynamic programming. Through causal interventionsâincluding intermediate-result masking, latent representation substitution, and dynamic response tracingâwe demonstrate that CoT tokens fundamentally encode program-variable semantics: retaining only tokens storing intermediate results preserves over 98% of task performance, and arbitrary perturbations to these values consistently propagate through subsequent reasoning steps with minimal final-answer degradation (<2% accuracy loss). We formally identify and empirically validate three core properties of CoT tokensâintervenability, state dependence, and latent shortcut vulnerabilitiesâthereby moving beyond black-box interpretations of CoT reasoning. These findings establish a mechanistic foundation for understanding how LLMs perform structured computation. To support reproducible research, we publicly release all code and benchmark datasets.
đ Abstract
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.