arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2406.12635cs.SEcs.AI
收藏

ScenEval:一个用于代码生成的基于场景评估的基准

ScenEval: A Benchmark for Scenario-Based Evaluation of Code Generation

School of Engineering, Computing and Mathematics, Oxford Brookes University(牛津布鲁克斯大学工程、计算与数学学院)

Debalina Ghosh Paul, Hong Zhu, Ian Bayley

AI总结:

本研究针对机器学习模型场景化评估的测试集构建问题,提出附元数据的基准构建方法,推出ScenEval基准并评估ChatGPT的Java代码生成,揭示其性能随任务复杂度变化的规律及代码复杂度特征。

摘要:

在机器学习模型的基于场景的评估中,一个核心问题是如何构建能代表各类场景的测试数据集。本文提出的方法是构建一个基准,并为每个测试用例附加元数据。随后可通过测试态射(test morphisms)构建测试系统,这些测试态射会基于元数据筛选测试用例,从而形成数据集。\n 本文以代码生成大语言模型为例演示了该方法。研究基于教科书、在线教程网站以及Stack Overflow中的问题构建了名为ScenEval的基准。文章演示了按场景筛选的过程,并使用生成的测试集评估了ChatGPT的Java代码生成能力。\n 实验发现,ChatGPT的性能随编码任务复杂度的提升而下降,在多线程、数据结构算法、递归方法等高级主题上表现最弱。ChatGPT生成的Java代码行数往往远少于参考解决方案,但若生成的代码正确,其圈复杂度和认知复杂度指标通常更高;而若生成的代码不正确,其复杂度则往往低于参考解决方案。

英文摘要:

In the scenario-based evaluation of machine learning models, a key problem is how to construct test datasets that represent various scenarios. The methodology proposed in this paper is to construct a benchmark and attach metadata to each test case. Then a test system can be constructed with test morphisms that filter the test cases based on metadata to form a dataset. The paper demonstrates this methodology with large language models for code generation. A benchmark called ScenEval is constructed from problems in textbooks, an online tutorial website and Stack Overflow. Filtering by scenario is demonstrated and the test sets are used to evaluate ChatGPT for Java code generation. Our experiments found that the performance of ChatGPT decreases with the complexity of the coding task. It is weakest for advanced topics like multi-threading, data structure algorithms and recursive methods. The Java code generated by ChatGPT tends to be much shorter than reference solution in terms of number of lines, while it is more likely to be more complex in both cyclomatic and cognitive complexity metrics, if the generated code is correct. However, the generated code is more likely to be less complex than the reference solution if the code is incorrect.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑