arXiv:2412.17330 · v2
EcoSearch: A Constant-Delay Best-First Search Algorithm for Program Synthesis
摘要
Many approaches to program synthesis perform a combinatorial search within a large space of programs to find one that satisfies a given specification. To tame the search space blowup, previous works introduced probabilistic and neural approaches to guide this combinatorial search by inducing heuristic cost functions. Best-first search algorithms ensure to search in the exact order induced by the cost function, significantly reducing the portion of the program space to be explored. A key limitation of existing best-first search algorithms is that they slow down over time: the delay between outputting successive programs grows with the number of programs already generated. We ask whether best-first search algorithms with constant delay exist. We design Eco Search, a new best-first bottom-up search algorithm. It combines the cost tuple representation of Bee Search with the per non-terminal data structures of Heap Search, thanks to a new frugal expansion strategy, and it uses bucket queues instead of priority queues, which is possible because the costs stored in each queue always lie in a window of constant width. We prove that Eco Search is the first constant-delay best-first search algorithm for pre-generation cost functions. Experimentally, we evaluate Eco Search on two classic program-synthesis benchmarks (DeepCoder and FlashFill) and observe that Eco Search solves 12% to 70% more tasks than its predecessors, and reaches the number of tasks they solve 1.6 to 3.2 times faster. This shows that constant delay can be achieved for best-first search in program synthesis, and that it makes a difference in practice.
作者备注:36 pages. Journal version of the AAAI 2025 paper "Eco Search: A No-Delay Best-First Search Algorithm for Program Synthesis" (doi:10.1609/aaai.v39i18.34139)