OOP:面向大语言模型的面向对象编程评估基准
OOP: Object-Oriented Programming Evaluation Benchmark for Large Language Models
AI总结:
本文提出面向对象编程评估基准OOP,包含431个Python程序和新指标pass@o,通过评估23个大语言模型揭示现有模型在OOP代码生成上的不足,并公开基准与脚本。
摘要:
推进自动化编程需要稳健且全面的代码生成基准,然而当前的评估框架在很大程度上忽视了面向对象编程(OOP),而偏向函数式编程(FP),例如 HumanEval 和 MBPP。为解决这一问题,本研究引入了一个开创性的以 OOP 为核心的基准,包含 431 个 Python 程序,涵盖类、封装方法等基本 OOP 概念和特性。我们提出了一种新的评估指标 pass@o,专为 OOP 量身定制,增强了传统的 pass@k 度量。我们对 23 个领先的大语言模型(LLMs)进行了评估,包括通用模型和代码专用模型,得出三个关键见解:1)pass@o 为 OOP 代码生成提供了更具相关性和全面性的评估;2)尽管在 FP 方面表现出色,但 WizardCoder 等代码专用 LLM 在 OOP 方面落后于 ChatGPT 等模型;3)所有先进 LLM 在我们的 OOP 基准上表现不佳,凸显了该领域亟需改进。我们的基准和脚本已公开发布于:https://github.com/alphadl/OOP-eval。
英文摘要:
Advancing automated programming necessitates robust and comprehensive code generation benchmarks, yet current evaluation frameworks largely neglect object-oriented programming (OOP) in favor of functional programming (FP), e.g., HumanEval and MBPP. To address this, our study introduces a pioneering OOP-focused benchmark, featuring 431 Python programs that encompass essential OOP concepts and features like classes and encapsulation methods. We propose a novel evaluation metric, pass@o, tailored for OOP, enhancing traditional pass@k measures. Our evaluation of 23 leading large language models (LLMs), including both general and code-specialized models, reveals three key insights: 1) pass@o offers a more relevant and comprehensive assessment for OOP code generation; 2) Despite excelling in FP, code-specialized LLMs like WizardCoder lag in OOP compared to models like ChatGPT; 3) The poor performance of all advanced LLMs on our OOP benchmark highlights a critical need for improvements in this field. Our benchmark and scripts are publicly released at: https://github.com/alphadl/OOP-eval.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。