arXiv:2508.09101cs.CLcs.SE2025-08被引 27

用大模型自动生成多语言高难度代码评测集,解决人工构建瓶颈。

AutoCodeBench: Large Language Models are Automatic Code Benchmark Generators

  • 用大模型生成题目并自动验证,无需人工标注
  • 覆盖20种语言共3920个难题,分布均衡且难度高
  • 适合评估大模型在真实多语言场景下的编程能力

大型语言模型在多个领域展现强大能力,代码生成尤为突出。然而现有评测基准存在两大问题:一是依赖人工标注,耗时且难以扩展;二是多数仅聚焦Python,少数多语言基准难度低、语言分布不均。为此,我们提出AutoCodeGen,一种无需人工标注的自动化方法,可生成高质量多语言代码数据集。该方法通过大模型生成测试输入,并利用多语言沙盒获取输出,结合逆序题目生成与多重过滤机制保障数据质量。基于此,我们构建了AutoCodeBench,一个包含3920个问题的大规模基准,均匀分布在20种编程语言中,专为评估模型在复杂、多样、实用的多语言任务中的表现而设计。我们在AutoCodeBench及其简化版AutoCodeBench-Lite上评估了30余款主流开源与闭源模型,结果表明即使最先进的模型也难以应对其复杂性与多样性。此外,我们还推出了AutoCodeBench-Complete,专门用于评估基础模型的少样本代码生成能力。我们希望AutoCodeBench系列能成为社区重要资源,推动更挑战性、更贴近实际的多语言代码生成研究。

原文摘要 · Abstract (English)

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.

代码生成多语言自动评测LLM

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。