Knowledge compression and knowledge graph-based retrieval-augmented generation for large language models in dairy cow precision feeding
Knowledge for dairy cow precision feeding is dispersed across nutritional standards, scientific literature and professional resources, complicating evidence-supported question answering with large language models (LLMs). We integrated a curated domain corpus with LightRAG, an existing retrieval-augmented generation (RAG) framework combining knowledge graphs and vector retrieval. Corpus preparation comprised PDF-to-Markdown conversion, two-stage rule-based cleaning and document-level knowledge compression. Compression prioritised feeding-relevant evidence, numerical values, units and applicability conditions while retaining source identifiers, reducing cleaned literature text by 95.53%. The final corpus contained 2,925 documents and 6,992,080 non-whitespace characters, yielding 5,610 text chunks, 52,509 entities and 64,863 relations. We evaluated DeepSeek v4, Qwen 3.7 Max and GLM 5.3 with and without LightRAG on 100 frozen questions, obtaining 600 responses independently scored by ChatGPT and Kimi-k3 using the same blinded rubric. ChatGPT mean question–answer matching scores increased from 55.8 to 78.7, 43.5 to 79.2 and 65.3 to 80.2, respectively; Kimi-k3 scores increased from 39.8 to 80.6, 31.6 to 80.3 and 44.7 to 82.8. LightRAG-enhanced responses scored higher in 299 of 300 ChatGPT comparisons and 298 of 300 Kimi-k3 comparisons. These findings support curated knowledge and hybrid retrieval to improve question–answer matching for dairy cow precision feeding under the specified evaluation protocol.
Authors
- Chendong Yang (ORCID: https://orcid.org/0009-0008-4307-5260)
- Leifeng Guo
- Paul Kwan (ORCID: https://orcid.org/0000-0002-4959-5274)
- Yongsheng Si (ORCID: https://orcid.org/0000-0002-2452-3864)
- Bowen Li (ORCID: https://orcid.org/0000-0003-2617-2196)
- Yabin Ma
- Hongtian Li
Institutions
- Hebei Agricultural University (CN)
- Chinese Academy of Agricultural Sciences (CN)
- Central Queensland University (AU)
Publication Details
- Journal
- Research Square
- Published
- 2026-11-26
- DOI
- https://doi.org/10.21203/rs.3.rs-11663290/v1
- Primary Topic
- Topic Modeling
- Type
- preprint