Can Transformers Reason Logically? A Study in SAT Solving
Leyan Pan, Vijay Ganesh, Jacob Abernethy, Chris Esposo, Wenke Lee

TL;DR
This paper investigates the logical reasoning capabilities of decoder-only Transformers for SAT problems, proving their theoretical ability to decide 3-SAT and empirically evaluating their training and generalization properties.
Contribution
It provides a formal proof that Transformers can decide 3-SAT using backtracking and Chain-of-Thought, and introduces a tool to empirically verify and analyze this reasoning ability.
Findings
Transformers can decide 3-SAT in a non-uniform model.
Trained models generalize well to seen problem sizes.
Limited length generalization observed in trained models.
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). %We prove its correctness by showing trace equivalence to the well-known DPLL SAT-solving algorithm. 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 \textit{programming} a transformer to reason, we evaluate empirically whether it can be \textit{trained} to do so by learning directly from algorithmic traces (``reasoning paths'') from our theoretical construction. The trained models demonstrate strong out-of-distribution…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
Taxonomy
TopicsLogic, Reasoning, and Knowledge · Semantic Web and Ontologies · Computability, Logic, AI Algorithms
MethodsAttention Is All You Need · Dense Connections · Residual Connection · Position-Wise Feed-Forward Layer · Adam · Linear Layer · Label Smoothing · Dropout · Byte Pair Encoding · Absolute Position Encodings
