评测大模型生成代码时对库版本兼容性的处理能力
GitChameleon 2.0: Evaluating AI Code Generation Against Python Library Version Incompatibilities
- 构建328个带特定库版本的代码补全任务,带可执行测试
- 主流模型在版本适配任务中准确率仅48%-51%
- 适合研究AI编程工具可靠性与版本适应性的学者
软件库快速迭代给代码生成带来挑战,需持续适应版本更新并保持向后兼容。现有代码演进基准多缺乏针对特定库版本的执行评估。为此,我们提出GitChameleon 2.0,一个精心构建的数据集,包含328个受特定库版本约束的Python代码补全问题,并附带可执行单元测试。该数据集严格评估当代大语言模型(LLMs)、LLM驱动代理、代码助手及RAG系统在版本约束下的代码生成能力,通过执行验证功能正确性。大量实验表明,最先进系统在此任务上面临显著困难:企业级模型基线成功率仅为48%-51%,凸显问题复杂性。通过提供基于执行的基准,强调代码库的动态特性,GitChameleon 2.0有助于更清晰理解此挑战,并推动更具适应性和可靠性的AI代码生成方法发展。数据集与评估代码已公开于https://github.com/mrcabbage972/GitChameleonBenchmark。
原文摘要 · Abstract (English)
The rapid evolution of software libraries poses a considerable hurdle for code generation, necessitating continuous adaptation to frequent version updates while preserving backward compatibility. While existing code evolution benchmarks provide valuable insights, they typically lack execution-based evaluation for generating code compliant with specific library versions. To address this, we introduce GitChameleon 2.0, a novel, meticulously curated dataset comprising 328 Python code completion problems, each conditioned on specific library versions and accompanied by executable unit tests. GitChameleon 2.0 rigorously evaluates the capacity of contemporary large language models (LLMs), LLM-powered agents, code assistants, and RAG systems to perform version-conditioned code generation that demonstrates functional accuracy through execution. Our extensive evaluations indicate that state-of-the-art systems encounter significant challenges with this task; enterprise models achieving baseline success rates in the 48-51% range, underscoring the intricacy of the problem. By offering an execution-based benchmark emphasizing the dynamic nature of code libraries, GitChameleon 2.0 enables a clearer understanding of this challenge and helps guide the development of more adaptable and dependable AI code generation methods. We make the dataset and evaluation code publicly available at https://github.com/mrcabbage972/GitChameleonBenchmark.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。