torchmSAT: A GPU-Accelerated Approximation To The Maximum Satisfiability Problem
Abdelrahman Hosny, Sherief Reda
TL;DR
This work tackles NP-hard MaxSAT by introducing torchmSAT, a differentiable, oracle-free solver that encodes a CNF instance into a fixed matrix $W$ and optimizes a relaxable variable vector $\mathbf{x}$ through a single differentiable function $f(\mathbf{x})$, solving via backpropagation. The method computes an unsatisfaction vector $\mathcal{U}=f(\mathbf{x})$ and uses a masked mean-squared error loss to iteratively refine $\mathbf{x}$, with a projection $\mathbf{x}'$ mapping back to Boolean assignments and a condition $\mathbf{x}' \cdot W = \mathbf{s}$ to identify unsatisfied clauses. Unlike traditional solvers that rely on a SAT oracle, torchmSAT is progressive and GPU-accelerated, and experiments show it outperforms two baselines while matching a third on several challenging instances, highlighting the potential of neural, LP-relaxation–inspired approaches for combinatorial optimization. The work thus proposes a new class of neural solvers for NP-hard problems that leverage differentiable optimization and hardware acceleration to explore solution spaces without labeled data or external SAT calls.
Abstract
The remarkable achievements of machine learning techniques in analyzing discrete structures have drawn significant attention towards their integration into combinatorial optimization algorithms. Typically, these methodologies improve existing solvers by injecting learned models within the solving loop to enhance the efficiency of the search process. In this work, we derive a single differentiable function capable of approximating solutions for the Maximum Satisfiability Problem (MaxSAT). Then, we present a novel neural network architecture to model our differentiable function, and progressively solve MaxSAT using backpropagation. This approach eliminates the need for labeled data or a neural network training phase, as the training process functions as the solving algorithm. Additionally, we leverage the computational power of GPUs to accelerate these computations. Experimental results on challenging MaxSAT instances show that our proposed methodology outperforms two existing MaxSAT solvers, and is on par with another in terms of solution cost, without necessitating any training or access to an underlying SAT solver. Given that numerous NP-hard problems can be reduced to MaxSAT, our novel technique paves the way for a new generation of solvers poised to benefit from neural network GPU acceleration.
