# Efficiently Representing Algorithms With Chain-of-Thought Transformers

*Yanhong Li, Anej Svete, Ashish Sabharwal, Will Merrill*

[NeurIPS page](https://neurips.cc/virtual/2026/poster/151497) · [Open on the map](../papers.html#p151497)

Category: [Interpretability & Model Adaptation](../pcat/15.md) › [Chain-of-Thought Reasoning in Transformers](../pgroup/310.md) · Type: theory · Keywords: chain-of-thought transformers, Word RAM simulation, theoretical computer science, algorithmic efficiency, poly-logarithmic overhead

Areas: [LLM Reasoning](../areas/reasoning.md) › Reasoning Mechanisms › Chain-of-Thought Reasoning; [Evaluation & Benchmarks](../areas/evaluation.md) › Language Model and Agent Benchmarks › Reasoning Trace Analysis; [Model Architectures & Sequence Modeling](../areas/architectures.md) › Language Model Architectures › Transformer Memory and Reasoning

## Summary
Chain-of-Thought Transformers can efficiently simulate Word RAM algorithms with only poly-logarithmic overhead, even when reasoning is expressed as vectors or combined with a recurrent layer.

## Explained to a 5-year-old
Some computers think out loud before answering. We show that these thinking computers can do many everyday tasks, like sorting a list of numbers, using only a little extra work. They can even do it quickly, even when they have to remember a lot. The ideas also work when the thoughts are not words but numbers, and when they mix thinking with simple memory. This helps us understand how powerful these thinking computers really are.

## Explained to a 5-year-old, longer
A computer that writes down its thoughts before giving an answer is called a reasoning model. We prove that such a model can follow the same steps as classic computer algorithms, like sorting a list of numbers or finding the shortest path in a map. Even though the model thinks step by step, it only needs a little extra time compared to the best algorithms. The proof works for different kinds of reasoning: when thoughts are words, when they are numbers, and when the model mixes word-thinking with a simple memory unit. This shows that reasoning computers are not just guessing; they can actually perform complex tasks efficiently. The results also tell us how much extra time is needed depending on the type of algorithm, which helps us design better AI systems. By understanding these limits, researchers can build more reliable and powerful reasoning models for future applications.

## For a technical reader
The paper establishes rigorous bounds showing that chain-of-thought transformers can simulate Word RAM algorithms with only poly-logarithmic overhead. The analysis covers three architectural variants: finite-precision transformers with rightmost unique hard attention, continuous CoT (vector-valued reasoning), and a hybrid architecture combining transformer layers with a linear recurrent network. The results quantify the overhead for different instruction-set characteristics, providing both theoretical guarantees and insight into practical design choices.

## Problem
It is unknown whether models that generate a series of reasoning steps before giving an answer can efficiently simulate the Word RAM model of computation, which captures the efficiency of classic algorithms. This gap limits confidence in the computational power of such models for real-world algorithmic tasks.

## Method
The authors prove that, under certain architectural constraints, such models can simulate any Word RAM algorithm with only poly-logarithmic overhead. They first analyze finite-precision transformers with rightmost unique hard attention, then extend the proof to continuous reasoning (vector-valued thoughts) and a hybrid architecture that stacks transformer layers on top of a linear recurrent network.

## Results
The models can simulate Word RAM algorithms with poly-logarithmic overhead, achieving log-square overhead for flat instruction sets and only logarithmic overhead for multiplication-free flat instruction sets.

## Contributions
The paper provides the first theoretical proof that reasoning models can efficiently simulate Word RAM algorithms, extending the result to continuous and hybrid architectures and characterizing the overhead for different instruction sets.

## Limitations and assumptions
The results hold for transformers with finite precision, poly-logarithmic width, and rightmost unique hard attention, as well as for continuous CoT and hybrid architectures with finite width and log-precision. The Word RAM model assumes unit-cost operations on O(log n)-bit words.

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. [Suggest a correction](../feedback/?on=p/151497)
