ThrowBench:通过预测运行时异常对 LLMs 进行基准测试
ThrowBench: Benchmarking LLMs by Predicting Runtime Exceptions
AI总结:
为评估LLMs预测程序运行时异常的能力,本文提出包含2400余个多语言程序的基准ThrowBench,测试发现六个先进代码LLM的F1分数仅为19%-38%,为模型弱点评估提供了无泄露的新基准。
摘要:
现代大型语言模型(LLMs)展现出了惊人的代码理解与合成能力。为了评估这些能力,人们设计了一些基准测试(例如 HumanEval)。然而,大多数基准测试侧重于根据自然语言指令进行代码合成。因此,这类基准测试未涵盖其他形式的代码理解。此外,关于数据污染和泄露问题也一直存在担忧。即,基准测试中的问题(或密切相关的问题)可能出现在训练集中,从而对基准测试结果产生强烈偏差。在本研究中,我们探讨了大型语言模型能否正确预测程序的运行时行为。为此,我们引入了 ThrowBench,这是一个包含超过 2,400 个用四种不同编程语言编写的简短用户程序的基准测试。这些程序大多数在运行时会抛出异常(由于存在错误)。我们要求 LLMs 预测所呈现的程序是否会抛出异常,如果会,具体是哪一种。在六个最先进的代码 LLMs 上评估我们的基准测试时,我们观察到的性能一般,F1 分数在 19% 到 38% 之间。对更广泛的代码能力进行基准测试可以改善对代码 LLMs 的评估,并有助于识别当前模型的薄弱环节。此外,由于标准答案是通过程序执行确定的,因此不存在泄露的担忧。我们随本工作一同发布了 ThrowBench 及所有结果。
英文摘要:
Modern Large Language Models (LLMs) have shown astounding capabilities of code understanding and synthesis. In order to assess such capabilities, several benchmarks have been devised (e.g., HumanEval). However, most benchmarks focus on code synthesis from natural language instructions. Hence, such benchmarks do not test for other forms of code understanding. Moreover, there have been concerns about contamination and leakage. That is, benchmark problems (or closely related problems) may appear in training set, strongly biasing benchmark results. In this work we investigate whether large language models can correctly predict runtime program behavior. To this end, we introduce ThrowBench, a benchmark consisting of over 2,400 short user-written programs written in four different programming languages. The majority of these programs throw an exception during runtime (due to a bug). LLMs are asked to predict whether a presented program throws an exception and, if so, which one. Evaluating our benchmark on six state-of-the-art code LLMs we see modest performance ranging from 19 to 38% (F1 score). Benchmarking a wider set of code capabilities could improve the assessment of code LLMs and help identify weak points in current models. Moreover, as ground-truth answers have been determined through program execution, leakage is not a concern. We release ThrowBench as well as all of our results together with this work.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。