小模型微调比大模型加知识图谱更高效精准解决日本水利规范问答
Suppressing Domain-Specific Hallucination in Construction LLMs: A Knowledge Graph Foundation for GraphRAG and QLoRA on River and Sediment Control Technical Standards
- 8B模型用715组图结构问答数据微调,实现高精度回答
- 微调模型平均得分2.92/3,比大模型基线高0.63分,速度快三倍
- 适合资源有限但需精准领域问答的工程部署场景
本文针对日本《河流与泥沙控制技术标准》这一多卷本技术规范文档中的专业问题,使用本地部署的开源大模型进行解答。采用三种方法:案例A(20B大模型基线)、案例B(8B模型在715组图衍生问答对上用QLoRA微调)、案例C(20B模型结合Neo4j知识图谱通过GraphRAG增强)。所有实验均基于日本适配的Swallow系列模型,在涵盖8个技术类别的100题测试集上由Qwen2.5-14B自动评分(0–3分)。关键发现:8B QLoRA微调模型(案例B)平均得分2.92/3,优于20B基线(2.29/3,+0.63)和20B GraphRAG(2.62/3,+0.30),且推理延迟仅14.2秒(基线42.2秒),提速三倍。图谱带来+0.33提升,但仍不及领域微调。完整工程流程包括构建含200节点、268关系的知识图谱,利用图谱关系生成训练数据,单张16GB显卡完成训练,采用unsloth、GGUF Q4_K_M量化与Ollama部署,以及图检索与重排序设计。
原文摘要 · Abstract (English)
This paper addresses the challenge of answering technical questions derived from Japan's River and Sediment Control Technical Standards -- a multi-volume regulatory document covering survey, planning, design, and maintenance of river levees, dams, and sabo structures -- using open-source large language models running entirely on local hardware. We implement and evaluate three complementary approaches: Case A (plain 20B LLM baseline), Case B (8B LLM with QLoRA domain fine-tuning on 715 graph-derived QA pairs), and Case C (20B LLM augmented with a Neo4j knowledge graph via GraphRAG). All three cases use the Swallow series of Japanese-adapted LLMs and are evaluated on a 100-question benchmark spanning 8 technical categories, judged automatically by an independent LLM (Qwen2.5-14B, score 0--3). The key finding is a performance inversion: the 8B QLoRA fine-tuned model (Case B) achieves a judge average of 2.92/3 -- surpassing both the 20B plain baseline (Case A: 2.29/3, $+$0.63) and the 20B GraphRAG approach (Case C: 2.62/3, $+$0.30) -- while running at 3$\times$ faster latency (14.2s vs. 42.2s for Case A). GraphRAG provides moderate gains ($+$0.33 over baseline) but is outperformed by domain-specific fine-tuning in both quality and efficiency. We document the full engineering pipeline, including knowledge graph construction (200 nodes, 268 relations), QLoRA training data generation from Neo4j relations, training on a single GPU (16 GB VRAM) using unsloth, GGUF Q4_K_M quantisation and Ollama deployment, and the graph retrieval and re-ranking design. High-level engineering lessons are distilled in the main body; implementation pitfalls and toolchain details are documented in Supplementary Materials.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。