Welcome to Smart Agriculture 中文

Smart Agriculture ›› 2025, Vol. 7 ›› Issue (1): 20-32.doi: 10.12133/j.smartag.SA202410025

• Topic--Intelligent Agricultural Knowledge Services and Smart Unmanned Farms (Part 2) • Previous Articles     Next Articles

Agricultural Large Language Model Based on Precise Knowledge Retrieval and Knowledge Collaborative Generation

JIANG Jingchi1,2, YAN Lian1, LIU Jie1,2()   

  1. 1. School of Computer Science and Technology, Harbin Institute of Technology, Harbin 150001, China
    2. National Key Laboratory of Smart Farm Technologies and Systems, Harbin 150001, China
  • Received:2024-10-20 Online:2025-01-30
  • Foundation items:
    National Key Research and Development Program of China(ZDYF20220008); Heilongjiang Provincial Science and Technology Program Project(GJLX20240004)
  • About author:

    JIANG Jingchi, E-mail:

  • corresponding author:
    LIU Jie, E-mail:

Abstract:

[Objective] The rapid advancement of large language models (LLMs) has positioned them as a promising novel research paradigm in smart agriculture, leveraging their robust cognitive understanding and content generative capabilities. However, due to the lack of domain-specific agricultural knowledge, general LLMs often exhibit factual errors or incomplete information when addressing specialized queries, which is particularly prominent in agricultural applications. Therefore, enhancing the adaptability and response quality of LLMs in agricultural applications has become an important research direction. [Methods] To improve the adaptability and precision of LLMs in the agricultural applications, an innovative approach named the knowledge graph-guided agricultural LLM (KGLLM) was proposed. This method integrated information entropy for effective knowledge filtering and applied explicit constraints on content generation during the decoding phase by utilizing semantic information derived from an agricultural knowledge graph. The process began by identifying and linking key entities from input questions to the agricultural knowledge graph, which facilitated the formation of knowledge inference paths and the development of question-answering rationales. A critical aspect of this approach was ensuring the validity and reliability of the external knowledge incorporated into the model. This was achieved by evaluating the entropy difference in the model's outputs before and after the introduction of each piece of knowledge. Knowledge that didn't enhance the certainty of the answers was systematically filtered out. The knowledge paths that pass this entropy evaluation were used to adjust the token prediction probabilities, prioritizing outputs that were closely aligned with the structured knowledge. This allowed the knowledge graph to exert explicit guidance over the LLM's outputs, ensuring higher accuracy and relevance in agricultural applications. [Results and Discussions] The proposed knowledge graph-guided technique was implemented on five mainstream general-purpose LLMs, including open-source models such as Baichuan, ChatGLM, and Qwen. These models were compared with state-of-the-art knowledge graph-augmented generation methods to evaluate the effectiveness of the proposed approach. The results demonstrate that the proposed knowledge graph-guided approach significantly improved several key performance metrics of fluency, accuracy, factual correctness, and domain relevance. Compared to GPT-4o, the proposed method achieved notable improvements by an average of 2.592 3 in Mean BLEU, 2.815 1 in ROUGE, and 9.84% in BertScore. These improvements collectively signify that the proposed approach effectively leverages agricultural domain knowledge to refine the outputs of general-purpose LLMs, making them more suitable for agricultural applications. Ablation experiments further validated that the knowledge-guided agricultural LLM not only filtered out redundant knowledge but also effectively adjusts token prediction distributions during the decoding phase. This enhanced the adaptability of general-purpose LLMs in agriculture contexts and significantly improves the interpretability of their responses. The knowledge filtering and knowledge graph-guided model decoding method proposed in this study, which was based on information entropy, effectively identifies and selects knowledge that carried more informational content through the comparison of information entropy.Compared to existing technologies in the agricultural field, this method significantly reduced the likelihood of "hallucination" phenomena during the generation process. Furthermore, the guidance of the knowledge graph ensured that the model's generated responses were closely related to professional agricultural knowledge, thereby avoiding vague and inaccurate responses generated from general knowledge. For instance, in the application of pest and disease control, the model could accurately identify the types of crop diseases and corresponding control measures based on the guided knowledge path, thereby providing more reliable decision support. [Conclusions] This study provides a valuable reference for the construction of future agricultural large language models, indicating that the knowledge graphs guided mehtod has the potential to enhance the domain adaptability and answer quality of models. Future research can further explore the application of similar knowledge-guided strategies in other vertical fields to enhance the adaptability and practicality of LLMs across various professional domains.

Key words: knowledge graph, agricultural large language model, information entropy, semantic similarity, knowledge guidance

CLC Number: