TL;DR
This paper introduces "EvoTune," a novel framework that combines Large Language Models (LLMs) with evolutionary search and reinforcement learning (RL) to automatically discover efficient algorithms. By continuously fine-tuning the LLM based on the performance of algorithms it generates, EvoTune significantly accelerates the discovery of superior solutions compared to existing methods.
What Problem Does This Paper Address?
Discovering efficient algorithms for complex problems has historically been a labor-intensive process requiring significant human expertise. While recent advancements in using LLMs for algorithm discovery have shown promise, these methods often treat the LLM as a static tool. This means they miss a crucial opportunity: the LLM itself can be improved by learning from the exploration process. The challenge is to effectively integrate the LLM's generative capabilities with the exploratory power of evolutionary search and the learning capabilities of RL to create a more dynamic and efficient algorithm discovery pipeline.
Methods
EvoTune's core innovation lies in its iterative loop that alternates between two phases:
- Evolutionary Search: This phase uses an LLM to generate candidate algorithms (represented as Python programs). These programs are evaluated, and the best-performing ones are used to construct prompts for the LLM in the next iteration. This is similar to existing "FunSearch" methods.
- RL Fine-tuning: This is the novel part. Instead of keeping the LLM static, EvoTune uses reinforcement learning to fine-tune the LLM's parameters. The "reward" for the RL agent comes from the performance of the algorithms discovered during the evolutionary search phase. This allows the LLM to learn from its own exploration, becoming better at generating promising algorithms over time. The paper specifically uses Direct Preference Optimization (DPO) for this RL fine-tuning, adapting it for an off-policy setting.
Datasets
The paper evaluates EvoTune on several well-established combinatorial optimization benchmarks:
- Bin Packing (BP)
- Traveling Salesman Problem (TSP)
- Flatpack (FP)
Additionally, they test on:
- Google Hash Code competition problems: Datacenter Optimization and Self-Driving Rides.
- LLM-SR benchmark suite: Stress-Strain Prediction and E. coli Growth modeling (symbolic regression tasks).
No new benchmarks were introduced; the focus was on applying EvoTune to existing, challenging problems.
Key Insights and Ideas
- Synergy of Search and Learning: The paper strongly supports the "Bitter Lesson" that search and learning are synergistic. Evolutionary search generates valuable data, and RL distills patterns from this data to guide future, more effective exploration.
- LLM as a Learner, Not Just a Generator: Treating the LLM as a dynamic, updatable component (rather than a fixed tool) is key to accelerating algorithm discovery. Fine-tuning the LLM with RL based on its own generated outputs leads to significant improvements.
- Diversity is Crucial: The authors emphasize the importance of maintaining output diversity during RL fine-tuning to prevent mode collapse and ensure continued exploration. They achieve this using a forward KL-regularized DPO objective.
- Off-Policy RL for Algorithm Discovery: Adapting DPO for an off-policy setting, where the LLM generates data that is then used to update itself, is a practical approach for this problem.
Key Results
- Consistent Outperformance: EvoTune consistently outperforms the baseline FunSearch method across all tested LLMs (Llama3.2, Phi 3.5, Granite 3.1) and problem domains.
- Accelerated Discovery: EvoTune discovers superior algorithms faster. The performance gap between EvoTune and the baseline widens as more programs are sampled, indicating sustained advantage.
- Higher Quality Solutions: The top-50 discovered programs by EvoTune consistently achieve higher reward scores (lower optimality gaps) compared to the baseline.
- Human-Level Performance: On the Hash Code Datacenter Optimization task, EvoTune achieved a score of 418, surpassing the competition's top human score of 407.
- Improved Diversity: EvoTune discovers a greater number of unique solutions, which correlates with higher rewards and indicates a more comprehensive search.
Limitations and Future Work
- Scaling: The experiments were conducted with LLMs up to 3.8B parameters and sampling budgets up to 22.4k. Further scaling of both model size and sampling budget is needed to fully understand EvoTune's potential.
- Computational Cost: The RL fine-tuning phase adds computational overhead. Investigating the trade-offs between training and inference costs, especially at larger scales, is an important future direction.
- Hyperparameter Tuning: The authors note that achieving significant gains in the performance of the top programs required careful tuning. Further work could explore more automated hyperparameter optimization.
- Alternative RL Methods: While DPO was effective, the paper briefly explored ReSTEM, finding it more challenging to tune and generally underperforming DPO. Future work could explore hybrid approaches combining SFT with DPO.
Summary updated