arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2312.14856cs.SEcs.AI
收藏

Turbulence:系统化与自动化测试面向代码的指令微调大型语言模型

Turbulence: Systematically and Automatically Testing Instruction-Tuned Large Language Models for Code

Imperial College London(伦敦帝国学院);University of Oxford(牛津大学)

Shahin Honarvar, Mark van der Wilk, Alastair Donaldson

AI总结:

本文提出基准 Turbulence,通过参数化问题模板和测试预言机系统评估指令微调 LLM 的代码生成正确性与鲁棒性,揭示了模型在邻域问题上的泛化缺陷及错误类型。

摘要:

我们提出了一种通过新基准 Turbulence 系统评估指令微调大型语言模型(LLMs)在代码生成方面正确性与鲁棒性的方法。Turbulence 包含大量自然语言 question templates(问题模板),每个模板都是一个编程问题,且经过参数化以便以多种不同形式提问。每个问题模板都有关联的 test oracle(测试预言机),用于判定 LLM 返回的代码解决方案是否正确。因此,从单一问题模板出发,可以向 LLM 提出一个由极其相似的编程问题构成的 neighbourhood(邻域),并评估每个问题返回结果的正确性。这有助于识别 LLM 代码生成能力上的缺陷,包括 anomalies(异常现象):即 LLM 能正确解答邻域中 almost all(几乎所有)问题,却在特定参数实例化时失败。我们针对来自 OpenAI、Cohere 和 Meta 的五个 LLM 进行了实验,每个模型均在两种温度配置下测试。研究结果表明,总体而言,Turbulence 能够揭示 LLM 推理能力的缺陷。这远不止于指出 LLM 偶尔会生成错误代码(这已不足为奇):通过系统性地识别出 LLM 能解决邻域内部分问题却无法泛化解决整个邻域的情况,我们的方法能有效凸显 robustness(鲁棒性)问题。我们提供了数据与示例,阐明了 LLM 返回不正确代码结果时所犯错误的类型。

英文摘要:

We present a method for systematically evaluating the correctness and robustness of instruction-tuned large language models (LLMs) for code generation via a new benchmark, Turbulence. Turbulence consists of a large set of natural language $\textit{question templates}$, each of which is a programming problem, parameterised so that it can be asked in many different forms. Each question template has an associated $\textit{test oracle}$ that judges whether a code solution returned by an LLM is correct. Thus, from a single question template, it is possible to ask an LLM a $\textit{neighbourhood}$ of very similar programming questions, and assess the correctness of the result returned for each question. This allows gaps in an LLM's code generation abilities to be identified, including $\textit{anomalies}$ where the LLM correctly solves $\textit{almost all}$ questions in a neighbourhood but fails for particular parameter instantiations. We present experiments against five LLMs from OpenAI, Cohere and Meta, each at two temperature configurations. Our findings show that, across the board, Turbulence is able to reveal gaps in LLM reasoning ability. This goes beyond merely highlighting that LLMs sometimes produce wrong code (which is no surprise): by systematically identifying cases where LLMs are able to solve some problems in a neighbourhood but do not manage to generalise to solve the whole neighbourhood, our method is effective at highlighting $\textit{robustness}$ issues. We present data and examples that shed light on the kinds of mistakes that LLMs make when they return incorrect code results.

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

↑