Can Transformers Reason Logically? A Study in SAT Solving
Leyan Pan, Vijay Ganesh, Jacob D. Abernethy, Chris Esposo, Wenke Lee
Abstract
We formally study the logical reasoning capabilities of decoder-only Transformers in the context of the boolean satisfiability (SAT) problem. First, we prove by construction that decoder-only Transformers can decide 3-SAT, in a non-uniform model of computation, using backtracking and deduction via Chain-of-Thought (CoT). Second, we implement our construction as a PyTorch model with a tool (PARAT) that we designed to empirically demonstrate its correctness and investigate its properties. Third, rather than programming a transformer to reason, we evaluate empirically whether it can be trained to do so by learning directly from algorithmic traces ("reasoning paths") from our theoretical construction. The trained models demonstrate strong out-ofdistribution generalization on problem sizes seen during training but have limited length generalization, which is consistent with the implications of our theoretical result.
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.
5 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- The Expressive Power of Transformers with Chain of Thought cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- The Expressive Power of Transformers with Chain of Thought cites Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspective
- SATURN: SAT-based Reinforcement Learning to Unleash LLMs Reasoning cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Evaluating Robustness of Reasoning Models on Parameterized Logical Problems cites SATBench: Benchmarking LLMs' Logical Reasoning via Automated Puzzle Generation from SAT Formulas
- SATBench: Benchmarking LLMs' Logical Reasoning via Automated Puzzle Generation from SAT Formulas cites ZebraLogic: On the Scaling Limits of LLMs for Logical Reasoning
- Chain of Thought Empowers Transformers to Solve Inherently Serial Problems cites Thinking Like Transformers
- Chain of Thought Empowers Transformers to Solve Inherently Serial Problems cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Chain of Thought Empowers Transformers to Solve Inherently Serial Problems cites Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspective
- ZebraLogic: On the Scaling Limits of LLMs for Logical Reasoning cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspective cites Thinking Like Transformers
- Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspective cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
Cited by top-tier papers5
- SATURN: SAT-based Reinforcement Learning to Unleash LLMs ReasoningHuanyu Liu, Ge Li, Jia Li, Hao Zhu et al.NeurIPS 2025 · 1 citation
- Evaluating Robustness of Reasoning Models on Parameterized Logical ProblemsNaïm Es-sebbani, Esteban Marquer, Yakoub Salhi, Zied BouraouiICML 2026 · 1 citation
- SATBench: Benchmarking LLMs' Logical Reasoning via Automated Puzzle Generation from SAT FormulasAnjiang Wei, Yuheng Wu, Yingjia Wan, Tarun Suresh et al.EMNLP 2025 · 1 citation
- ZebraLogic: On the Scaling Limits of LLMs for Logical ReasoningBill Yuchen Lin, Ronan Le Bras, Kyle Richardson, Ashish Sabharwal et al.ICML 2025
- Boolean Satisfiability via Imitation LearningZewei Zhang, Huan Liu, Yuanhao Yu, Jun Chen et al.ICLR 2026
Builds on17
- Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma et al.NeurIPS 2022 · 22,562 citations
- Towards Revealing the Mystery behind Chain of Thought: A Theoretical PerspectiveGuhao Feng, Bohang Zhang, Yuntian Gu, Haotian Ye et al.NeurIPS 2023 · 470 citations
- Chain of Thought Empowers Transformers to Solve Inherently Serial ProblemsZhiyuan Liu, Hong Liu, Denny Zhou, Tengyu MaICLR 2024 · 259 citations
- The Expressive Power of Transformers with Chain of ThoughtWilliam Merrill, Ashish SabharwalICLR 2024 · 243 citations
- Thinking Like TransformersGail Weiss, Yoav Goldberg, Eran YahavICML 2021 · 183 citations
Related papers
- On the Bias of Next-Token Predictors Toward Systematically Inefficient Reasoning: A Shortest-Path Case StudyRiccardo Alberghi, Elizaveta Demyanenko, Luca Biggio, Luca SagliettiNeurIPS 2025 · 2 citations
- Chain-of-Thought Provably Enables Learning the (Otherwise) UnlearnableChenxiao Yang, Zhiyuan Li, David WipfICLR 2025
- Generalizing Reasoning Problems to Longer LengthsChangnan Xiao, Bing LiuICLR 2025
- Multi-head Transformers Provably Learn Symbolic Multi-step Reasoning via Gradient DescentTong Yang, Yu Huang, Yingbin Liang, Yuejie ChiNeurIPS 2025 · 8 citations
- Transformers with RL or SFT Provably Learn Sparse Boolean Functions, But DifferentlyBochen Lyu, Yiyang Jia, Xiaohao Cai, Zhanxing ZhuICML 2026
