用大模型自动优化算法代码,让算法性能更优且成本极低
irace-evo: Automatic Algorithm Configuration Extended With LLM-Based Code Evolution
- 结合大模型实现参数与代码的联合搜索
- 在低成本下生成超越现有算法的新变体
- 适合需要自动化改进启发式算法的研究者
自动算法配置工具如irace能高效调参,但无法修改算法代码。本文提出irace-evo,首次将大语言模型(LLM)驱动的代码演化引入irace,实现参数与代码空间的联合探索。该框架支持多语言(如C++、Python),通过渐进式上下文管理降低令牌消耗,并采用始终基于原始代码的原则保障演化稳健性。我们在可变尺寸装箱问题(VSBPP)的构造-合并-求解-适应(CMSA)元启发式上评估该方法。实验表明,irace-evo可发现性能优于当前最优的算法新变体,且计算与资金成本极低。尤其值得注意的是,仅使用轻量级模型(如Claude Haiku 3.5),总耗资不足2欧元即可获得竞争力结果。这证明将自动配置与大模型驱动的代码演化结合,是推动启发式设计与元启发式优化的一条强大且高性价比路径。
原文摘要 · Abstract (English)
Automatic algorithm configuration tools such as irace efficiently tune parameter values but leave algorithmic code unchanged. This paper introduces a first version of irace-evo, an extension of irace that integrates code evolution through large language models (LLMs) to jointly explore parameter and code spaces. The proposed framework enables multi-language support (e.g., C++, Python), reduces token consumption via progressive context management, and employs the Always-From-Original principle to ensure robust and controlled code evolution. We evaluate irace-evo on the Construct, Merge, Solve & Adapt (CMSA) metaheuristic for the Variable-Sized Bin Packing Problem (VSBPP). Experimental results show that irace-evo can discover new algorithm variants that outperform the state-of-the-art CMSA implementation while maintaining low computational and monetary costs. Notably, irace-evo generates competitive algorithmic improvements using lightweight models (e.g., Claude Haiku 3.5) with a total usage cost under 2 euros. These results demonstrate that coupling automatic configuration with LLM-driven code evolution provides a powerful, cost-efficient avenue for advancing heuristic design and metaheuristic optimization.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。