Structuring Natural Language Requirements with Large Language Models
Johannes J. Norheim, Eric Rebentisch · 2024
Structured requirements have long been proposed to improve the quality of requirements while facilitating down-stream applications like modeling. Nevertheless, in practice, adopting structures such as templates and semi-formal logic imposes additional training and expertise constraints, limiting their wider adoption. In this paper, we investigate the application of natural language processing (NLP) to translate natural language requirements into structured representations. Existing methodologies have been reported for specific formalisms or requirement types. In this research preview, we go beyond the state-of-the-art by generalizing to generic templates and semi-formal logic. Specifically, we investigate the application of a state-of-the-art pre-trained large language model (LLM), GPT-4. We show preliminary evidence that this new technology can translate natural language requirements to a target template or semi-formal language based on as little as one translation example, as long as the example captures the same structure as the translated requirement. We observe this behavior across three formalisms: a requirements template structure (EARS), a custom minimalistic requirements modeling language for system performance requirements, and a semi-formal structure for linear temporal logic (LTL). We propose a rigorous way to investigate how well these observations are generalized based on this preliminary evidence.