面向自然语言处理应用的代际测试生成
Intergenerational Test Generation for Natural Language Processing Applications
AI总结:
本文提出自动化测试生成方法NLPLego,基于经典语言学句子解析将种子句拆解为模板和附加语并重组为新测试,在三个NLP任务中以约95.7%精度成功检测出四个最先进模型的大量错误行为。
摘要:
现代NLP应用的开发通常依赖于包含大量人工标注测试的各种基准数据集来评估性能。虽然构建数据集往往耗费大量资源,但在留出数据上的性能可能无法正确反映其在真实应用场景中的能力,从而造成巨大的误解和经济损失。为了缓解这一问题,本文提出了一种自动化测试生成方法,用于检测各种NLP应用的错误行为。该方法基于经典语言学的句子解析过程设计,因此能够将基本语法元素和附加语组装成语法正确且具有适当预言机信息的测试。我们将该方法实现于NLPLego中,旨在充分利用种子句子的潜力以实现测试生成的自动化。NLPLego将种子句子拆解为模板和附加语,然后通过将符合上下文的附加语按特定顺序与模板组装来生成新句子。与特定任务的方法不同,NLPLego生成的测试具有派生关系和不同程度的变异,这使得构建适当的蜕变关系更加容易。因此,NLPLego具有通用性,能够满足各种NLP应用的测试需求。为了验证NLPLego,我们在三个常见的NLP任务上进行了实验,识别出四个最先进模型中的失败。给定来自SQuAD 2.0、SST和QQP的种子测试,NLPLego在三个任务中分别以约95.7%的精度成功检测出1732、5301和261879个错误行为。
英文摘要:
The development of modern NLP applications often relies on various benchmark datasets containing plenty of manually labeled tests to evaluate performance. While constructing datasets often costs many resources, the performance on the held-out data may not properly reflect their capability in real-world application scenarios and thus cause tremendous misunderstanding and monetary loss. To alleviate this problem, in this paper, we propose an automated test generation method for detecting erroneous behaviors of various NLP applications. Our method is designed based on the sentence parsing process of classic linguistics, and thus it is capable of assembling basic grammatical elements and adjuncts into a grammatically correct test with proper oracle information. We implement this method into NLPLego, which is designed to fully exploit the potential of seed sentences to automate the test generation. NLPLego disassembles the seed sentence into the template and adjuncts and then generates new sentences by assembling context-appropriate adjuncts with the template in a specific order. Unlike the taskspecific methods, the tests generated by NLPLego have derivation relations and different degrees of variation, which makes constructing appropriate metamorphic relations easier. Thus, NLPLego is general, meaning it can meet the testing requirements of various NLP applications. To validate NLPLego, we experiment with three common NLP tasks, identifying failures in four state-of-art models. Given seed tests from SQuAD 2.0, SST, and QQP, NLPLego successfully detects 1,732, 5301, and 261,879 incorrect behaviors with around 95.7% precision in three tasks, respectively.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。