Using Large Language Models for Natural Language Processing Tasks in Requirements Engineering: A Systematic Guideline
Andreas Vogelsang, Jannik Fischbach
TL;DR
This chapter addresses the challenge of applying large language models to Requirements Engineering tasks amid limited labeled data and heterogeneous task needs. It provides a structured foundation on LLM fundamentals and presents a decision-tree-guided guideline to choose among encoder-only, decoder-only, and encoder-decoder architectures, as well as usage modes such as embedding-based repurposing, prompting, and retrieval-augmented generation. It also covers domain adaptation and fine-tuning strategies (unsupervised and supervised) and highlights practical considerations like data quality, evaluation, and the evolving NLP landscape. The work aims to equip RE researchers and practitioners with concrete, adaptable methods to harness LLMs for tasks such as classification, traceability, and test-case generation, improving automation and output quality in real-world settings.
Abstract
Large Language Models (LLMs) are the cornerstone in automating Requirements Engineering (RE) tasks, underpinning recent advancements in the field. Their pre-trained comprehension of natural language is pivotal for effectively tailoring them to specific RE tasks. However, selecting an appropriate LLM from a myriad of existing architectures and fine-tuning it to address the intricacies of a given task poses a significant challenge for researchers and practitioners in the RE domain. Utilizing LLMs effectively for NLP problems in RE necessitates a dual understanding: firstly, of the inner workings of LLMs, and secondly, of a systematic approach to selecting and adapting LLMs for NLP4RE tasks. This chapter aims to furnish readers with essential knowledge about LLMs in its initial segment. Subsequently, it provides a comprehensive guideline tailored for students, researchers, and practitioners on harnessing LLMs to address their specific objectives. By offering insights into the workings of LLMs and furnishing a practical guide, this chapter contributes towards improving future research and applications leveraging LLMs for solving RE challenges.
