AI
New Algorithm Achieves Constant-Speed Program Synthesis by Cutting Search Delays
Researchers introduce EcoSearch, a best-first search algorithm that maintains consistent performance regardless of how many candidate programs have already been explored.
Program synthesis—automatically generating code that meets a specification—typically requires sifting through an enormous space of possible programs. Most search-based approaches grind to a halt as they explore more candidates, with delays between outputs growing longer over time. A new algorithm called EcoSearch sidesteps this bottleneck by maintaining constant-delay performance throughout the search.
The Core Challenge#
Existing best-first search methods guide exploration using learned heuristic cost functions to prioritize the most promising programs. However, they suffer from a fundamental inefficiency: as more programs are generated, the computational overhead of managing the search queue increases, slowing down the rate at which new candidates are produced. This delay-over-time problem limits scalability and practical utility.
How EcoSearch Works#
EcoSearch combines insights from two prior algorithms—Bee Search's cost tuple representation and Heap Search's per-nonterm data structures—with a novel twist. Instead of traditional priority queues, which become expensive to maintain, it uses simpler bucket queues. This substitution works because costs within each queue remain confined to a narrow, predictable range, eliminating the need for more complex data structures. A "frugal expansion strategy" further optimizes how the algorithm explores candidates.
Experimental Results#
Testing on two well-known benchmarks (DeepCoder and FlashFill) showed substantial gains. EcoSearch solved 12% to 70% more tasks than its predecessors and reached performance parity with prior methods 1.6 to 3.2 times faster, proving that constant-delay best-first search is both theoretically possible and practically valuable for program synthesis.

