BFGen: Basic Flow Generation for Refining Requirements via LLM and Relational Graph Attention Networks
Guangyu Wang, Bangqi Li, Ji Tao Wu, Zhijun Shao · 2025
Identifying interaction scenarios between a system and its actors from the high-level requirements and forming use case basic flows is crucial in requirement refinement. Traditional manual methods often yield incomplete or inaccurate flows due to engineers' limited domain expertise, while rulebased methods-relying on predefined parsing rules-suffer from linguistic ambiguities and domain-dependent limitations. Although large language model (LLM) approaches leverage rich domain knowledge and robust natural language processing, they are constrained by input length, generation instability, and the risk of out-of-system outputs, frequently resulting in context-unaware or irrelevant flows. To overcome these challenges, this paper proposes BFGen to generate contextcompliant basic flows strictly adhering to domain constraints and requirement boundaries. BFGen employs LLMs to accurately extract domain-specific terms and interactions, and integrates a Relational Graph Attention Network with attention preservation factors to model logical dependencies and domain constraints effectively. Empirical evaluations on 13 public and 7 industrial datasets show that BFGen outperforms leading baselines by$\approx 14 \%$in Precision,$\approx 7-25 \%$in Recall,$\approx 11- 30 \%$in F1 Score, and$\approx 10-19 \%$in AUC. Furthermore, our evaluations confirm the effectiveness of both the LLM module and the attention preservation factors, and assess the impact of requirement completeness on the performance of BFGen.