Abstract:
General large language models (LLMs) suffer from insufficient domain knowledge accumulation and professional expertise in specialized swine disease question answering (QA) tasks. The lack of effective answer evaluation and optimization mechanisms further induces factual hallucinations, severely undermining the logical consistency and diagnostic accuracy of LLMs in agricultural practical applications. To address these limitations, we propose a swine disease intelligent QA framework integrated with knowledge routing and agent reflection mechanisms, termed Reflective-QA. First, a high-quality swine disease corpus with approximately 10 million characters covering 163 swine diseases is constructed based on professional veterinary books, authoritative monographs, and clinical case records. The corpus is standardized and divided into five sub-corpora corresponding to infectious diseases, parasitic diseases, toxic diseases, nutritional-metabolic diseases, and common diseases according to pathogenic characteristics. The corpus can be utilized to broaden the background knowledge of the QA model and enhance the professionalism of answers. Second, a knowledge routing strategy based on multi-agent voting is designed to map user queries to targeted disease sub-corpora. This strategy effectively mitigates noise interference and retrieval explosion in the process of QA, compressing the retrieval space and ensuring the purity of vectorized retrieval information. Third, a multi-agent collaborative QA mechanism based on different roles collaborative interaction, including preliminary diagnostician, veterinary expert, and swine specialist, is designed to generate structured and professionally rigorous candidate answers. Furthermore, an agent reflection mechanism is established to achieve closed-loop self-correction of answer quality. Specifically, three quantitative evaluation indicators, including knowledge coverage, intent understanding deviation, and role collaboration efficiency, are adopted to comprehensively assess answer quality, while two optimization strategies, namely semantic rewriting and task decomposition, are deployed to refine the generated answers. Experimental results on the self-constructed swine disease question answering dataset demonstrate that the proposed method outperforms baseline models in terms of bilingual evaluation understudy (4-gram) (BLEU-4), recall-oriented understudy for evaluation-longest common subsequence (ROUGE-L), and BERT-based score recall (
R), achieving scores of 51.93, 30.50, and
0.7409, respectively. Compared to the baseline model, i.e., DeepSeek-R1, the BLEU-4 score increases significantly by 8.43%, the ROUGE-L score increases by 1.19%, and the
R increases by 3.59%. This demonstrates that the proposed model outperforms the currently popular general large language model in terms of question answering performance in the field of swine diseases. In addition, the results on the multiple-choice QA task reveal that the method yields substantial accuracy improvements for easy, medium, and hard questions, with accuracy values reaching 90%, 80%, and 70%, respectively. This further demonstrates that our method is capable of efficiently addressing issues related to swine disease. Ablation experiment results verify that the knowledge routing strategy, multi-agent collaborative strategy, and agent reflection mechanism all contribute to higher question answering accuracy. Specifically, the average accuracy of our model in multiple-choice question answering decreased from 80% to 67% after the knowledge routing module was removed. In summary, the proposed framework resolves the ambiguity and hallucination problems in swine disease knowledge retrieval. This study provides a modular and reliable technical scheme for agricultural QA and professional LLM agent deployment, and exhibits promising cross-domain generalization potential for crop protection, aquaculture, and other modern agricultural fields.