# Lower Bounds for Chain-of-Thought Reasoning in Hard-Attention Transformers

Chain-of-thought steps for PARITY must grow linearly with input length

Alireza Amiri, Xinting Huang, Mark Rofin, Michael Hahn · arXiv · 2025-2-4

- **Problem** Transformers need chain-of-thought scratchpads for problems like PARITY, but little was known about how short those scratchpads could be. Shorter chains would cut inference cost.
- **Method** The authors use random restrictions to prove lower bounds on chain-of-thought length in the hard-attention UHAT model. The bounds rest on a depth reduction lemma that fixes most inputs.
- **Results** The authors prove that any UHAT chain of thought for PARITY needs length Ω(N). The straightforward prefix-parity chain matches this bound up to constant factors.

![Figure 11: Multiplication: Comparing the number of tokens used in the O(N log N ) NTT CoT (Appendix C.2.3) vs a CoT implementation of the naive O(N 2) algorith…](https://refivu.com/papers/d0ed8609-fa25-4225-88a2-81bbc32dbac9/figures/figure-3d640b5682ce64da893f5528570c82d7.png?thumb=512)

**Figure 11** : Multiplication: Comparing the number of tokens used in the O(N log N ) NTT CoT (Appendix C.2.3) vs a CoT implementation of the naive O(N 2) algorithm. The token count of the NTT CoT is piecewise constant because the length only depends on the prime p used in the construction; length is asymptotically O(N log N ).

[Original paper](https://arxiv.org/abs/2502.02393v3) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Alireza Amiri, Xinting Huang, Mark Rofin, Michael Hahn · Lower Bounds for Chain-of-Thought Reasoning in Hard-Attention Transformers · Original paper figure · Extracted the figure area from page 32 of the original PDF.

## Why chain-of-thought length matters

Chain-of-thought reasoning now runs through many LLM systems, and it lets models tackle harder problems than they can answer directly. The cost is real, because a long CoT can add many tokens and raise inference cost. Little was known about how short a CoT could get for a given problem.

PARITY is the running example: it asks whether a bit string holds an even or odd number of 1s. Transformers struggle to learn it on longer inputs, but a CoT of growing prefix parities resolves this. That CoT costs a linear number of extra decoding steps, written Θ(N), for an input of length N. Figure 1 shows the idea: a CoT splits such a problem into local steps that each depend on few tokens.

![Figure 1: High-sensitivity problems such as PARITY are dif- ficult to learnably and generalizably represent for transform- ers. Such problems can be solved by…](https://refivu.com/papers/d0ed8609-fa25-4225-88a2-81bbc32dbac9/figures/figure-51c3492d6f470bf59eb6a57092cbf01f.png?thumb=512)

**Figure 1** : High-sensitivity problems such as PARITY are dif- ficult to learnably and generalizably represent for transform- ers. Such problems can be solved by CoTs decomposing them into a sequence of local steps. We study the length that such CoTs need to have, as a function of the input length.

[Original paper](https://arxiv.org/abs/2502.02393v3) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)

Average sensitivity explains why PARITY is hard for transformers. For PARITY the average sensitivity equals N, because flipping any bit flips the output. Earlier work links such high sensitivity to sharp loss minima and to poor learning on long inputs. The authors extend the same lens to MULTIPLICATION, MEDIAN and REACHABILITY, and focus on tasks with average sensitivity Θ(N).

The central question is whether the linear CoT is optimal, or whether a shorter one could exist. The authors pursue explicit and unconditional bounds on CoT length, instead of conditional ones.

## The UHAT model and the CoT definition

The authors work in unique hard attention (UHAT), where each head attends only to the position with the maximal attention score. When several positions tie for the maximum, a fixed rule picks one, such as the leftmost or rightmost match. UHAT can be seen as the limit of softmax attention when one attention score far exceeds the others. The attention output is a weighted sum over earlier positions, passed through a linear value map and summed across heads with a skip connection.

The feed-forward network is left arbitrary, so the bounds don't depend on its exact form.

Because the expressiveness of softmax transformers at fixed precision is upper-bounded by UHAT, a lower bound proven here carries over to them. The authors use causal masking, which matches standard autoregressive language models and allows the CoT to be generated token by token. They also note that the techniques still apply when the input is processed with bidirectional attention.

A CoT is a map from an input to a longer string over a larger alphabet that ends with the answer f(x). The CoT length is measured as a function of input length, taking the worst case over all inputs of that length. The definition only asks that a family of transformers with bounded layers and heads computes the CoT, rather than one transformer for all lengths.

A transformer computes the CoT when its output at each CoT position is a one-hot vector on the next CoT symbol.

The width of the transformers may grow with the input, which lets positional encodings keep unboundedly many positions distinct. The authors regard this as a weak requirement, one that is still enough for matching lower and upper bounds. Universality results show that UHAT CoTs can simulate Turing machines, with length linear in the machine's running time.

## A restriction argument for CoT length

The main technical tool is the method of random restrictions, which the authors use to bound the length of CoTs for transformers. Random restrictions are a standard technique for understanding bounded-depth circuits, and the authors carry them over to transformers including CoTs. A restriction assigns each input position either a fixed symbol or a star, which marks the position as left free.

The generic bound states that a UHAT-expressible CoT of length o(\|x\|) forces a restriction that leaves a constant fraction of positions open. Under that restriction, f is constant on all inputs that match it, so the output is fixed even though many bits stay free.

The proof rests on Lemma 3.4, which the authors describe as an analogue of the classical Switching Lemma for AC0 circuits. The lemma works by randomizing the restriction and showing that the probability of the desired properties is nonzero, so a satisfying restriction exists. The Depth Reduction Lemma, which Hahn (2020) proved, underlies it, and the authors state a stronger version covering all activations.

Under a restriction that keeps a constant fraction free, a UHAT c-Transformer with L layers becomes one with L minus 1 layers that gives the same activations on restricted inputs. Applying this lemma L times yields a single restriction under which each activation depends on a bounded number of input positions. The authors note that a single restriction is needed, because applying Hahn's result layer by layer would give L separate restrictions.

The CoT argument fixes the CoT one token at a time, starting from the restriction that fixes all activations. Each new CoT token's activations are fixed by treating layers and heads in order, and each head is forced to attend to a chosen position. Forcing one head's attention costs at most c input symbols per layer and head, so each CoT step costs at most c·L·H further input positions.

In total the restriction fixes c·H·L·\|g(x)\| inputs, which is o(N) when the CoT is sublinear. So a constant fraction of inputs stays free while the output, which is part of the CoT, stays fixed.

The authors note that the argument also holds under bidirectional attention on the input, with causal masking applied only during CoT generation. They didn't need the input to be processed causally for the depth reduction to go through.

## PARITY: the bound and its tightness

The main claim is that any UHAT CoT for PARITY needs length Ω(N), and the paper proves this from its generic bound.

The bound is tight, because the straightforward CoT of parities of increasing prefixes reaches it. That CoT uses a length that is linear in N, so the lower bound and the construction match up to constant factors. The authors separate this result from learnability work on subset parities, since the full PARITY function applies to one specific set U = {1, .

. . , N}. Learnability results on subset parities don't readily imply that causal transformers find the full PARITY function hard to learn.

The result might look trivial, since every bit matters and a hard attention head attends to only one position. It isn't trivial, because the position a head attends to depends on the input, so the input can influence every head. Fixing a fraction of input bits is enough to distract all attention heads and keep them from seeing the full input.

The AND function shows the contrast, since a single head can find one zero without reading every bit.

## Why filler-token CoTs don't help PARITY

Dot-by-dot CoTs repeat a single filler token, which may give a transformer extra computation without any visible intermediate steps. The authors show that a UHAT dot-by-dot CoT for PARITY must have length ω(\|x\|^k) for every k. That predicting function has average sensitivity N, and UHAT lies inside AC0, which bounds average sensitivity by O(poly(log(n))).

Combining these gives N = O(poly(log(N + \|g(x)\|))), so \|g(x)\| can't be bounded by a polynomial of N.

The filler length must therefore grow faster than any polynomial in the input length. An exponentially long UHAT dot-by-dot CoT does exist, and the authors build it with two layers and one attention head. Its scratchpad has length 2N + 2, and d = 2N hidden dimensions are used. The first layer checks, at each filler position, whether the input string equals a given bit string ξ(i), using a query that looks for mismatched bits.

The second layer then predicts the hard-coded parity from these checks. Together, the two results give a super-polynomial separation between Θ(N) explicit steps and filler steps.

In experiments, the dot-by-dot variant helped much less than the full prefix-parity CoT. The dot-by-dot variant did not extend the input lengths at which a transformer was learned successfully. The authors trained these models on PARITY, so the failure is measured on learned transformers rather than on the proof's UHAT construction.

## MULTIPLICATION and MEDIAN bounds

Multiplication is hard for transformers because its middle output digits are highly sensitive to the input bits. The authors examine single digits of the product of two N-digit binary numbers, and each of the 2N output digits is a separate question. Theorem 4.5 states that a UHAT CoT for the digit MN requires length Ω(N). That bound concerns direct decoding of one digit, and the authors note that it holds for arbitrary positional encoding vectors.

Addition doesn't face this hurdle, because any digit has at most polylogarithmic average sensitivity. That low sensitivity comes from an AC0 construction for adding N-digit numbers without CoT, so each digit can be output in parallel. Earlier multiplication scratchpads used the grade-school algorithm, which has Θ(N²) complexity, far above the Ω(N) lower bound.

The authors give a UHAT scratchpad for the full product M1 . . . M2N with length Θ(N log N), built on the Fourier transform.

Without a CoT, multiplication failed to generalize, and the difficulty was driven by the high-sensitivity middle digits. Figure 3 shows a transformer trained on 12-digit multiplication, where accuracy drops for the middle digits even when the ends are predicted exactly. The O(N log N) CoT succeeded at all lengths up to 16, as shown in Table 1.

![Figure 3: Accuracy of a transformer trained on autoregres- sive 12-digit multiplication (most significant digit at the left, zero-padded on the left), on a tes…](https://refivu.com/papers/d0ed8609-fa25-4225-88a2-81bbc32dbac9/figures/figure-8b81685714038ef4f2fc17973b4fde0c.png?thumb=512)

**Figure 3** : Accuracy of a transformer trained on autoregres- sive 12-digit multiplication (most significant digit at the left, zero-padded on the left), on a test set with 10K number pairs. High-sensitivity digits in the middle show substan- tially decreased accuracy even if digits at beginning and end are predicted exactly. See Figure 8 for more.

[Original paper](https://arxiv.org/abs/2502.02393v3) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)

Theorem 4.8 states that a UHAT scratchpad for MEDIAN requires length Ω(N), and this bound is attained. The attaining CoT enumerates the lowest ⌊N/2⌋ numbers, and the model succeeds with the full CoT across input lengths.

## Reachability on restricted DAGs

Reachability is NL-complete even on directed acyclic graphs, so it is expected to be hard for transformers without CoT. The authors don't rely on that conjecture for their bound, because they work with a sub-family of DAGs where reachability is in TC0. They obtain the unconditional bound by observing that PARITY reduces to DAG reachability.

The proof codes PARITY into DAGs with 2N vertices for the lower bound. For the upper bound, breadth-first search is coded into a CoT. The result is a UHAT CoT length of Ω(\|E\| log \|V\|), and this bound is attained.

The authors trained Transformers on random DAGs with 5 to 35 vertices. They used an O(\|E\| log \|V\|)-length scratchpad to solve the DAG reachability task in the general case. Figure 4 shows that a CoT of this length gives a perfect accuracy independent of the graph size.

Dot-by-dot CoTs, which repeat a single token, are a separate case the authors also examine. For PARITY, a dot-by-dot CoT cannot have polynomially bounded length.

## Training results across the four tasks

The authors trained transformers on PARITY with input lengths from 1 to 500, averaging results over three runs. The full prefix-parity CoT succeeded even on very long inputs, with CoT lengths of Θ(N). Giving only every k-th step of the CoT still worked when k was at most about 3. Dot-by-dot scratchpads helped much less, so the experiment checks the Theorem 4.11 prediction against the full CoT.

The authors also checked DeepSeek-R1 and o1-mini, which produced CoTs of at least linear length.

For multiplication, the authors trained small transformers with 2 layers and 2 heads on binary numbers with up to 16 digits. Multiplication failed to generalize without a CoT, and the difficulty came from the high-sensitivity middle digits. With the O(N log N) CoT from Theorem 4.6, the transformers succeeded at all lengths up to 16. The authors focused their experiments on numbers up to this length because of resource constraints.

For MEDIAN, the authors trained transformers on input lengths between 6 and 398, corresponding to 1 to 99 decimal numbers. With the full CoT, the model was always successful across input lengths. Keeping only every k-th step, starting from the smallest number, produced a chance of failure once k reached 2 or more. Accuracies in these runs were averaged over 3 runs.

For DAG reachability, the authors generated random DAGs with 5 to 35 vertices. A scratchpad of length O(\|E\| log \|V\|) led to perfect accuracy independent of graph size.

## Where the bounds stop

The lower bounds are worst-case results, so they cover the hardest input of each length rather than typical inputs. Average-case bounds are left open, and the authors describe providing them as an interesting problem for future research. The bounds are proven only for the UHAT model, so they don't directly transfer to other formal transformer models.

Log-precision transformers are one example of such a model, and the authors pose whether these could allow substantially shorter but still learnable CoTs.

The problem also requires that such a CoT be practically learnable, which is a condition the lower bounds don't address. A positive answer would matter for real-world LLMs, and the authors say it would likely need further progress on learnability. A negative answer would instead suggest that tool use or architectural improvements are unavoidable, even on many TC0 problems.

The authors note that a negative answer would point to tool use or architectural change. Definition 2.2 lets a different transformer be used at every input length, which the authors acknowledge is less realistic. Their reason is that a single fixed-width transformer may struggle across unboundedly many input lengths without very specific positional encodings.

The authors also argue that softmax transformers are bounded by TC0, while UHAT is bounded by AC0.

## What the bounds mean for shortening CoTs

The paper's bounds show that the UHAT CoT length must grow with the input length for several tasks. Because of this, they suggest barriers to self-attention solving these tasks with small inference-time compute. A common idea for cutting inference cost is fine-tuning transformers to reason in fewer and fewer steps, as in Deng et al. (2024).

The authors argue that such fine-tuning is likely to run up against representational limits of the architecture. They note that the findings point to efficiency limits on CoT reasoning that tool use or stronger architectures might overcome.

The paper names logarithmic growth of depth as one possible way around these limits, citing Merrill & Sabharwal (2024b). Within fixed-depth architectures, certain SSM architectures overcome at least the difficulty of PARITY, according to Grazzi et al. (2024). Whether this extends to the other problems from Sections 4.1 to 4.4 is left for future understanding.

## Paper info

- **Authors**: Alireza Amiri, Xinting Huang, Mark Rofin, Michael Hahn
- **Venue**: arXiv · Preprint
- **First published**: 2025-2-4
- **Added**: 2026-10-31
- **Updated**: 2025-7-12
- **Version**: v3
- **arXiv**: 2502.02393
- **Category**: cs.LG · cs.CC
- **Original paper terms**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **What we show**: Paper info, commentary and permitted figures from the original paper

[Original paper ↗](https://arxiv.org/abs/2502.02393v3) · [PDF ↗](https://arxiv.org/pdf/2502.02393v3)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Abstract

Chain-of-thought reasoning and scratchpads have emerged as critical tools for enhancing the computational capabilities of transformers. While theoretical results show that polynomial-length scratchpads can extend transformers' expressivity from $TC^0$ to $PTIME$, their required length remains poorly understood. Empirical evidence even suggests that transformers need scratchpads even for many problems in $TC^0$, such as Parity or Multiplication, challenging optimistic bounds derived from circuit complexity. In this work, we initiate the study of systematic lower bounds for the number of chain-of-thought steps across different algorithmic problems, in the hard-attention regime. We study a variety of algorithmic problems, and provide bounds that are tight up to logarithmic factors. Overall, these results contribute to emerging understanding of the power and limitations of chain-of-thought reasoning.

## Quote from the paper

Alireza Amiri, Xinting Huang, Mark Rofin, Michael Hahn (2025). Lower Bounds for Chain-of-Thought Reasoning in Hard-Attention Transformers. arXiv:2502.02393v3. https://arxiv.org/abs/2502.02393v3

**BibTeX**

```
@misc{amiri2025lower,
  title = {{Lower Bounds for Chain-of-Thought Reasoning in Hard-Attention Transformers}},
  author = {Alireza Amiri and Xinting Huang and Mark Rofin and Michael Hahn},
  year = {2025},
  eprint = {2502.02393},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.02393v3}
}
```

## Related papers

- [A Fine-Grained Hierarchy and Benchmark for State Tracking in Language Models](https://refivu.com/en/papers/cd3daf60-866c-48b4-9114-bda9fdde8e0c-a-fine-grained-hierarchy-and-benchmark-for-state.md)
- [Linear Probes to Bayesian Manifolds: Geometry of Arithmetic in Large Language Models](https://refivu.com/en/papers/3a9ec079-bad6-4e92-972e-4cfe8b21529a-linear-probes-to-bayesian-manifolds-geometry-of-arithmetic.md)
- [DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning](https://refivu.com/en/papers/2227da56-269c-4116-84dc-2bc76bf3e6c7-deepseek-r1-incentivizing-reasoning-capability-in-llms-via.md)
- [The Llama 3 Herd of Models](https://refivu.com/en/papers/27985e84-42ca-486e-8e0e-2fa739789ab4-the-llama-3-herd-of-models.md)
- [Ehrenfeucht-Haussler Rank and Chain of Thought](https://refivu.com/en/papers/cd83075a-e02f-4d42-b023-d9aff551bfbf-ehrenfeucht-haussler-rank-and-chain-of-thought.md)
- [PianoBench: Evaluating Musical Perception and Reasoning in Language Models](https://refivu.com/en/papers/303d2599-ed54-4e1e-92e2-9ef775204ad7-pianobench-evaluating-musical-perception-and-reasoning-in.md)

## Other paper commentary

- [Let's Verify Step by Step](https://refivu.com/en/papers/389050a4-3045-4cce-994c-b4c5da04031a-let-s-verify-step-by-step.md)
- [STaR: Bootstrapping Reasoning With Reasoning](https://refivu.com/en/papers/2942117a-1b64-4434-bef7-4f70b61ab603-star-bootstrapping-reasoning-with-reasoning.md)
- [Self-Consistency Improves Chain of Thought Reasoning in Language Models](https://refivu.com/en/papers/be407503-de73-4a1d-9790-4b944a0560a9-self-consistency-improves-chain-of-thought-reasoning-in.md)
- [Chain-of-Thought Hidden States Reveal Task-Solving Directions for Direct Answers](https://refivu.com/en/papers/8a23f0af-7204-4d01-8549-f9ad8f063856-chain-of-thought-hidden-states-reveal-task-solving.md)
- [Learning-Order Autoregressive Models with Application to Molecular Graph Generation](https://refivu.com/en/papers/504d6ec4-8539-4bc7-b02b-fe990e79896e-learning-order-autoregressive-models-with-application-to.md)
- [DataDecide: How to Predict Best Pretraining Data with Small Experiments](https://refivu.com/en/papers/b2e5b927-f525-4063-8956-246603aff1fb-datadecide-how-to-predict-best-pretraining-data-with.md)
- [Subgroups Matter for Robust Bias Mitigation](https://refivu.com/en/papers/2a39c8a2-c675-4178-942e-a231ced5722f-subgroups-matter-for-robust-bias-mitigation.md)
- [From Generative to Episodic: Sample-Efficient Replicable Reinforcement Learning](https://refivu.com/en/papers/b78b13e6-6d29-4338-85d7-9e0fdb6ad862-from-generative-to-episodic-sample-efficient-replicable.md)
- [Improving Transformer World Models for Data-Efficient RL](https://refivu.com/en/papers/bf0a569b-7476-4cd0-91b8-a28e0935c805-improving-transformer-world-models-for-data-efficient-rl.md)
- [Geometry-Informed Neural Networks](https://refivu.com/en/papers/da0a16b6-9d7a-4d46-a972-fe3929ea063a-geometry-informed-neural-networks.md)
- [The Surprising Agreement Between Convex Optimization Theory and Learning-Rate Scheduling for Large Model Training](https://refivu.com/en/papers/3a431e7f-c68b-477b-a0ef-073c8d045e7b-the-surprising-agreement-between-convex-optimization-theory.md)
- [History-Guided Video Diffusion](https://refivu.com/en/papers/6108fb68-ef01-4b85-84db-35036f8a36f4-history-guided-video-diffusion.md)

## Terms in this paper

- [Accuracy](https://refivu.com/en/terms/1995c0cd6282-accuracy)
- [chain-of-thought](https://refivu.com/en/terms/f224ebaf1832-chain-of-thought)
- [Transformers](https://refivu.com/en/terms/ab75807099b0-transformers)
- [Chain-of-Thought (CoT)](https://refivu.com/en/terms/fb95d6ae063c-chain-of-thought-cot)
- [Softmax attention](https://refivu.com/en/terms/140344948263-softmax-attention)
- [DeepSeek-R1](https://refivu.com/en/terms/4b84963a20ba-deepseek-r1)
- [REACHABILITY](https://refivu.com/en/terms/3a42c34b64c9-reachability)
- [average sensitivity](https://refivu.com/en/terms/7571da9d4a1c-average-sensitivity)
- [MULTIPLICATION](https://refivu.com/en/terms/4853a7495303-multiplication)
- [PARITY](https://refivu.com/en/terms/8daba0093e07-parity)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/d0ed8609-fa25-4225-88a2-81bbc32dbac9-lower-bounds-for-chain-of-thought-reasoning-in)
