Lune

ICLR2025Top-tier venue

Transformers Provably Solve Parity Efficiently with Chain of Thought

Juno Kim, Taiji Suzuki

Abstract

This work provides the first theoretical analysis of training transformers to solve complex problems by recursively generating intermediate states, analogous to fine-tuning for chain-of-thought (CoT) reasoning. We consider training a one-layer transformer to solve the fundamental k-parity problem, extending the work on RNNs by Wies et al. (2023) . We establish three key results: (1) any finite-precision gradient-based algorithm, without intermediate supervision, requires substantial iterations to solve parity with finite samples. (2) In contrast, when intermediate parities are incorporated into the loss function, our model can learn parity in one gradient update when aided by teacher forcing, where ground-truth labels of the reasoning chain are provided at each generation step. (3) Even without teacher forcing, where the model must generate CoT chains end-to-end, parity can be learned efficiently if augmented data is employed to internally verify the soundness of intermediate steps. Our findings, supported by numerical experiments, show that task decomposition and stepwise reasoning naturally arise from optimizing transformers with CoT; moreover, self-consistency checking can improve multistep reasoning ability, aligning with empirical studies of CoT.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

28 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Transformers Provably Learn Chain-of-Thought Reasoning with Length Generalization cites Large Language Models are Zero-Shot Reasoners
  • Transformers Provably Learn Chain-of-Thought Reasoning with Length Generalization cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • STaR: Bootstrapping Reasoning With Reasoning cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • QLoRA: Efficient Finetuning of Quantized LLMs cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • Large Language Models are Zero-Shot Reasoners cites STaR: Bootstrapping Reasoning With Reasoning
  • Large Language Models are Zero-Shot Reasoners cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • Let's Verify Step by Step cites STaR: Bootstrapping Reasoning With Reasoning
  • Let's Verify Step by Step cites Large Language Models are Zero-Shot Reasoners
  • Let's Verify Step by Step cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • Emergence of Superposition: Unveiling the Training Dynamics of Chain of Continuous Thought cites Transformers Provably Learn Chain-of-Thought Reasoning with Length Generalization
  • Emergence of Superposition: Unveiling the Training Dynamics of Chain of Continuous Thought cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • Let Me Think! A Long Chain of Thought Can Be Worth Exponentially Many Short Ones cites Large Language Models are Zero-Shot Reasoners
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers28

  1. Transformers Provably Learn Chain-of-Thought Reasoning with Length GeneralizationYu Huang, Zixin Wen, Aarti Singh, Yuejie Chi et al.NeurIPS 2025 · 22 citations
  2. Emergence of Superposition: Unveiling the Training Dynamics of Chain of Continuous ThoughtHanlin Zhu, Shibo Hao, Zhiting Hu, Jiantao Jiao et al.ICLR 2026 · 21 citations
  3. Blending Complementary Memory Systems in Hybrid Quadratic-Linear TransformersKazuki Irie, Morris Yau, Samuel J. GershmanNeurIPS 2025 · 13 citations
  4. Let Me Think! A Long Chain of Thought Can Be Worth Exponentially Many Short OnesParsa Mirtaheri, Ezra Edelman, Samy Jelassi, Eran Malach et al.NeurIPS 2025 · 12 citations
  5. Attention Mechanism, Max-Affine Partition, and Universal ApproximationHude Liu, Jerry Yao-Chieh Hu, Zhao Song, Han LiuNeurIPS 2025 · 12 citations

Builds on22

  1. Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma et al.NeurIPS 2022 · 22,562 citations
  2. Large Language Models are Zero-Shot ReasonersTakeshi Kojima, Shixiang Shane Gu, Machel Reid, Yutaka Matsuo et al.NeurIPS 2022 · 8,168 citations
  3. QLoRA: Efficient Finetuning of Quantized LLMsTim Dettmers, Artidoro Pagnoni, Ari Holtzman, Luke ZettlemoyerNeurIPS 2023 · 5,863 citations
  4. Let's Verify Step by StepHunter Lightman, Vineet Kosaraju, Yuri Burda, Harrison Edwards et al.ICLR 2024 · 3,045 citations
  5. STaR: Bootstrapping Reasoning With ReasoningEric Zelikman, Yuhuai Wu, Jesse Mu, Noah D. GoodmanNeurIPS 2022 · 1,126 citations

Related papers

  1. Transformers with RL or SFT Provably Learn Sparse Boolean Functions, But DifferentlyBochen Lyu, Yiyang Jia, Xiaohao Cai, Zhanxing ZhuICML 2026
  2. How Transformers Learn Regular Language Recognition: A Theoretical Study on Training Dynamics and Implicit BiasRuiquan Huang, Yingbin Liang, Jing YangICML 2025
  3. Generalizing Reasoning Problems to Longer LengthsChangnan Xiao, Bing LiuICLR 2025
  4. Transformers Learn to Implement Multi-step Gradient Descent with Chain of ThoughtJianhao Huang, Zixuan Wang, Jason D. LeeICLR 2025
  5. Chain of Thought Empowers Transformers to Solve Inherently Serial ProblemsZhiyuan Liu, Hong Liu, Denny Zhou, Tengyu MaICLR 2024 · 259 citations
Dusk over the sea between two cliffs drawn in fine vertical lines