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 about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
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 on14
- 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
