arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2505.12331cs.SEcs.LG
收藏

OSS-Bench: 面向代码大语言模型的基准生成器

OSS-Bench: Benchmark Generator for Coding LLMs

School of Computing, National University of Singapore(计算学院,新加坡国立大学)

Yuancheng Jiang, Roland Yap, Zhenkai Liang

AI总结:

针对现有代码LLM评估基准存在的人工成本高、任务挑战性不足、不可扩展且忽略底层安全评估等问题,研究提出可从真实开源软件自动构建大规模实时评估任务的基准生成器OSS-Bench,通过多维度指标评估代码,能缓解过拟合并有效衡量LLM的真实编码与安全理解能力。

摘要:

随着AI编码助手的快速普及,大语言模型(LLM)辅助开发已变得日益普遍,这使得对生成代码质量进行稳健评估的需求变得十分迫切。现有基准通常需要大量人工工作来构建静态数据集,依赖间接或挑战性不足的任务,依赖不可扩展的基准真值,或忽略了关键的底层安全评估,尤其是内存安全问题。\n在本研究中,我们推出了OSS-Bench,这是一款能从真实世界开源软件中自动构建大规模实时评估任务的基准生成器。OSS-Bench将函数替换为LLM生成的代码,并利用编译失败、测试套件违规、 sanitizer 告警等强信号作为基准真值,通过三个天然指标对代码进行评估:可编译性、功能正确性和内存安全性。\n在我们的评估中,该基准以OSS-Bench(php)和OSS-Bench(sql)的形式实例化,对17种不同的LLM进行了性能剖析,揭示了模型家族内的行为模式、模型规模与性能不一致等洞见。我们的结果表明,OSS-Bench利用开源软件不断演进的复杂性缓解了过拟合问题,并通过扩展模糊测试实验凸显了LLM对底层代码安全的理解有限。总体而言,OSS-Bench为基准测试LLM的真实世界编码能力提供了一个实用且可扩展的框架。

英文摘要:

In light of the rapid adoption of AI coding assistants, LLM-assisted development has become increasingly prevalent, creating an urgent need for robust evaluation of generated code quality. Existing benchmarks often require extensive manual effort to create static datasets, rely on indirect or insufficiently challenging tasks, depend on non-scalable ground truth, or neglect critical low-level security evaluations, particularly memory-safety issues. In this work, we introduce OSS-Bench, a benchmark generator that automatically constructs large-scale, live evaluation tasks from real-world open-source software. OSS-Bench replaces functions with LLM-generated code and evaluates them using three natural metrics: compilability, functional correctness, and memory safety, leveraging robust signals like compilation failures, test-suite violations, and sanitizer alerts as ground truth. In our evaluation, the benchmark, instantiated as OSS-Bench(php) and OSS-Bench(sql), profiles 17 diverse LLMs, revealing insights such as intra-family behavioral patterns and inconsistencies between model size and performance. Our results demonstrate that OSS-Bench mitigates overfitting by leveraging the evolving complexity of OSS and highlights LLMs' limited understanding of low-level code security via extended fuzzing experiments. Overall, OSS-Bench offers a practical and scalable framework for benchmarking the real-world coding capabilities of LLMs.

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

↑