CodeScope: An Execution-based Multilingual Multitask Multidimensional Benchmark for Evaluating LLMs on Code Understanding and Generation

📄 arXiv: 2311.08588v3 📥 PDF

作者: Weixiang Yan, Haitian Liu, Yunkun Wang, Yunzhe Li, Qian Chen, Wen Wang, Tingyu Lin, Weishan Zhao, Li Zhu, Hari Sundaram, Shuiguang Deng

分类: cs.CL, cs.AI, cs.SE

发布日期: 2023-11-14 (更新: 2024-06-07)

备注: Accepted by ACL 2024 main conference

🔗 代码/项目: GITHUB


💡 一句话要点

提出CodeScope以解决现有代码理解与生成基准的不足问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 代码理解 代码生成 多语言支持 执行基准 大型语言模型 自动化编程 评估基准

📋 核心要点

  1. 现有评估基准主要集中在少数流行编程语言和特定任务,无法满足真实开发环境的多样化需求。
  2. 提出CodeScope基准,通过执行代码的方式评估LLMs的编码能力,涵盖多种编程语言和任务。
  3. 通过对八种主流LLMs的系统评估,展示了CodeScope在评估能力上的优势和挑战,提供了更全面的评估视角。

📝 摘要(中文)

大型语言模型(LLMs)在编程辅助和自动化方面表现出色,但现有的评估基准存在严重局限性。大多数基准关注于有限的编程语言和特定任务,未能反映真实软件开发中的多语言和多任务需求。此外,现有基准未考虑生成代码的可执行性及执行结果的一致性。为此,本文提出了CodeScope,一个基于执行的多语言、多任务、多维度评估基准,旨在全面测量LLMs在编码任务上的能力。CodeScope涵盖43种编程语言和八种编码任务,从长度、难度和效率三个维度评估LLMs的编码性能,并开发了支持14种编程语言的自动化代码执行引擎MultiCodeEngine。最后,系统评估了八种主流LLMs,展示了CodeScope在评估LLMs代码理解和生成任务方面的广泛性和挑战性。

🔬 方法详解

问题定义:现有的代码理解和生成评估基准在语言多样性和任务范围上存在不足,且未考虑生成代码的可执行性和一致性。

核心思路:CodeScope通过引入执行基础的评估机制,覆盖多种编程语言和任务,旨在提供更全面的LLMs能力测量。

技术框架:CodeScope的整体架构包括多个模块,首先是多语言支持的代码生成,其次是MultiCodeEngine用于代码执行,最后是多维度评估指标的计算。

关键创新:CodeScope的创新在于其执行基础的评估方法,能够真实反映生成代码的有效性,与传统基准相比,提供了更高的评估准确性和广度。

关键设计:在设计中,MultiCodeEngine支持14种编程语言的自动执行,评估指标包括代码的长度、难度和执行效率,确保了评估的全面性和准确性。

🖼️ 关键图片

fig_0
fig_1

📊 实验亮点

实验结果显示,CodeScope在评估八种主流LLMs时,展现出更广泛的评估能力和挑战性,相较于其他基准,提供了更高的准确性和多样性,显著提升了对LLMs性能的理解。

🎯 应用场景

CodeScope的研究成果可广泛应用于软件开发、教育和自动化编程工具等领域。通过提供更准确的评估基准,开发者和研究人员可以更好地理解和优化大型语言模型在代码生成和理解方面的能力,推动相关技术的进步与应用。

📄 摘要(原文)

Large Language Models (LLMs) have demonstrated remarkable performance on assisting humans in programming and facilitating programming automation. However, existing benchmarks for evaluating the code understanding and generation capacities of LLMs suffer from severe limitations. First, most benchmarks are insufficient as they focus on a narrow range of popular programming languages and specific tasks, whereas real-world software development scenarios show a critical need to implement systems with multilingual and multitask programming environments to satisfy diverse requirements. Second, most benchmarks fail to consider the actual executability and the consistency of execution results of the generated code. To bridge these gaps between existing benchmarks and expectations from practical applications, we introduce CodeScope, an execution-based, multilingual, multitask, multidimensional evaluation benchmark for comprehensively measuring LLM capabilities on coding tasks. CodeScope covers 43 programming languages and eight coding tasks. It evaluates the coding performance of LLMs from three dimensions (perspectives): length, difficulty, and efficiency. To facilitate execution-based evaluations of code generation, we develop MultiCodeEngine, an automated code execution engine that supports 14 programming languages. Finally, we systematically evaluate and analyze eight mainstream LLMs and demonstrate the superior breadth and challenges of CodeScope for evaluating LLMs on code understanding and generation tasks compared to other benchmarks. The CodeScope benchmark and code are publicly available at https://github.com/WeixiangYAN/CodeScope.