Tree Sampling for Reinforcement Learning in Automated Algorithm Design with LLMs
Abstract
Large Language Model-based Automated Algorithm Design (LLM-AAD) has shown promising results across diverse domains by coupling LLMs with iterative search. Recent efforts have begun to combine this paradigm with reinforcement learning (RL), using reward feedback from algorithm evaluators to update the LLM and better guide subsequent algorithm generation. However, these methods still rely primarily on outcome-level supervision. As a result, intermediate ideas and plans receive no direct credit, even though they guide the direction of algorithm design. We introduce Algorithm Tree Policy Optimization (ATPO), a reinforcement learning method that can be integrated into the algorithm-generation stage of existing LLM-based automated algorithm design methods. ATPO employs tree-based sampling to expand each idea into multiple executable code implementations, using their evaluation outcomes to estimate idea-level quality and provide structured credit at both the idea and code levels. Experiments integrating ATPO with FunSearch, EoH, and OpenEvolve demonstrate improvements over their original counterparts. The learned policy also transfers to held-out problem instances and alternative search methods, suggesting its potential to generalize within the same AAD task. Source code is available at https://github.com/RayZhhh/atpo-aad.