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

**Authors:** Yizheng Wang, Tao Jiang, Jinyan Bai, Zhengbin Zou, Tiancheng Xue, Nan Zhang, Jie Luan

PMC · DOI: 10.1371/journal.pone.0344174 · 2026-03-12

## TL;DR

This paper introduces a new framework for detecting conflicts in software requirements using dual encoders and transfer learning, improving accuracy and cross-domain performance.

## Contribution

The novel framework combines dual encoders (SBERT and SimCSE) with a hybrid loss function and transfer learning to enhance conflict detection in software requirements.

## Key findings

- The framework achieves 4.9% to 12.1% improvement in macro-F1 and weighted-F1 under non-cross-domain conditions.
- It shows an average 6% enhancement in macro-F1 under optimal cross-domain scenarios.

## Abstract

Software Requirement Document (RD) typically contains tens of thousands of individual requirements, and ensuring consistency among these requirements is a critical prerequisite 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 poor performance in cross-domain transfer learning. To address these issues, this paper proposes a Transferable Software Requirement Conflicts Detection Framework based on SBERT and SimSCE, termed TSRCDF-SS. First, the framework employs two independent encoders named 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 incorporating a two-layer fully connected, alongside a hybrid loss function optimization strategy for feedforward neural network (FFNN) 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, compared with other advanced classical methods, our framework achieves an improvement ranging from 4.9% to 12.1% in macro-F1 and weighted-F1 under non-cross-domain conditions, and an average enhancement of 6% in macro-F1 under optimal cross-domain scenarios.

## Figures

28 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12981555/full.md

---
Source: https://tomesphere.com/paper/PMC12981555