DOI: 10.1002/spe.70114 ISSN: 0038-0644

Leveraging Large Language Model for Ambiguity Detection and Resolution in Software Requirement Specifications

Ankit Raj, Muhammad Abdul Basit Ur Rahim, Mayur Jain, Shahid Hussain

ABSTRACT

Background

Ambiguities in software requirement documents, such as software requirement specifications (SRS) and user stories, pose significant challenges to the success of software development projects. These ambiguities often result in misinterpretations, inconsistent system designs, and increased costs and delays. Despite advancements in requirements engineering and natural language processing, existing methods frequently address only limited types of ambiguities or fail to integrate detection and resolution processes effectively.

Aims

This research introduces a framework that leverages fine‐tuned large language models (LLMs) to systematically detect and resolve ambiguities in software requirements. The framework targets seven key categories of ambiguities: semantic, syntactic, functional, operational, scope, temporal, and quality.

Materials and Methods

The framework uses fine‐tuned LLaMA 3 and LLaMA 3.1 models with parameter‐efficient LoRA adapters. A diverse dataset of annotated SRS documents and user stories was developed to evaluate the framework. Ambiguity classification was evaluated using accuracy, precision, recall, and F1 scores, while ambiguity resolution was assessed using BLEU, ROUGE, and BERTScore metrics, complemented by manual evaluation.

Results

The fine‐tuned models demonstrated substantial improvements in ambiguity classification and generated clear, unambiguous alternatives for ambiguous requirements. The evaluation results demonstrated the effectiveness of the proposed approach in identifying and resolving ambiguities across the targeted categories.

Discussion

The findings demonstrate that fine‐tuned LLMs can support comprehensive ambiguity detection and resolution across multiple software requirement formats. The framework improves the clarity and usability of requirements and can support more effective communication among software development stakeholders.

Conclusion

The proposed framework provides a practical solution for improving the quality of requirements documentation and addressing ambiguities across diverse formats. It can help minimize errors and enhance stakeholder communication in both agile and traditional development environments. Future research will focus on extending the framework's scalability and adaptability to diverse contexts and domain‐specific requirements.