LintEval:针对大语言模型在静态代码分析工具引导下的文件重构任务的基准测试
LintEval: Benchmarking LLMs on Linter-Guided File Refactoring
AI总结:
本文提出LintEval基准,针对C++、Python、Java的静态代码分析工具引导文件重构任务,评估模型的功能保留、告警减少等能力,发现模型存在性能权衡,且重构类SFT可提升模型表现。
摘要:
静态代码分析工具(linter)广泛应用于代码维护与集成开发环境(IDE)实时编辑中,用于呈现源文件中与性能、风格、易出错及其他模式相关的静态代码分析工具告警。然而,现有代码基准并未明确评估静态代码分析工具引导下的文件重构任务,该任务要求模型在保持初始功能正确的前提下减少源文件中的静态代码分析工具告警,同时满足功能保留要求。本文提出LintEval,这是一个针对C++、Python和Java的静态代码分析工具引导文件重构任务的多语言基准,包含13061个功能正确的程序,以及通过各语言专用静态代码分析工具提取的171662条静态代码分析工具告警。LintEval联合评估功能保留、静态代码分析工具告警减少、新告警规避及编辑最小化。实验揭示了一个持续存在的权衡关系:闭源商业模型的Reduction@P最高达90.4%,但Pass@1仅为67.1%-68.3%;多个开源小模型的Reduction@P较低甚至为负值。受控微调研究进一步表明,监督格式至关重要:面向重构的监督微调(SFT)将Qwen2.5-Coder-7B的Reduction@P从24.7%提升至76.0%。LintEval支持对在功能保留约束下改进源文件的模型进行受控评估。
英文摘要:
Linters are widely used in code maintenance and real-time IDE editing to surface lint alerts related to performance, style, error-prone, and other patterns in source files. However, existing code benchmarks do not explicitly evaluate linter-guided file refactoring, where models must reduce lint alerts in source files with correct initial functionality while satisfying functionality preservation. We introduce LintEval, a multilingual benchmark for linter-guided file refactoring across C++, Python, and Java, comprising 13,061 programs with correct initial functionality and 171,662 lint alerts extracted using language-specific linters. LintEval jointly evaluates functionality preservation, lint alert reduction, new alert avoidance, and edit minimality. Experiments reveal a persistent trade-off: closed-source commercial models reach up to 90.4% Reduction@P but achieve only 67.1%-68.3% Pass@1, while several open-source small models show low or negative Reduction@P. A controlled fine-tuning study further shows that supervision format matters: refactoring-oriented SFT raises Qwen2.5-Coder-7B Reduction@P from 24.7% to 76.0%. LintEval enables controlled evaluation of models that improve source files under functionality preservation.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。