ClassEval-Pro:一个跨领域用于类级别代码生成的基准测试
ClassEval-Pro: A Cross-Domain Benchmark for Class-Level Code Generation
AI总结:
本文提出ClassEval-Pro,一个包含300个跨11个领域的类级别任务的基准测试,通过自动化三阶段流程构建,评估五种前沿LLM在五种生成策略下的表现,揭示了逻辑错误和依赖错误是核心瓶颈。
摘要:
LLMs在函数级别代码合成和仓库级别代码修改方面取得了显著成果,但介于两者之间的能力——组合性代码创建,即根据规范构建完整的内部结构类——仍被忽视。当前评估要么局限于孤立函数,要么依赖人工整理的类级别任务,难以扩展且易受数据污染。我们引入ClassEval-Pro,包含300个类级别任务,覆盖11个领域,通过自动化三阶段流程构建,结合复杂性增强、跨领域类组合和整合真实世界GitHub代码(贡献时间在2025年1月之后)。每个任务都经过LLM判断者集合验证,并必须通过具有超过90%行覆盖率的测试套件。我们评估了五种前沿LLM在五种生成策略下的表现。最佳模型在类级别上仅达到45.6%的Pass@1,最强和最弱模型之间有17.7分的差距,证实了基准测试的判别能力。策略选择与模型能力有强互动:结构化方法如自底向上的方法可使较弱模型提升高达9.4个百分点,而组合生成则降至最低1.3%。对500个手动标注失败的错误分析显示,逻辑错误(56.2%)和依赖错误(38.0%)占主导地位,识别了跨方法协调作为核心瓶颈。
英文摘要:
LLMs have achieved strong results on both function-level code synthesis and repository-level code modification, yet a capability that falls between these two extremes -- compositional code creation, i.e., building a complete, internally structured class from a specification -- remains underserved. Current evaluations are either confined to isolated functions or rely on manually curated class-level tasks that are expensive to scale and increasingly susceptible to data contamination. We introduce ClassEval-Pro, a benchmark of 300 class-level tasks spanning 11 domains, constructed through an automated three-stage pipeline that combines complexity enhancement, cross-domain class composition, and integration of real-world GitHub code contributed after January 2025. Every task is validated by an LLM Judge Ensemble and must pass test suites with over 90% line coverage. We evaluate five frontier LLMs under five generation strategies. The best model achieves only 45.6% class-level Pass@1, with a 17.7-point gap between the strongest and weakest models, confirming the benchmark's discriminative power. Strategy choice strongly interacts with model capability: structured approaches such as bottom-up improve weaker models by up to 9.4 percentage points, while compositional generation collapses to as low as 1.3%. Error analysis over 500 manually annotated failures reveals that logic errors (56.2%) and dependency errors (38.0%) dominate, identifying cross-method coordination as the core bottleneck.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。