arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2504.17192cs.CL
收藏

Paper2Code: 从科学论文自动生成机器学习代码

Paper2Code: Automating Code Generation from Scientific Papers in Machine Learning

KAIST(韩国科学技术院);LG AI Research(LG人工智能研究所)

Minju Seo, Jinheon Baek, Seongyun Lee, Sung Ju Hwang

AI总结:

Paper2Code通过多代理LLM框架自动生成机器学习论文的高质量代码实现,有效提升代码生成效率和准确性。

摘要:

尽管机器学习研究迅速发展,但相应的代码实现往往不可用,这使得研究人员复制结果和基于先前工作进行扩展变得缓慢且费力。同时,近期大型语言模型(LLMs)在理解科学文档和生成高质量代码方面表现出色。受此启发,我们介绍了PaperCoder,一个多代理LLM框架,将机器学习论文转化为可操作的代码仓库。PaperCoder分为三个阶段:规划阶段,它构建高层次路线图,设计系统架构图,识别文件依赖关系,并生成配置文件;分析阶段,专注于解释实现细节;生成阶段,产生模块化、依赖感知的代码。此外,每个阶段通过一组专门设计的代理来实例化,以在管道中有效协作。我们然后在基于模型和人类评估的基础上评估PaperCoder,特别是从论文作者处获得的代码实现,如果可用,则以作者发布的仓库为基准。我们的结果证明了PaperCoder在创建高质量、忠实实现的有效性。此外,它在最近发布的PaperBench基准测试中表现突出,显著超越了强大的基线。代码可在:https://github.com/going-doer/Paper2Code获得。

英文摘要:

Despite the rapid growth of machine learning research, corresponding code implementations are often unavailable, making it slow and labor-intensive for researchers to reproduce results and build upon prior work. In the meantime, recent Large Language Models (LLMs) excel at understanding scientific documents and generating high-quality code. Inspired by this, we introduce PaperCoder, a multi-agent LLM framework that transforms machine learning papers into operational code repositories. PaperCoder operates in three stages: planning, where it constructs a high-level roadmap, designs the system architecture with diagrams, identifies file dependencies, and generates configuration files; analysis, which focuses on interpreting implementation-specific details; and generation, where modular, dependency-aware code is produced. Moreover, each phase is instantiated through a set of specialized agents designed to collaborate effectively across the pipeline. We then evaluate PaperCoder on generating code implementations from machine learning papers based on both model-based and human evaluations, particularly from the authors of those papers, with author-released repositories as ground truth if available. Our results demonstrate the effectiveness of PaperCoder in creating high-quality, faithful implementations. Furthermore, it consistently shows strengths in the recently released PaperBench benchmark, surpassing strong baselines by substantial margins. Code is available at: https://github.com/going-doer/Paper2Code.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑