An empirical study on LLM-based classification of requirements-related provisions in food-safety regulations

被引:0
作者
Hassani, Shabnam [1 ]
Sabetzadeh, Mehrdad [1 ]
Amyot, Daniel [1 ]
机构
[1] Univ Ottawa, Ottawa, ON, Canada
基金
加拿大自然科学与工程研究理事会;
关键词
Requirements engineering; Legal requirements; Classification; Large language models (LLMs); Food safety; Internet of things; PRIVACY;
D O I
10.1007/s10664-025-10619-z
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
As Industry 4.0 transforms the food industry, the role of software in achieving compliance with food-safety regulations is becoming increasingly critical. Food-safety regulations, like those in many legal domains, have largely been articulated in a technology-independent manner to ensure their longevity and broad applicability. However, this approach leaves a gap between the regulations and the modern systems and software increasingly used to implement them. In this article, we pursue two main goals. First, we conduct a Grounded Theory study of food-safety regulations and develop a conceptual characterization of food-safety concepts that closely relate to systems and software requirements. Second, we examine the effectiveness of two families of large language models (LLMs) - BERT and GPT - in automatically classifying legal provisions based on requirements-related food-safety concepts. Our results show that: (a) when fine-tuned, the accuracy differences between the best-performing models in the BERT and GPT families are relatively small. Nevertheless, the most powerful model in our experiments, GPT-4o, still achieves the highest accuracy, with an average Precision of 89% and an average Recall of 87%; (b) few-shot learning with GPT-4o increases Recall to 97% but decreases Precision to 65%, suggesting a trade-off between fine-tuning and few-shot learning; (c) despite our training examples being drawn exclusively from Canadian regulations, LLM-based classification performs consistently well on test provisions from the US, indicating a degree of generalizability across regulatory jurisdictions; and (d) for our classification task, LLMs significantly outperform simpler baselines constructed using long short-term memory (LSTM) networks and automatic keyword extraction.
引用
收藏
页数:40
相关论文
共 116 条
[1]   On the relationship between similar requirements and similar software A case study in the railway domain [J].
Abbas, Muhammad ;
Ferrari, Alessio ;
Shatnawi, Anas ;
Enoiu, Eduard ;
Saadatmand, Mehrdad ;
Sundmark, Daniel .
REQUIREMENTS ENGINEERING, 2023, 28 (01) :23-47
[2]   AI-enabled Regulatory Change Analysis of Legal Requirements [J].
Abualhaija, Sallam ;
Ceci, Marcello ;
Sannier, Nicolas ;
Bianculli, Domenico ;
Briand, Lionel C. ;
Zetzsche, Dirk ;
Bodellini, Marco .
32ND IEEE INTERNATIONAL REQUIREMENTS ENGINEERING CONFERENCE, RE 2024, 2024, :5-17
[3]   Automated Question Answering for Improved Understanding of Compliance Requirements: A Multi-Document Study [J].
Abualhaija, Sallam ;
Arora, Chetan ;
Sleimi, Amin ;
Briand, Lionel C. .
2022 30TH IEEE INTERNATIONAL REQUIREMENTS ENGINEERING CONFERENCE (RE 2022), 2022, :39-50
[4]  
Ahmed T, 2024, Arxiv, DOI arXiv:2408.05534
[5]   Optuna: A Next-generation Hyperparameter Optimization Framework [J].
Akiba, Takuya ;
Sano, Shotaro ;
Yanase, Toshihiko ;
Ohta, Takeru ;
Koyama, Masanori .
KDD'19: PROCEEDINGS OF THE 25TH ACM SIGKDD INTERNATIONAL CONFERENCCE ON KNOWLEDGE DISCOVERY AND DATA MINING, 2019, :2623-2631
[6]   A Zero-Shot Learning Approach to Classifying Requirements: A Preliminary Study [J].
Alhoshan, Waad ;
Zhao, Liping ;
Ferrari, Alessio ;
Letsholo, Keletso J. .
REQUIREMENTS ENGINEERING: FOUNDATION FOR SOFTWARE QUALITY, REFSQ 2022, 2022, 13216 :52-59
[7]  
Amaral O, 2023, P 31 IEEE INT REQ EN
[8]  
Amaral O., 2023, IEEE Trans. Softw. Eng.
[9]   AI-Enabled Automation for Completeness Checking of Privacy Policies [J].
Amaral, Orlando ;
Abualhaija, Sallam ;
Torre, Damiano ;
Sabetzadeh, Mehrdad ;
Briand, Lionel C. .
IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2022, 48 (11) :4647-4674
[10]  
[Anonymous], 1991, Elementary Statistics for the Social Sciences: Study Guide