提升需求完整性:通过大型语言模型提供自动化辅助
Improving Requirements Completeness: Automated Assistance through Large Language Models
AI总结:
本文利用BERT的掩码语言模型预测需求中缺失的术语,并通过机器学习过滤器降低噪声,有效提升了自然语言需求完整性检测的准确性与实用性。
摘要:
自然语言(NL)可以说是表达系统和软件需求最普遍的媒介。检测NL需求中的不完整性是一项重大挑战。识别不完整性的一种方法是将需求与外部来源进行比较。鉴于大型语言模型(LLMs)的兴起,出现了一个有趣的问题:LLMs是否可作为有用的外部知识源,用于检测NL需求中潜在的不完整性?本文通过利用BERT来探讨这一问题。具体而言,我们采用BERT的掩码语言模型(MLM)来生成上下文化的预测,以填充需求中的掩码槽位。为了模拟不完整性,我们从需求中保留部分内容,并评估BERT预测术语的能力,这些术语存在于被保留的内容中,但不在已公开的内容中。BERT可以为每个掩码产生多个预测。我们的第一个贡献是确定每个掩码的最佳预测数量,在有效识别需求中的遗漏与减轻预测中存在的噪声之间取得平衡。我们的第二个贡献涉及设计一个基于机器学习的过滤器,对BERT的预测进行后处理以进一步降低噪声。我们使用来自PURE数据集的40个需求规格进行实证评估。研究结果表明:(1)BERT的预测有效地突出了需求中缺失的术语;(2)BERT在识别相关但缺失的术语方面优于更简单的基线方法;(3)我们的过滤器显著减少了预测中的噪声,提升了BERT作为需求完整性检查工具的有效性。
英文摘要:
Natural language (NL) is arguably the most prevalent medium for expressing systems and software requirements. Detecting incompleteness in NL requirements is a major challenge. One approach to identify incompleteness is to compare requirements with external sources. Given the rise of large language models (LLMs), an interesting question arises: Are LLMs useful external sources of knowledge for detecting potential incompleteness in NL requirements? This article explores this question by utilizing BERT. Specifically, we employ BERT's masked language model (MLM) to generate contextualized predictions for filling masked slots in requirements. To simulate incompleteness, we withhold content from the requirements and assess BERT's ability to predict terminology that is present in the withheld content but absent in the disclosed content. BERT can produce multiple predictions per mask. Our first contribution is determining the optimal number of predictions per mask, striking a balance between effectively identifying omissions in requirements and mitigating noise present in the predictions. Our second contribution involves designing a machine learning-based filter to post-process BERT's predictions and further reduce noise. We conduct an empirical evaluation using 40 requirements specifications from the PURE dataset. Our findings indicate that: (1) BERT's predictions effectively highlight terminology that is missing from requirements, (2) BERT outperforms simpler baselines in identifying relevant yet missing terminology, and (3) our filter significantly reduces noise in the predictions, enhancing BERT's effectiveness as a tool for completeness checking of requirements.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。