[Paper Review] Neural Guided Constraint Logic Programming for Program Synthesis
This paper proposes a neural-guided constraint logic programming approach for program synthesis using miniKanren, where a neural model (RNN or GNN) processes miniKanren's internal constraint representations to accelerate search. The method significantly improves synthesis speed and generalization to larger problems compared to baseline approaches.
Synthesizing programs using example input/outputs is a classic problem in artificial intelligence. We present a method for solving Programming By Example (PBE) problems by using a neural model to guide the search of a constraint logic programming system called miniKanren. Crucially, the neural model uses miniKanren's internal representation as input; miniKanren represents a PBE problem as recursive constraints imposed by the provided examples. We explore Recurrent Neural Network and Graph Neural Network models. We contribute a modified miniKanren, drivable by an external agent, available at https://github.com/xuexue/neuralkanren. We show that our neural-guided approach using constraints can synthesize programs faster in many cases, and importantly, can generalize to larger problems.
Motivation & Objective
- To address the challenge of slow search in program synthesis for Programming By Example (PBE) problems.
- To improve generalization to larger and more complex PBE problems beyond small examples.
- To integrate neural models with constraint logic programming by leveraging miniKanren’s internal constraint representations as input.
- To develop a modified, externally drivable version of miniKanren for enhanced search guidance.
- To evaluate the effectiveness of RNN and GNN architectures in guiding constraint-based program synthesis.
Proposed method
- A neural model is trained to predict promising search paths in miniKanren by encoding its internal constraint representation as input.
- The neural model uses either a Recurrent Neural Network (RNN) or Graph Neural Network (GNN) to process the recursive constraint structure of PBE problems.
- The system integrates the neural model as an external agent that guides miniKanren’s search, improving exploration efficiency.
- The modified miniKanren supports external control, enabling the neural model to steer the search process dynamically.
- The constraint representation in miniKanren is derived from input-output examples, forming recursive logical constraints on the program structure.
- The approach enables faster convergence to correct programs by prioritizing promising constraint branches.
Experimental results
Research questions
- RQ1Can neural models effectively guide constraint logic programming in PBE synthesis?
- RQ2How does neural guidance improve search efficiency compared to unguided miniKanren?
- RQ3Can the neural-guided approach generalize to larger PBE problems beyond the training distribution?
- RQ4How do RNN and GNN architectures compare in guiding constraint-based search?
- RQ5To what extent does using miniKanren’s internal constraint representation improve model performance?
Key findings
- The neural-guided approach significantly reduces synthesis time compared to baseline miniKanren on multiple PBE benchmarks.
- The method generalizes effectively to larger problems, demonstrating scalability beyond small example sets.
- Both RNN and GNN variants of the neural model improve search efficiency, with GNNs showing stronger performance on structured constraints.
- The integration of neural guidance with miniKanren enables faster convergence to correct programs by focusing search on relevant constraint branches.
- The modified miniKanren system, available on GitHub, supports external agent control and enables plug-in neural guidance.
- The approach achieves faster synthesis while maintaining correctness, validating the effectiveness of neural guidance on constraint representations.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.