Reinforcement Learning and Data-Generation for Syntax-Guided Synthesis
Program synthesis—the automated generation of code from high-level specifications—remains a fundamental challenge in computer science. In Syntax-Guided Synthesis (SyGuS), users provide a logical specification and a syntactic grammar. While "Programming-by-Example" (PBE) has benefited from machine learning due to the ease of generating training data, SyGuS has historically struggled with a chronic "data scarcity" problem. Creating meaningful logical specifications for random programs is computationally difficult, leaving a gap in training data for neural heuristics.
Methodology: MCTS-Guided Synthesis
To navigate the vast search space of potential programs, the authors propose a reinforcement learning (RL) framework inspired by AlphaZero. They treat synthesis as a single-player game played on the grammar tree, utilizing Monte-Carlo Tree Search (MCTS).
The system employs two primary components:
- Policy Function: Predicts the most promising branch in the grammar to explore.
- Value Function: Estimates the likelihood that a partial program will lead to a valid solution.
Unlike many modern RL systems that rely on deep neural networks, this framework uses XGBoost (gradient-boosted trees). The authors found that XGBoost offers a superior balance of prediction accuracy and low latency, which is critical for the high-frequency decisions required during tree search.
Data Generation via Anti-Unification
The paper's most significant contribution is a novel technique to generate high-quality training data by leveraging existing Satisfiability Modulo Theories (SMT) problems. The process uses anti-unification—finding the "least general generalizer" of terms—to "invert" verification problems into synthesis tasks. By replacing specific terms in proven SMT formulas with generic functions and grammars, the authors can create thousands of non-trivial synthesis problems where a solution is guaranteed to exist.
As shown in the dataset summary, this method expanded the available problem set from under 1,000 standard benchmarks to over 8,000 generated problems, which were then filtered for diversity and complexity to ensure they were not trivial.
Experimental Results
The impact of the learned heuristics and the new dataset is substantial. In experimental evaluations, the RL-guided search outperformed baseline methods by over 26 percentage points, increasing the success rate from approximately 34% to over 60% in key tests.
The tool proved competitive with cvc5, the current state-of-the-art symbolic solver. Notably, the ML-guided approach solved 182 problems that cvc5 could not, suggesting that reinforcement learning explores regions of the solution space that traditional symbolic methods overlook. Training on the generated anti-unification data specifically improved the solver's ability to handle complex control flow structures like if-then-else statements.
Limitations and Future Work
While currently focused on Linear Integer Arithmetic (LIA), future work aims to extend these techniques to more complex domains like bit-vectors and strings. The "cold start" problem remains a challenge, as the RL loop still requires a small seed of solvable problems to begin generating training data. However, the success of XGBoost over deep learning highlights the importance of inference speed in search-heavy synthesis tasks, and the anti-unification method provides a scalable path forward for data-driven formal methods.
Summary updated