The food safety regulation question answering (QA) task imposes high requirements on model accuracy, compliance, and interpretability. However, existing large language models (LLMs) face challenges in this domain, including imprecise knowledge retrieval, insufficient regulatory interpretation capabilities, and high computational costs. To address these issues, we proposed an intelligent question answering system based on the retrieval augmented generation (RAG) framework, with its core being the food safety regulation large language model (FSR-LLM). By optimizing database storage structures, retrieval strategies and the generator, FSR-LLM enhanced the quality and efficiency of food safety regulation QA. First, we constructed a food safety knowledge graph (KG) database to store regulatory provisions, food safety standards, and related data in a structured manner, improving the model’s capability to organize and utilize domain-specific knowledge. Additionally, we introduced an LLM-guided retrieval strategy, which enables intelligent query parsing and accurately extracts highly relevant information from the food safety regulation KG, reducing the retrieval of irrelevant or misleading contents. For the generator module, we fine-tuned Qwen-7B-Chat using low-rank adaptation (LoRA), ensuring better alignment with food safety QA tasks, while significantly reducing computational costs, allowing training on a single RTX 4090 GPU. Experimental results on the proposed dataset demonstrated that FSR-LLM outperformed baseline models in BLEU-4, Rouge-L, and accuracy, exhibiting higher precision and semantic coherence. This work provides a low-cost, high-performance, and scalable solution for intelligent food safety regulation.
毛典辉,王可浩,陈俊华,徐静婷
. An Intelligent Question Answering System for Food Safety Regulation Based on Retrieval-Augmented Generation Framework[J]. FOOD SCIENCE, 2025
, 46(22)
: 13
-22
.
DOI: 10.7506/spkx1002-6630-20250408-059