AutoCodeBench: Large Language Models are Automatic Code Benchmark Generators
本文提出了一种名为AutoCodeGen的自动化方法,用于生成高难度多语言代码生成数据集,并通过AutoCodeBench基准测试评估了大型语言模型(LLMs)的代码生成能力。
更新于 2025-11-04。作者:Jason Chou、Ao Liu、Yuchi Deng、Zhiying Zeng、Tao Zhang、Haotian Zhu、Jianwei Cai、Yue Mao、Chenchen Zhang、Lingyun Tan、Ziyan Xu、Bohui Zhai、Hengyi Liu、Speed Zhu、Wiggin Zhou、Fengzong Lian。
中文摘要
大型语言模型(LLMs)在各个领域展现了惊人的能力,代码生成已成为一个关键的焦点领域。虽然已经提出了许多基准来评估它们的代码生成能力,但这些基准面临几个关键的限制。首先,它们往往依赖于人工标注,这既费时又难以在不同编程语言和问题复杂性之间进行扩展。其次,大多数现有的基准主要关注Python,而少数多语言基准则因难度有限和语言分布不均而受到限制。为了解决这些挑战,我们提出了AutoCodeGen,这是一种自动化方法,用于生成高难度多语言代码生成数据集,而不需要人工标注。AutoCodeGen通过使用LLM生成测试输入,并通过多语言沙盒获得测试输出,确保测试案例的正确性和完整性,同时通过逆向问题生成和多个过滤步骤实现高数据质量。利用这种方法,我们引入了AutoCodeBench,这是一个包含3,920个问题的大型规模代码生成基准,这些问题在20种编程语言中均匀分布。它专门设计用于评估LLMs在具有挑战性、多样性和实际应用的多语言任务上的表现。我们在AutoCodeBench及其简化版AutoCodeBench-Lite上评估了30多个领先的开源和专有LLMs。结果表明,即使是最高级的LLMs在处理这些任务的复杂性、多样性和多语言特性方面也面临着挑战。此外,我们还引入了AutoCodeBench-Complete,专门为基模型设计,以评估它们的少量样本代码生成能力。我们希望AutoCodeBench系列将成为一个有价值的资源,并激励社区关注更具挑战性和实际应用的多语言代码生成场景。
英文摘要
Large Language Models (LLMs) have demonstrated remarkable capabilities across various domains, with code generation emerging as a key area of focus. While numerous benchmarks have been proposed to evaluate their code generation abilities, these benchmarks face several critical limitations. First, they often rely on manual annotations, which are time-consuming and difficult to scale across different programming languages and problem complexities. Second, most existing benchmarks focus primarily on Python, while the few multilingual benchmarks suffer from limited difficulty and uneven language distribution. To address these challenges, we propose AutoCodeGen, an automated method for generating high-difficulty multilingual code generation datasets without manual annotations. AutoCodeGen ensures the correctness and completeness of test cases by generating test inputs with LLMs and obtaining test outputs through a multilingual sandbox, while achieving high data quality through reverse-order problem generation and multiple filtering steps. Using this novel method, we introduce AutoCodeBench, a large-scale code generation benchmark comprising 3,920 problems evenly distributed across 20 programming languages. It is specifically designed to evaluate LLMs on challenging, diverse, and practical multilingual tasks. We evaluate over 30 leading open-source and proprietary LLMs on AutoCodeBench and its simplified version AutoCodeBench-Lite. The results show that even the most advanced LLMs struggle with the complexity, diversity, and multilingual nature of these tasks. Besides, we introduce AutoCodeBench-Complete, specifically designed for base models to assess their few-shot code generation capabilities. We hope the AutoCodeBench series will serve as a valuable resource and inspire the community to focus on more challenging and practical multilingual code generation scenarios.
解读
一句话总结
本文提出了一种名为AutoCodeGen的自动化方法,用于生成高难度多语言代码生成数据集,并通过AutoCodeBench基准测试评估了大型语言模型(LLMs)的代码生成能力。
问题1:这篇论文想要解决什么具体问题?
- 问题背景:现有的代码生成基准测试依赖手动标注,耗时且难以扩展,且多数基准测试仅针对Python,多语言基准测试难度有限且语言分布不均。
- 现有方案不足:手动标注效率低下,多语言基准测试缺乏难度和语言多样性。
- 研究目标:开发一个自动化的代码生成数据集生成方法,并创建一个大规模、多语言、高难度的代码生成基准测试。
问题2:论文的核心创新点是什么?
- 技术创新:AutoCodeGen通过LLM-Sandbox交互,自动化生成高难度多语言代码生成数据集。
- 方法改进:反向顺序问题生成和多级过滤步骤确保数据质量。
- 优势:与现有方法相比,AutoCodeGen生成数据集无需手动标注,且数据质量更高。
问题3:实验结果如何验证了方法的有效性?
- 关键实验:使用AutoCodeBench评估了30多个LLMs。
- 性能提升:结果显示,即使是最高级的LLMs在处理复杂、多样和多语言任务时也面临挑战。
- 对比结果:与基线方法相比,AutoCodeBench提供了更全面、更具挑战性的评估。
问题4:这个研究的实际应用价值是什么?
- 应用场景:评估LLMs的代码生成能力,促进编程自动化。
- 实施建议:使用AutoCodeBench进行模型评估,并基于结果改进模型。
- 局限与展望:未来可以扩展到更多编程语言,并提高数据集的多样性。