arXiv:2503.05102cs.SEcs.CL2025-03

用大模型自动生成测试用例,全面评估NLP模型的性能短板。

AutoTestForge: A Multidimensional Automated Testing Framework for Natural Language Processing Models

  • 借助大模型自动创建测试模板并实例化,大幅减少人工干预。
  • 在情感分析和语义相似度任务中,错误检测率分别达30.89%和34.58%。
  • 覆盖分类、公平性、鲁棒性三维度,适合模型开发者与评测人员使用。

近年来,行为测试在自然语言处理(NLP)模型评估中的应用显著增长。然而,现有方法仍受限于人工投入大和能力评估范围窄。为此,本文提出AutoTestForge,一个面向NLP模型的自动化多维测试框架。该框架利用大语言模型(LLMs)自动生成测试模板并实例化,显著降低人工参与。同时,通过基于差分测试的标签验证机制与多模型投票系统,保障测试用例质量。框架在三个维度扩展测试集:分类、公平性与鲁棒性,实现对NLP模型能力的全面评估。在情感分析(SA)和语义文本相似度(STS)任务上的综合评估显示,AutoTestForge持续优于现有数据集与测试工具,平均错误检测率分别达到30.89%(SA)和34.58%(STS)。不同生成策略均表现稳定,错误检测率在29.03%至36.82%之间。

原文摘要 · Abstract (English)

In recent years, the application of behavioral testing in Natural Language Processing (NLP) model evaluation has experienced a remarkable and substantial growth. However, the existing methods continue to be restricted by the requirements for manual labor and the limited scope of capability assessment. To address these limitations, we introduce AutoTestForge, an automated and multidimensional testing framework for NLP models in this paper. Within AutoTestForge, through the utilization of Large Language Models (LLMs) to automatically generate test templates and instantiate them, manual involvement is significantly reduced. Additionally, a mechanism for the validation of test case labels based on differential testing is implemented which makes use of a multi-model voting system to guarantee the quality of test cases. The framework also extends the test suite across three dimensions, taxonomy, fairness, and robustness, offering a comprehensive evaluation of the capabilities of NLP models. This expansion enables a more in-depth and thorough assessment of the models, providing valuable insights into their strengths and weaknesses. A comprehensive evaluation across sentiment analysis (SA) and semantic textual similarity (STS) tasks demonstrates that AutoTestForge consistently outperforms existing datasets and testing tools, achieving higher error detection rates (an average of $30.89\%$ for SA and $34.58\%$ for STS). Moreover, different generation strategies exhibit stable effectiveness, with error detection rates ranging from $29.03\% - 36.82\%$.

NLP测试自动化评估大模型应用

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。