SATformer: Transformer-Based UNSAT Core Learning

Zhengyuan Shi, Min Li, Yi Liu, Sadaf Khan, Junhua Huang, Hui-Ling Zhen, Mingxuan Yuan, Qiang Xu

Abstract

This paper introduces SATformer, a novel Transformer-based approach for the Boolean Satisfiability (SAT) problem. Rather than solving the problem directly, SATformer approaches the problem from the opposite direction by focusing on unsatisfiability. Specifically, it models clause interactions to identify any unsatisfiable sub-problems. Using a graph neural network, we convert clauses into clause embeddings and employ a hierarchical Transformer-based model to understand clause correlation. SATformer is trained through a multi-task learning approach, using the single-bit satisfiability result and the minimal unsatisfiable core (MUC) for UNSAT problems as clause supervision. As an end-to-end learning-based satisfiability classifier, the performance of SATformer surpasses that of NeuroSAT significantly. Furthermore, we integrate the clause predictions made by SATformer into modern heuristic-based SAT solvers and validate our approach with a logic equivalence checking task. Experimental results show that our SATformer can decrease the runtime of existing solvers by an average of 21.33%.

Introduction

The Boolean Satisfiability (SAT) problem is a fundamental NP-complete problem with critical applications in software verification, microchip design, and Electronic Design Automation (EDA). While modern SAT solvers are highly efficient at finding satisfying assignments, they often struggle to prove that a problem is unsatisfiable (UNSAT). Traditional solvers rely on heuristics like VSIDS to navigate search spaces, but these are "online" methods that suffer from a "cold start," wasting significant time learning problem structure from scratch.

SATformer addresses these limitations by leveraging deep learning to identify UNSAT cores—the specific sub-problems that cause conflicts. By predicting these trouble spots before the search begins, SATformer provides a "warm start" for state-of-the-art solvers, significantly accelerating the verification process.

Methodology

SATformer combines the structural modeling of Graph Neural Networks (GNNs) with the relational reasoning of Transformers. The architecture is designed to capture complex, multi-clause interactions that lead to global conflicts.

The SATformer architecture, showing the transition from CNF graph to hierarchical transformer embeddings and multi-task prediction.

The pipeline involves three primary stages:

  1. GNN Embedding: A GNN processes the bipartite "Literal-Clause Graph" of a SAT instance to create initial embeddings for variables and clauses.
  2. Hierarchical Transformer: To overcome the $O(n^2)$ complexity of standard Transformers, SATformer employs a hierarchical structure. It groups clauses into windows and uses multiple levels of attention to detect conflicts involving disparate parts of the formula simultaneously.
  3. Multi-Task Learning: The model is trained on two objectives: Task-sat (predicting global satisfiability) and Task-clause (identifying clauses belonging to the Minimal Unsatisfiable Core).

Experimental Results

SATformer was evaluated on both synthetic benchmarks and industrial Logic Equivalence Checking (LEC) tasks. In standalone classification, SATformer achieved 68% accuracy on the SR(40) dataset, significantly outperforming NeuroSAT's 58%.

Runtime reduction achieved by integrating SATformer with CaDiCaL and Kissat solvers on industrial benchmarks.

The true utility of SATformer is demonstrated through its integration with modern solvers like CaDiCaL and Kissat. By initializing variable activity scores based on SATformer's predictions, the researchers achieved an average runtime reduction of 21.33% for CaDiCaL and 7.60% for Kissat across industrial benchmarks. Crucially, the computational overhead for AI inference was negligible, accounting for only approximately 0.5% of the total solving time.

Conclusion

SATformer represents a significant step forward in applying deep learning to SAT solving. By focusing on the structural causes of unsatisfiability and utilizing a hierarchical Transformer architecture, it provides a scalable method to enhance traditional heuristic solvers. Future research will focus on identifying "easy-to-prove" cores and developing complementary heuristics to further improve performance on satisfiable instances.

Summary updated

BibTeX
@inproceedings{shi2022satformer,
  author = {Zhengyuan Shi and Min Li and Yi Liu and Sadaf Khan and Junhua Huang and Hui-Ling Zhen and Mingxuan Yuan and Qiang Xu},
  title = {{SATformer: Transformer-Based UNSAT Core Learning}},
  booktitle = {ICCAD},
  year = {2022},
}
Figure