arXiv:2511.23007cs.SEcs.AI2025-11

用双编码器提升需求句子冲突检测准确率,跨领域表现更优

A transfer learning approach for automatic conflicts detection in software requirement sentence pairs based on dual encoders

  • 采用SBERT与SimCSE双编码器生成句子嵌入,融合六维拼接特征
  • 在同领域和跨领域场景下,宏平均F1分别提升10.4%和11.4%
  • 适合需要高精度需求一致性验证的软件工程团队使用

软件需求文档通常包含数万个独立需求,确保其一致性对软件项目成功至关重要。自动化检测方法可显著提高效率并降低成本,但现有方法仍面临数据不平衡导致的低准确率、单编码器限制语义提取能力、跨领域迁移性能不佳等问题。本文提出基于SBERT与SimCSE的可迁移需求冲突检测框架TSRCDF-SS。该框架采用两个独立编码器(SBERT与SimCSE)生成需求对的句子嵌入,并通过六元素拼接策略融合表示;分类器则由两层全连接前馈神经网络构成,结合变体Focal Loss、领域特定约束及置信度惩罚项实现混合损失优化;同时协同集成顺序与跨领域迁移学习。实验表明,在同领域设置下,该框架的宏平均F1与加权F1均提升10.4%,跨领域场景中宏平均F1提升11.4%。

原文摘要 · Abstract (English)

Software Requirement Document (RD) typically contain tens of thousands of individual requirements, and ensuring consistency among these requirements is critical for the success of software engineering projects. Automated detection methods can significantly enhance efficiency and reduce costs; however, existing approaches still face several challenges, including low detection accuracy on imbalanced data, limited semantic extraction due to the use of a single encoder, and suboptimal performance in cross-domain transfer learning. To address these issues, this paper proposes a Transferable Software Requirement Conflict Detection Framework based on SBERT and SimCSE, termed TSRCDF-SS. First, the framework employs two independent encoders, Sentence-BERT (SBERT) and Simple Contrastive Sentence Embedding (SimCSE), to generate sentence embeddings for requirement pairs, followed by a six-element concatenation strategy. Furthermore, the classifier is enhanced by a two-layer fully connected feedforward neural network (FFNN) with a hybrid loss optimization strategy that integrates a variant of Focal Loss, domain-specific constraints, and a confidence-based penalty term. Finally, the framework synergistically integrates sequential and cross-domain transfer learning. Experimental results demonstrate that the proposed framework achieves a 10.4% improvement in both macro-F1 and weighted-F1 scores in in-domain settings, and an 11.4% increase in macro-F1 in cross-domain scenarios.

需求检测双编码器迁移学习自然语言处理

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