用大模型自动优化通用数值程序,平均提速1.72倍。
AlgoTune: Can Language Models Speed Up General-Purpose Numerical Programs?
- 设计可验证、可计时的算法生成评测基准AlgoTune。
- 基于代码编辑与性能验证的代理在154个任务上平均提速1.72倍。
- 当前模型仅做表面优化,难发现算法创新,适合研究智能编程者。
尽管语言模型能力不断提升,但现有评估仍集中于人类已解决的任务,如编程和数学。为此,我们提出在开放式基准中测试模型设计与实现算法的能力:要求大模型编写高效求解计算机科学、物理和数学中计算难题的代码。AlgoTune基准包含154个由领域专家收集的编码任务,并提供验证与计时框架,将模型生成代码与SciPy、sk-learn、CVXPY等开源库的参考实现进行对比。我们构建了基础模型代理AlgoTuner,其采用预算有限的循环机制,通过编辑、编译、运行、性能分析和正确性验证,选择最快的有效版本。AlgoTuner在多款前沿模型上平均获得1.72倍速度提升。然而,我们发现当前模型难以发现算法级创新,仅进行表层优化。我们希望AlgoTune能推动具备创造性问题求解能力的模型代理发展,超越现有顶尖人类表现。
原文摘要 · Abstract (English)
Despite progress in language model (LM) capabilities, evaluations have thus far focused on models' performance on tasks that humans have previously solved, including in programming (Jimenez et al., 2024) and mathematics (Glazer et al., 2024). We therefore propose testing models' ability to design and implement algorithms in an open-ended benchmark: We task LMs with writing code that efficiently solves computationally challenging problems in computer science, physics, and mathematics. Our AlgoTune benchmark consists of 154 coding tasks collected from domain experts and a framework for validating and timing LM-synthesized solution code, which is compared to reference implementations from popular open-source packages. In addition, we develop a baseline LM agent, AlgoTuner, and evaluate its performance across a suite of frontier models. AlgoTuner uses a simple, budgeted loop that edits code, compiles and runs it, profiles performance, verifies correctness on tests, and selects the fastest valid version. AlgoTuner achieves an average 1.72x speedup against our reference solvers, which use libraries such as SciPy, sk-learn and CVXPY. However, we find that current models fail to discover algorithmic innovations, instead preferring surface-level optimizations. We hope that AlgoTune catalyzes the development of LM agents exhibiting creative problem solving beyond state-of-the-art human performance.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。