Background: Classifying natural language requirements (NLRs) is challenging, especially with large volumes. Research shows that Large Language Models (LLMs) can assist by categorising NLRs into Functional Requirements (FR) and Non-Functional Requirements (NFR). However, concerns about their consistency have been raised.
Aim: In this work, we aim to investigate the consistency when Generative Pretrained Transformer (GPT) -like models, such as GPT-4.1 and LLAMA3.3-70B, classify NLRs into FRs and NFRs by using the Few-Shot Learning (FSL) approach. We explore how the number of examples used in the FSL approach and the temperature setting affect the consistency of NRL classification results.
Method: For this study, we use the PROMISE NFR dataset. Experimental design is employed to investigate the binary classification of FR versus NFR. To accomplish this goal, we use FSL with GPT-4.1 and LLAMA3.3-70B to classify the requirements.
Results: The results show that GPT-4.1 performs similarly with two and ten examples. However, the results somewhat differ for LLAMA3.3-70B, where FSL is slightly better using FSL with ten examples compared to two. Moreover, both LLM models seem to perform well in identifying FRs but have a more conservative classification behaviour when classifying NFRs. Finally, the temperature parameter does not seem to significantly impact the classification results.
Conclusions: When using FSL, using two versus ten examples slightly impacts the results. Moreover, we experimented with different temperatures (Temp = 0, Temp = 1, Temp = 2), and the temperature parameter does not seem to impact the classification results. Therefore, LLMs do not seem to become more creative even when the temperature increases.
Springer, 2027. Vol. 16315, p. 166-180
18th International Conference on the Quality of Information and Communications Technology (QUATIC 2025), Lisbon, Portugal, September 3–5, 2025