Introduction
NSNet (Neural Satisfiability Network) is a novel Graph Neural Network (GNN) framework that re-imagines Boolean Satisfiability (SAT) and model counting (#SAT) as probabilistic inference tasks. By "neuralizing" the classic Belief Propagation algorithm, NSNet provides an explainable, high-performance bridge between traditional graphical models and modern deep learning, outperforming previous neural solvers in both accuracy and speed.
The Challenge of Neural Satisfiability
The Boolean Satisfiability Problem (SAT) asks if there is an assignment of variables that makes a given logic formula true. Its harder sibling, #SAT, asks how many such assignments exist. While these problems are foundational to computer science—used in everything from hardware design to software verification—they are notoriously difficult (NP-Complete and #P-Complete, respectively).
Traditional solvers rely on hand-engineered heuristics that often struggle with complex, real-world structures. Recent "neural solvers" have attempted to replace these heuristics with deep learning, but they often act as opaque "black boxes." Specifically, most neural SAT solvers try to predict a single satisfying assignment. The authors argue this is a flawed approach: because a formula might have millions of valid solutions, forcing a network to pick just one during training leads to confusion and poor generalization.
Methods: The NSNet Framework
The authors introduce NSNet, which treats satisfiability as a marginal inference problem on a factor graph rather than a direct prediction task.
- Neural Belief Propagation: NSNet is inspired by Belief Propagation (BP), an iterative message-passing algorithm used in graphical models. The researchers designed a GNN where the message-passing rules are not fixed but are instead parameterized by Multi-Layer Perceptrons (MLPs). Crucially, they proved that their architecture "subsumes" standard BP—meaning it can learn to do exactly what BP does, or something much better.
- Graph Representation: Unlike previous models that use literal-clause graphs, NSNet uses a bipartite graph where nodes represent specific variable assignments (e.g., $X_1=\text{True}$ and $X_1=\text{False}$) and clauses.
- SAT via Marginals: Instead of guessing a single solution, NSNet estimates the marginal probability (how likely a variable is to be true across all possible solutions). These probabilities are then rounded to "warm-start" a classic Stochastic Local Search (SLS) solver.
- #SAT via Bethe Approximation: For counting solutions, NSNet learns to estimate the "partition function" of the graph, effectively approximating the total count by learning the Bethe free energy—a concept borrowed from statistical physics.
Key Insights
- Marginals are more stable than assignments: Training a network to understand the distribution of all solutions is much more effective than training it to find one needle in a haystack. This allows the model to generalize from small formulas (e.g., 40 variables) to much larger ones (e.g., 200 variables).
- Latent Space Inference: By performing BP in a high-dimensional latent space, NSNet can capture complex logical dependencies that standard, 1D Belief Propagation misses.
- Explainability by Design: Because the GNN architecture mirrors a well-understood probabilistic algorithm, the hidden representations maintain a clear interpretation: they are neural "messages" about the likelihood of variable assignments.
Datasets and Evaluation
The authors evaluated NSNet on several challenging benchmarks:
- SAT: Synthetic datasets including SR (random SAT/UNSAT pairs), 3-SAT (at the phase transition region), and Community Attachment (CA) (which mimics real-world industrial structures).
- #SAT: The BIRD benchmark (comprising DQMR networks, grid networks, and bit-blasted SMTLIB benchmarks) and the SATLIB benchmark.
- Exact solvers like
bdd_minisat_allandDSharpwere used to generate the "true" marginals and counts needed for ground-truth training data.
Key Results
NSNet demonstrated significant improvements in both solving capability and runtime efficiency.
- Superior Initialization for SAT: When used to initialize a local search solver (Sparrow), NSNet-guided assignments solved significantly more instances than random initialization or even other neural baselines like NeuroSAT.
- Massive Speedups in #SAT: On the BIRD benchmark, NSNet achieved estimates nearly three times more precise than other neural methods.
- Efficiency: Compared to state-of-the-art approximate counters like
ApproxMC3, NSNet provided competitive precision while being three orders of magnitude faster (averaging 0.02 seconds vs. 123 seconds per instance).
Limitations and Future Work
While highly effective, NSNet has a few current limitations. First, its probabilistic formulation is designed strictly for satisfiable instances; it cannot currently provide "certificates of unsatisfiability" (proofs that no solution exists). Second, training requires ground-truth marginals or model counts. For extremely hard instances where even exact solvers fail to provide labels, training NSNet remains a challenge. Finally, while NSNet performs exceptionally well empirically, providing formal theoretical guarantees for the accuracy of its neural marginal estimates remains an important area for future research.
Summary updated