Abstract
We propose an incomplete algorithm for Maximum Satisfiability (MaxSAT) specifically designed to run on neural network accelerators such as GPUs and TPUs. Given a MaxSAT problem instance in conjunctive normal form, our procedure constructs a Restricted Boltzmann Machine (RBM) with an equilibrium distribution wherein the probability of a Boolean assignment is exponential in the number of clauses it satisfies. Block Gibbs sampling is used to stochastically search the space of assignments with parallel Markov chains. Since matrix multiplication is the main computational primitive for block Gibbs sampling in an RBM, our approach leads to an elegantly simple algorithm (40 lines of JAX) well-suited for neural network accelerators. Theoretical results about RBMs guarantee that the required number of visible and hidden units of the RBM scale only linearly with the number of variables and constant-sized clauses in the MaxSAT instance, ensuring that the computational cost of a Gibbs step scales reasonably with the instance size. Search throughput can be increased by batching parallel chains within a single accelerator as well as by distributing them across multiple accelerators. As a further enhancement, a heuristic based on unit propagation running on CPU is periodically applied to the sampled assignments. Our approach, which we term RbmSAT, is a new design point in the algorithm-hardware co-design space for MaxSAT. We present timed results on a subset of problem instances from the annual MaxSAT Evaluation's Incomplete Unweighted Track for the years 2018 to 2021. When allotted the same running time and CPU compute budget (but no TPUs), RbmSAT outperforms other participating solvers on problems drawn from three out of the four years' competitions. Given the same running time on a TPU cluster for which RbmSAT is uniquely designed, it outperforms all solvers on problems drawn from all four years.
Introduction
Boolean Satisfiability (SAT) and its optimization variant, MaxSAT, are foundational NP-hard problems with applications ranging from hardware verification to scheduling. Historically, the most effective solvers have been designed for CPUs, utilizing complex sequential algorithms like Conflict-Driven Clause Learning (CDCL). However, as CPU performance gains plateau, these solvers struggle to leverage modern hardware accelerators like Tensor Processing Units (TPUs) and GPUs, which are optimized for massive parallel matrix operations.
DeepMind researchers have introduced RbmSAT, a novel algorithm-hardware co-design that transforms MaxSAT into a sampling task for Restricted Boltzmann Machines (RBMs). By reframing logical optimization as matrix multiplication, RbmSAT utilizes the high throughput of modern accelerators to outperform state-of-the-art CPU-based solvers.
Methods: RBM Mapping and Parallel Sampling
The core innovation of RbmSAT is the mapping of a MaxSAT problem onto the architecture of an RBM.
- RBM Mapping: Boolean variables are mapped to "visible units," while each clause in the formula is represented by a set of "hidden units."
- Energy Function Design: The RBM's weights are configured such that the energy function corresponds to the number of unsatisfied clauses. Lower energy states (higher probability) represent assignments that satisfy more clauses.
- Block Gibbs Sampling: The bipartite structure of the RBM allows for "Block Gibbs Sampling," where all variables can be updated in parallel using matrix multiplication. This is the primary computational primitive of AI accelerators.
- Hybrid Heuristic: To avoid local minima, the system periodically offloads samples to a CPU. The CPU applies a "unit propagation" heuristic to refine assignments before returning them to the TPU cluster for further parallel sampling.
The implementation is remarkably efficient, requiring only about 40 lines of JAX code to define the core solver.
Experimental Evaluation
The authors evaluated RbmSAT using instances from the annual MaxSAT Evaluations (2018–2021), focusing on the "Incomplete Unweighted Track." The test set included 92 unique instances with up to 10,000 variables and 100,000 clauses, constrained by current memory implementation limits.
Key Results
RbmSAT demonstrates significant performance gains when scaled across hardware accelerators.
- TPU Dominance: On a 64-TPU cluster, RbmSAT achieved a higher average "incomplete score" than all participating solvers from the 2018–2021 evaluations.
- CPU Competitiveness: Even when restricted to a single CPU to match competitors' hardware, RbmSAT outperformed other solvers in three of the four competition years.
- Scaling Gains: For the 2018 and 2019 benchmarks, RbmSAT on TPUs showed improvements of 24.9% and 23.2%, respectively, over the next best solvers.
Discussion and Future Work
RbmSAT represents a shift from deep sequential search to wide parallel stochastic search. By treating discrete logic as a continuous probability distribution, the algorithm unlocks the power of "Matrix Multiplication Units" (MXUs) on TPUs. A key finding was that learning RBM weights to fit the energy function improved "mixing" speed compared to purely analytical weight calculation.
Limitations: The current implementation uses padding for clause sizes, which can be memory-inefficient for formulas with heterogeneous clause lengths. Additionally, as an incomplete solver, RbmSAT cannot prove unsatisfiability.
Future Directions: Future work includes extending the framework to Weighted MaxSAT and applying it to #SAT (model counting) using techniques like Annealed Importance Sampling (AIS).
Summary updated