PDP: A General Neural Framework for Learning SAT Solvers

1 INTRODUCTION . Constraint satisfaction problems ( CSP ) ( Kumar , 1992 ) and Boolean Satisfiability ( SAT ) , in particular , are the most fundamental NP-complete problems in Computer Science with a wide range of applications from verification to planning and scheduling . There have been huge efforts in Computer Science ( Biere et al. , 2009a ; Knuth , 2015 ; Nudelman et al. , 2004 ; Ansótegui et al. , 2008 ; 2012 ; Newsham et al. , 2014 ) as well as Physics and Information Theory ( Mezard & Montanari , 2009 ; Krzakała et al. , 2007 ) to both understand the theoretical aspects of SAT and develop efficient search algorithms to solve it . Furthermore , since in many real applications , the problem instances are often drawn from a narrow distribution , using Machine Learning to build data-driven solvers which can learn domain-specific search strategies is a natural choice . In that vein , Machine Learning has been used for different aspects of CSP and SAT solving , from branch prediction ( Liang et al. , 2016 ) to algorithm and hyper-parameter selection ( Xu et al. , 2008 ; Hutter et al. , 2011 ) . While most of these models rely on carefully-crafted features , more recent methods have incorporated techniques from Representation Learning and particularly Geometric Deep Learning ( Bronstein et al. , 2017 ; Wu et al. , 2019 ) to capture the underlying discrete structure of the CSP ( and SAT ) problems . Along the latter direction , Graph Neural Networks ( Li et al. , 2015 ; Defferrard et al. , 2016 ) have been the cornerstone of many recent deep learning approaches to CSP – e.g. , the NeuroSAT framework ( Selsam et al. , 2019 ) , the Circuit-SAT framework ( Amizadeh et al. , 2019 ) , and Recurrent Relational Networks for Sudoku ( Palm et al. , 2018 ) . These frameworks have been quite successful in capturing the inherent structure of the problem instances and embedding it into traditional vector spaces that are suitable for Machine Learning models . Nevertheless , a major issue with these pure embedding frameworks is that it is not clear how the learned model works , which in turn begs the question whether the model actually learns to search for a solution or simply adapts to statistical biases in the training data . As an alternative , researchers have used deep neural networks within classical search frameworks for tackling combinatorial optimization problems – e.g . Khalil et al . ( 2017 ) . In these hybrid , neuro-symbolic frameworks , deep learning is typically used to learn optimal search heuristics for a generic search algorithm – e.g . greedy search . Despite the clear search strategy , the performance of the resulted models is bounded by the effectiveness of the imposed strategy which is not learned . In this paper , we take a middle way and propose a neural framework for learning SAT solvers which enjoys the benefits of both of the methodologies above . In particular , we take the formulation of solving CSPs as probabilistic inference ( Montanari et al. , 2007 ; Mezard & Montanari , 2009 ; Braunstein et al. , 2005 ; Grover et al. , 2018 ; Gableske et al. , 2013 ) and propose a neural version of it that is capable of learning efficient inference strategy ( i.e . the search strategy in this context ) for specific problem domains . Our general framework is a design pattern which consists of three main operations : Propagation , Decimation and Prediction , and hence referred as the PDP framework . In general , these operations can be implemented either as fixed algorithms or as trainable neural networks . In this light , PDP can be seen as probabilistic inference in the latent space , and as a result , it is somewhat straightforward to establish how the search strategy in the neural PDP works , unlike pure embedding methods . On the other hand , due to the distributed nature of its decimation component , PDP is not restricted by the greedy strategy of the classical decimation process , meaning that it can potentially learn search strategies which are not greedy . And this would distinguishes it from the neuro-symbolic methods that are defined within the greedy strategy . Furthermore , we propose an unsupervised , fully differentiable training mechanism based on energy minimization which trains PDP directly toward solving SAT via end-to-end backpropagation . The unsupervised nature of our proposed training mechanism enables PDP to train on ( infinite ) stream of unlabeled data . Our experimental results show the superiority of the PDP framework compared to both state-of-the-art neural and inference-based solvers . We further demonstrate our model ’ s capability in adapting to problem distributions with distinct structure which is common in industrial settings . Lastly , we take an ambitious step further and compare our neural framework against the well-known class of Conflict-Driven Clause Learning ( CDCL ) industrial solvers . Despite the fact that neural solvers ( including ours ) are still in their infancy and not really comparable to industrial SAT solvers , we were pleasantly surprised to see that our trained models could come close to the performance of the CDCL solver . This is significant in the sense that it shows that even though our neural model at this point lacks some powerful classical search techniques such as backtracking and clause learning , its adaptive neural constraint propagation strategy is nevertheless very effective . 2 RELATED WORK . Classical Machine Learning has been incorporated in solving combinatorial optimization problems ( Bengio et al. , 2018 ) and SAT in particular : from SAT classification ( Xu et al. , 2012 ) , and solver selection ( Xu et al. , 2008 ) to configuration tuning ( Haim & Walsh , 2009 ; Hutter et al. , 2011 ; Singh et al. , 2009 ) and branching prediction ( Liang et al. , 2016 ; Grozea & Popescu , 2014 ; Flint & Blaschko , 2012 ) . However , more recently , researchers have used Deep Learning to train full-stack solvers . There are two main categories of Deep Learning methodologies proposed recently . In the first category , neural networks are used to embed the input CSP instances into a latent vector space where a predictive model can be trained . Palm et al . ( 2018 ) used Recurrent Relational Networks to train Sudoku solvers . Their framework relies on provided solutions at the training time as opposed to our framework , which is completely unsupervised . Selsam et al . ( 2019 ) proposed to use Graph Neural Networks ( Li et al. , 2015 ) to embed CNF instances for the SAT classification problem . They also proposed to use a post-processing clustering approach to decode SAT solutions . In contrast , our method is fully unsupervised and is directly trained toward solving SAT . Amizadeh et al . ( 2019 ) proposed a DAG Neural Network to embed logical circuits for solving the Circuit-SAT problem . Their framework is also unsupervised but it is mainly for circuit inputs with DAG structure . Prates et al . ( 2018 ) proposed a convolutional embedding-based method for solving TSP . In the second category , neural networks are used to learn useful search heuristics within an algorithmic search framework – typically the greedy search ( Vinyals et al. , 2015 ; Bello et al. , 2016 ; Khalil et al. , 2017 ) , branch-and-bound search ( He et al. , 2014 ) or tree search ( Li et al. , 2018 ) . While these methods enjoy a strong inductive bias in learning the optimization algorithm as well as some proof of correctness , their effectiveness is essentially bounded by sub-optimality of the imposed search strategy . Our proposed framework effectively belongs to this category but at the same time , its performance is not bounded by any search strategy . Our framework can also be seen as learning optimal message passing strategy on probabilistic graphical models . There have been some efforts in this direction ( Ross et al. , 2011 ; Lin et al. , 2015 ; Heess et al. , 2013 ; Johnson et al. , 2016 ; Yoon et al. , 2018 ) , but most are focused on merely message passing , whereas our framework learns both optimal message passing and decimation strategies , concurrently . 3 BACKGROUND . A Constraint Satisfaction Problem , denoted by CSP〈X , C〉 , aims at finding an assignment to a set of N discrete variables X = { xi : i ∈ 1 .. N } each defined on a set of discrete values X such that it satisfies all M constraints C = { ca ( x∂a ) : a ∈ 1 .. M } . Here , ∂a is a subset of variable indices that constraint ca depends on ; similarly , by ∂i , we denote the subset of constraint indices that variable i participates in . Each constraint ca : X |∂a| 7→ { 0 , 1 } is a Boolean function that takes value 1 iff x∂a satisfies the constraint ca . In this paper , we focus on Boolean Satisfiability problem ( SAT ) where the variables take values from X = { 0 , 1 } and each constraint ( or clause ) is a disjunction of a subset of variables or their negations . Furthermore , any CSP instance CSP〈X , C〉 can be represented as a factor graph probabilistic graphical model FG〈X , C〉 ( Koller et al. , 2009 ) . A factor graph FG〈X , C〉 is a bipartite graph where each variable xi corresponds to a variable node in FG and each constraint ca corresponds to a factor node in FG . There is an edge between the i-th variable node and the a-th factor node if i ∈ ∂a . Then , one may define a measure on FG as : P ( X ) = 1 Z M∏ a=1 φa ( x∂a ) ( 1 ) where φa are the factor functions such that φa ( x∂a ) : = max ( ca ( x∂a ) , ) for some very small , positive . Z is the normalization constant . In the special case of SAT , we extend the FG representation by assigning a binary eia ∈ { −1 , 1 } attribute to each edge such that eia = −1 if variable xi appears negated in the clause ca , and eia = 1 otherwise . This way the factor functions take the same functional form ( i.e . conjunction ) independent of the factor index a ; that is , φa ( x∂a ) = φ ( x∂a , e∂a ) , where e∂a are all the edges connected to the a-th factor . Using this formalism , the solutions of the original CSP〈X , C〉 correspond to the modes of P ( X ) . Given FG〈X , C〉 , one can compute the marginal distribution of each variable node by probabilistic inference on the factor graph using the Belief Propagation ( BP ) algorithm ( aka the Sum-Product algorithm ) ( Koller et al. , 2009 ) . But the actual optimization problem can be solved by computing the max-marginals of P ( X ) via algorithms such as Max-Product , Min-Sum ( Koller et al. , 2009 ) and Warning-Propagation ( Braunstein et al. , 2005 ) . All of the above algorithms including BP can be seen as special cases of the General Message Passing ( GMP ) algorithm on factor graphs ( Mezard & Montanari , 2009 ) , where the outgoing messages from the graph nodes are computed as a deterministic function of the incoming messages in an iterative fashion . If GMP converges , at the fixed-point , the messages often contain valuable information regarding variable assignments that maximizes the marginal distributions and eventually solve the CSP . In particular , the basic procedure to solve CSPs via probabilistic inference is ( 1 ) run a specific GMP algorithm on the factor graph until convergence , ( 2 ) based on the incoming fixed-point messages to each variable node , pick the variable with the highest certainty regarding a satisfying assignment , ( 3 ) set the most certain variable to the corresponding value , simplify the factor graph if possible and repeat the entire process over and over until all variables are set . We refer to this process as GMP-guided sequential decimation or decimation for short . The most famous algorithms in this class are BP-guided decimation ( Montanari et al. , 2007 ) and SP-guided decimation , based on Survey Propagation ( SP ) ( Aurell et al. , 2005 ; Chavas et al. , 2005 ) .

Summary: This paper investigates the well-studied problem of solving satisfiability problems using deep learning approaches. In this setting, the authors propose a neural architecture inspired by message passing operations in deep probabilistic graphical models. Namely, the architecture takes as input a CNF formula represented as a factor graph, and returns as output a set of soft assignments for the variable nodes in the graph. The internal layers of the architecture consist of propagation, decimation and prediction steps. Notably, decimation operations take an important role in learning non-greedy search strategies. Besides PDP operations, the architecture incorporates parallelization and batch replication techniques. The learning model is trained in a non-supervised way, using a cumulative (discounted) log-likelihood loss that penalizes the non-satisfying assignments returned by the algorithm.