SolSearch: An LLM-Driven Framework for Efficient SAT-Solving Code Generation

Junjie Sheng, Yanqiu Lin, Jiehao Wu, Yanhong Huang, Jianqi Shi, Min Zhang, Xiangfeng Wang

Abstract

Automated SAT solver optimization remains a significant challenge due to the complexity of heuristic design. We present SolSearch, a framework that leverages Large Language Models (LLMs) to iteratively evolve and optimize SAT solver code. By employing a curriculum-based search strategy, SolSearch identifies and improves critical code segments within existing solvers like Z3 and CaDiCaL. Our results demonstrate an 11% improvement in PAR-2 scores on specialized benchmarks, showcasing the potential of LLMs to automate high-level algorithmic innovation.

Introduction

The Boolean Satisfiability (SAT) problem is a cornerstone of computer science, essential for applications ranging from software testing to hardware verification. However, designing an efficient SAT solver is notoriously difficult. Traditionally, this process relies on "human-in-the-loop" engineering, where experts manually tune complex heuristics—such as variable selection or restart strategies—for specific problem domains.

A significant challenge in this field is that no single solver dominates every domain; a solver that excels in one competition may struggle as problem sets evolve. This creates a gap between the need for adaptive, high-performance solvers and the labor-intensive nature of manual design. SolSearch aims to bridge this gap by utilizing LLMs to automate the role of the expert innovator, discovering novel heuristics through an iterative search process.

The SolSearch Framework

SolSearch introduces a two-phase framework designed to automate the discovery and optimization of solving strategies without requiring a total rewrite of the underlying engine.

1. Curriculum-Proposing Stage

To prevent the LLM from stagnating on high-complexity problems, SolSearch employs curriculum learning. The framework begins with simpler problem instances and a strict 100-second timeout. As the solver's performance improves, the framework incrementally increases both the problem difficulty and the timeout limit. This ensures the LLM receives a steady stream of "winnable" optimization tasks and actionable feedback.

2. Solver-Searching Stage

This stage consists of an iterative loop with three primary components:

  • The Selector: Identifies specific portions of the solver's code (e.g., the inc_activity function in a VSIDS heuristic) that are suitable for optimization.
  • The Searcher: Uses an LLM (DeepSeek-coder) to generate new C++ implementations for the targeted code block based on detailed prompts.
  • The Evaluator: Compiles the new code and tests it against the current curriculum. The best-performing version is fed back into the loop for further refinement.

This "plug-and-play" approach allows SolSearch to be integrated with existing industry-standard solvers like Z3, Kissat, or CaDiCaL.

Experimental Evaluation

The researchers evaluated SolSearch using benchmarks from the SAT Competition 2023 (400 instances) and the SAT Competition 2024 Knights Tour (40 instances). The latter was used specifically to test the framework's ability to enhance the Z3 solver on specialized tasks.

Key Results

The experimental results demonstrate that SolSearch provides a tangible performance boost across multiple solver architectures:

  • Z3 Enhancement: On the Knights Tour problem, SolSearch improved the PAR-2 score by 11%, reducing it from 660.09 to 583.52.
  • Solved Ratios: For Z3, the ratio of instances solved within a 500-second limit increased from 42.5% to 52.5%.
  • State-of-the-Art Improvement: The framework successfully enhanced CaDiCaL and Kissat-sc2024, two of the most powerful academic SAT solvers currently available. Optimized versions consistently solved more instances faster than their original human-designed counterparts.

Insights and Discussion

SolSearch demonstrates that LLMs are capable of more than just writing boilerplate code; they can innovate within the "function space" of complex algorithms. By exploring novel heuristic strategies, the LLM discovered implementations that outperformed human-designed defaults.

The success of the framework highlights the power of the trial-and-error loop. While the LLM may fail frequently, the Evaluator's ability to pinpoint "winners" ensures the system consistently trends toward higher efficiency. Furthermore, the curriculum-based approach proved essential; starting with manageable tasks allowed the system to make gradual improvements that eventually scaled to complex instances.

Limitations and Future Work

Despite these promising results, several areas for future exploration remain. Currently, the logic behind the LLM-generated heuristics is somewhat opaque. Future work aims to extract formal "rules" from these generated solvers to gain deeper insights into SAT design principles. Additionally, the researchers plan to investigate how different LLMs (e.g., GPT-4o or Claude 3.5 Sonnet) impact the quality of discovered heuristics and extend the framework to more complex domains such as Max-SAT and QBF (Quantified Boolean Formulas).

Summary updated

BibTeX
@inproceedings{sheng2025solsearch,
  author = {Junjie Sheng and Yanqiu Lin and Jiehao Wu and Yanhong Huang and Jianqi Shi and Min Zhang and Xiangfeng Wang},
  title = {{SolSearch: An LLM-Driven Framework for Efficient SAT-Solving Code Generation}},
  booktitle = {NIER@ICSE},
  year = {2025},
  doi = {10.1109/icse-nier66352.2025.00007},
}
Figure