The Propositional Satisfiability problem (SAT) is the foundational NP-complete problem. It asks a simple question: given a Boolean logic formula, is there an assignment of True/False to its variables that makes the entire formula True? Modern SAT solvers (like MiniSAT) are highly engineered marvels used in hardware verification, scheduling, and more. However, they rely heavily on hand-crafted heuristics developed over decades of research.
Researchers have recently asked a fundamental question: Can a neural network learn the "logic" of SAT from scratch? Specifically, can it learn to solve these complex problems if it is only told whether a formula is satisfiable or not, without ever being shown a correct assignment or a specific search strategy?
To answer this, they developed NeuroSAT, a message-passing neural network. Remarkably, while trained only as a classifier with a single bit of supervision ("Is this formula satisfiable?"), NeuroSAT learns to find actual satisfying assignments and generalizes to problems much larger and more complex than those seen during training.
The NeuroSAT Architecture
NeuroSAT is designed as a Message Passing Neural Network (MPNN) that operates on a graph representation of SAT formulas.
- Graph Representation: A SAT formula is represented as a bipartite graph. One set of nodes represents literals (variables and their negations, e.g., $x$ and $\neg x$), and the other represents clauses (the logical constraints).
- Invariances: The architecture is built to be "permutation invariant" (the order of variables or clauses does not matter) and "negation invariant" (swapping $x$ and $\neg x$ throughout the formula does not change the underlying logic).
- Message Passing: The network runs for $T$ iterations. In each step, clauses receive messages from their connected literals, and literals receive messages from their connected clauses as well as their "complement" literal (e.g., $x$ receives a message from $\neg x$). These state updates are managed by Long Short-Term Memory (LSTM) networks.
- The "Vote": After $T$ iterations, each literal node "votes" on whether the formula is satisfiable. The average of these votes forms the final prediction.
Training on Single-Bit Supervision
The model was trained on a custom distribution of random SAT problems called SR(n), where $n$ is the number of variables. To prevent the model from "cheating" by relying on simple statistical cues (like clause-to-variable ratios), the researchers generated pairs of problems that differ by only a single bit (negating one literal in one clause). In each pair, one problem is satisfiable and the other is not.
NeuroSAT was trained on SR(U(10, 40))—problems containing between 10 and 40 variables. It was then evaluated on larger versions of SR (up to $n=200$) and entirely different domains like graph coloring, clique detection, and vertex cover, all encoded as SAT problems.
Key Insights: Phase Transitions and Emergent Solving
The most fascinating behavior of NeuroSAT emerges during its iterative message-passing phase.
- The Phase Transition: When running on a satisfiable problem, the network's confidence typically remains low for many iterations. Suddenly, it undergoes a "phase transition." The literal embeddings cluster into two distinct groups, and the network's confidence that the problem is satisfiable spikes dramatically.
- Emergent Solving: Even though NeuroSAT was only trained to output a "Yes/No" classification, the clusters that form during this phase transition actually correspond to a satisfying assignment. By clustering the literal embeddings using k-means, the researchers could decode the exact solution.
- Generalization through Iteration: NeuroSAT generalizes to much larger problems simply by running for more message-passing iterations at test time than it did during training. This indicates it learns a procedure for search, rather than a static mapping.
- Cross-Domain Success: Because all NP-complete problems can be reduced to SAT, a model that truly "understands" SAT should be able to solve others. After training only on random SAT problems, NeuroSAT successfully solved graph coloring and clique detection problems.
Performance and Limitations
On the SR(40) test set, NeuroSAT achieved an impressive 85% classification accuracy and successfully found satisfying assignments for 70% of the satisfiable problems. Furthermore, despite being trained on at most 40 variables, it solved 25% of problems with 200 variables simply by increasing the iteration count. It also outperformed "Survey Propagation" (a standard message-passing algorithm) on the specific graph-based distributions tested.
However, NeuroSAT is currently a proof-of-concept for neural logic and is not yet a replacement for industrial tools. It is significantly slower and less reliable than highly optimized C++ SAT solvers like MiniSAT. Additionally, while it excels at finding solutions, it cannot provide a "certificate" or proof when a problem is unsatisfiable.
Future directions suggest that neural solvers like NeuroSAT could eventually be used to provide better heuristics for traditional solvers or be fine-tuned on specific distributions of problems (like hardware circuits) where traditional heuristics currently struggle.
Summary updated