PSearch
Research code for a search-based patch generation method for large-language-model automated program repair, using Monte Carlo tree search and beam search to explore candidate fixes.
PSearch is the official implementation accompanying an academic paper on search-based patch generation for LLM-based automated program repair. It provides scripts that generate candidate patches for real bugs using Monte Carlo tree search, guided by a policy model, or a beam-search variant with a separate reward model and a pool of plausible patches.
It is evaluated against several established program-repair benchmarks: Defects4J, QuixBugs, ConDefects, SWE-bench (including its lite split) and VUL4J, a vulnerability-repair benchmark. Running the experiments requires setting up each benchmark's own tooling, such as Gradle and the Defects4J framework, downloading policy and reward models from Hugging Face, and cloning the relevant benchmark repositories.
Results are reported per benchmark and method, comparing patch size and repair rate across model configurations.