RepGen:通过上下文感知代码生成与验证复现深度学习漏洞
RepGen: Reproducing Deep Learning Bugs through Context-Aware Code Generation and Verification
AI总结:
RepGen是一款开源工具,通过上下文感知代码生成与迭代验证复现深度学习漏洞,在106个真实漏洞中复现85个,使开发者复现成功率提升23.35%、时间缩短56.8%。
摘要:
复现深度学习(DL)漏洞颇具挑战,因为失败可能涉及源代码、模型、数据、依赖项及执行环境,而不完整的漏洞报告因遗漏关键细节进一步加剧了复现难度。我们提出RepGen,这是一款通过上下文感知代码生成与迭代验证复现DL漏洞的开源工具。给定漏洞报告与代码仓库,RepGen会探索代码库以构建学习增强型上下文、制定复现计划并生成候选脚本,再通过静态检查与大语言模型(LLM)反馈优化候选脚本,提升其正确性与相关性。启用该工具后,它会准备执行环境、运行脚本并将输出与报告的失败情况进行比对。RepGen提供支持本地与托管LLM的交互式命令行界面、可配置的执行预算及可检查的工件,还附带用于自动化问题处理的GitHub Action。该方法在106个真实DL漏洞中复现了85个(成功率80.19%);针对27名开发者的对照研究显示,复现成功率提升23.35%,复现时间缩短56.8%。
英文摘要:
Reproducing deep learning (DL) bugs is challenging because failures can involve source code, models, data, dependencies, and execution environments. Incomplete bug reports further complicate reproduction by omitting essential details. We present RepGen, an open-source tool for reproducing DL bugs through context-aware code generation and iterative verification. Given a bug report and repository, RepGen explores the codebase to build a learning-enhanced context, develop a reproduction plan, and generate candidate scripts. It refines candidates using static checks and LLM feedback to improve their correctness and relevance. When enabled, the tool prepares the execution environment, runs the script, and assesses its output against the reported failure. RepGen provides an interactive command-line interface supporting local and hosted LLMs, configurable execution budgets, and inspectable artifacts, along with a GitHub Action for automated issue processing. The underlying approach reproduced 85 of 106 real-world DL bugs (80.19%). A controlled study with 27 developers showed a 23.35% improvement in reproduction success and a 56.8% reduction in reproduction time.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。