Let’s Think Dot by Dot: Hidden computation in transformer language models

Jacob Pfau, William Merrill, Samuel R. Bowman

TL;DR

This paper investigates whether the performance gains from chain-of-thought (CoT) prompting in language models are due to human-like reasoning or simply the extra computation afforded by additional tokens. They demonstrate that transformers can solve complex algorithmic tasks using "filler tokens" (e.g., "......") instead of explicit CoT, suggesting that computation itself, independent of token meaning, can be beneficial. However, learning to utilize these filler tokens requires specific training, raising concerns about hidden computations in LLMs.

What Problem Does This Paper Address?

Chain-of-thought (CoT) prompting has become a standard technique to improve the performance of large language models (LLMs) on complex reasoning tasks. However, it's been unclear whether the benefits stem from the model mimicking human-like step-by-step reasoning or if the added tokens simply provide more computational capacity. Recent work has also shown that LLM answers derived from CoT are not always faithful to the intermediate steps, meaning the model might not actually be performing the reasoning it claims. This paper tackles this ambiguity by isolating the computational benefit of intermediate tokens, even when they are meaningless "filler" tokens, and exploring the conditions under which this benefit arises and how it can be learned.

Methods

The core of the paper's methodology involves training transformer models (specifically, a 34M-parameter Llama model) on synthetic algorithmic tasks under different prompting conditions:

  • Immediate Answer: The model receives the input and directly produces the output without any intermediate tokens.
  • Chain of Thought (CoT): The model receives the input followed by human-like, step-by-step reasoning tokens, and then the output. Two types of CoT are used: parallelizable CoT (where steps can be computed independently) and instance-adaptive CoT (where steps depend on previous results).
  • Filler Tokens: The model receives the input followed by a sequence of meaningless filler tokens (e.g., "......"), and then the output.

By comparing performance across these conditions, the authors aim to disentangle the effect of explicit reasoning from the effect of additional computation. They also conduct probing experiments to verify that filler tokens are indeed used for hidden computation.

Datasets

The authors introduce two novel synthetic datasets for training and evaluation:

  • 3SUM: A task requiring finding triples of numbers that sum to zero modulo 10. This task is chosen because it is theoretically conjectured to be outside the expressivity of standard transformers without additional reasoning tokens, but is parallelizable.
  • 2SUM-Transform: A task that involves matching pairs of numbers that sum to zero, but with the input obfuscated by a transformation. This task is designed to prevent in-place computation and requires the model to handle obscured inputs.

These datasets are designed to highlight specific conditions where filler tokens provide a performance advantage, particularly for problems with nested quantifiers or where intermediate computations are obscured.

Key Insights and Ideas

  • Computation Over Meaning: The most striking insight is that transformers can leverage meaningless "filler" tokens to achieve significant performance gains on complex algorithmic tasks, even surpassing their performance without any intermediate tokens. This suggests that the computational capacity provided by additional tokens is a crucial factor, independent of the semantic content of those tokens.
  • Filler Tokens as a TC<sup>0</sup> Extender: Theoretically, filler tokens are shown to keep transformers within the TC<sup>0</sup> complexity class, meaning they don't unlock problems outside this class. However, empirically, they seem to extend the expressivity within TC<sup>0</sup>, particularly for problems requiring deep quantifier nesting.
  • Learning Filler Tokens is Hard: Despite their computational benefits, learning to effectively use filler tokens is challenging. Standard CoT demonstrations do not transfer well to teaching models to use filler tokens, and specific, dense supervision is required for convergence. This difficulty is attributed to the inherent unfaithfulness of filler tokens (their meaninglessness) and the incompatibility of parallel filler computation with instance-adaptive CoT.
  • Concerns for Auditing LLMs: The ability of LLMs to perform hidden computations using filler tokens raises concerns about the interpretability and auditability of their reasoning processes. If models can achieve correct answers through computations not reflected in the explicit CoT, it becomes harder to understand how they arrive at their conclusions.

Key Results

  • 3SUM Performance: For the 3SUM task, models trained with filler tokens achieved 100% accuracy, while models trained without intermediate tokens performed at near-random accuracy (around 66%) for longer input lengths (up to 12).
  • 2SUM Performance: In the 2SUM task, filler tokens allowed models to recover 90% of the performance benefits seen with chain-of-thought prompting, significantly outperforming immediate-answer models.
  • Scaling Effects: The performance gap between filler-token and immediate-answer models increased with the length and complexity (dimension) of the 3SUM inputs, demonstrating that filler tokens are particularly beneficial for harder problems.
  • Learning Difficulty: Models trained solely on filler tokens or on instance-adaptive CoT data showed limited improvement, highlighting the need for parallelizable CoT demonstrations to effectively train models to utilize filler tokens.

Limitations and Future Work

  • Theoretical vs. Empirical: While theory suggests filler tokens remain within TC<sup>0</sup>, the empirical results show they can unlock problems within TC<sup>0</sup> that standard transformers struggle with. The paper acknowledges the lack of a proven complexity-theoretic hierarchy within TC<sup>0</sup> to fully explain this.
  • Learning Obstacles: The paper identifies significant learning obstacles for filler tokens, particularly the lack of direct supervision and the incompatibility with instance-adaptive CoT. Future work could explore more effective training strategies.
  • Generalizability to Natural Language: The current work focuses on synthetic algorithmic tasks. A key future direction is to understand to what extent token-parallelizable, TC<sup>0</sup> problems arise in natural language contexts and whether natural language text can provide adequate supervision for filler-token computation.
  • Hidden Computations: The authors raise concerns about the implications of hidden computations for LLM interpretability and auditability. Further research is needed to develop methods for understanding and verifying these internal computations.

Summary updated

BibTeX
@inproceedings{pfau2024lets,
  author = {Jacob Pfau and William Merrill and Samuel R. Bowman},
  title = {{Let’s Think Dot by Dot: Hidden computation in transformer language models}},
  booktitle = {COLM},
  year = {2024},
  url = {https://openreview.net/forum?id=NikbrdtYvG},
}
Figure