基于LLM的食品安全法规中需求相关条款分类的实证研究
An Empirical Study on LLM-based Classification of Requirements-related Provisions in Food-safety Regulations
AI总结:
本研究通过扎根理论分析食品安全法规,并评估BERT和GPT系列LLM在分类需求相关条款上的效果,发现GPT-4o微调性能最佳,且模型具有跨管辖区泛化能力。
摘要:
随着工业4.0变革食品行业,软件在实现食品安全法规合规方面的作用日益关键。与许多法律领域一样,食品安全法规在很大程度上以技术无关的方式制定,以确保其长期性和广泛适用性。然而,这种方法在法规与日益用于实施法规的现代系统和软件之间留下了差距。在本文中,我们追求两个主要目标。首先,我们对食品安全法规进行扎根理论研究,并开发与系统和软件需求密切相关的食品安全概念的概念性表征。其次,我们考察了两类大型语言模型(LLM)——BERT和GPT——在基于需求相关食品安全概念自动分类法律条款方面的有效性。我们的结果表明:(a)在微调时,BERT和GPT家族中性能最佳模型之间的准确性差异相对较小。然而,我们实验中最强大的模型GPT-4o仍达到最高准确性,平均精确率为89%,平均召回率为87%;(b)使用GPT-4o进行少样本学习将召回率提高到97%,但精确率降至65%,表明微调和少样本学习之间存在权衡;(c)尽管我们的训练示例完全来自加拿大法规,但基于LLM的分类在美国的测试条款上表现持续良好,表明在监管管辖区之间具有一定程度的泛化能力;(d)对于我们的分类任务,LLM显著优于使用长短期记忆(LSTM)网络和自动关键词提取构建的简单基线。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。