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

大型语言模型在自然语言处理中的变形测试

Metamorphic Testing of Large Language Models for Natural Language Processing

University of Auckland(奥克兰大学)

Steven Cho, Stefano Ruberto, Valerio Terragni

AI总结:

本文提出了一种针对大型语言模型的变形测试方法,通过收集和实验191个变形关系,评估了变形测试在自然语言处理任务中的有效性与局限性。

摘要:

使用大型语言模型(LLMs)进行自然语言处理(NLP)任务已越来越普遍。LLMs的多功能性使其能够应用于广泛的任务。尽管最近的LLMs性能通常出色,但已有研究表明它们经常会产生错误的结果。自动识别这些故障行为对提高LLMs的有效性非常有用。一个障碍是标记数据集的有限可用性,这需要一个Oracle来确定LLM行为的正确性。变形测试(MT)是一种流行的测试方法,可以缓解这一Oracle问题。MT的核心是变形关系(MRs),它们定义了相关输入输出之间的关系。MT可以在不需要显式或Oracle(例如标记数据集)的情况下暴露故障行为。本文迄今为止对LLMs的MT进行了最全面的研究。我们进行了文献综述,并收集了191个用于NLP任务的MRs。我们实现了一个代表性子集(36个MRs),以对三个流行的LLMs进行一系列实验,运行了大约560,000次变形测试。结果揭示了MT在LLMs中的能力和机会,以及其局限性。

英文摘要:

Using large language models (LLMs) to perform natural language processing (NLP) tasks has become increasingly pervasive in recent times. The versatile nature of LLMs makes them applicable to a wide range of such tasks. While the performance of recent LLMs is generally outstanding, several studies have shown that they can often produce incorrect results. Automatically identifying these faulty behaviors is extremely useful for improving the effectiveness of LLMs. One obstacle to this is the limited availability of labeled datasets, which necessitates an oracle to determine the correctness of LLM behaviors. Metamorphic testing (MT) is a popular testing approach that alleviates this oracle problem. At the core of MT are metamorphic relations (MRs), which define relationships between the outputs of related inputs. MT can expose faulty behaviors without the need for explicit oracles (e.g., labeled datasets). This paper presents the most comprehensive study of MT for LLMs to date. We conducted a literature review and collected 191 MRs for NLP tasks. We implemented a representative subset (36 MRs) to conduct a series of experiments with three popular LLMs, running approximately 560,000 metamorphic tests. The results shed light on the capabilities and opportunities of MT for LLMs, as well as its limitations.

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

↑