Suppressing Domain-Specific Hallucination in Construction LLMs: A Knowledge Graph Foundation for GraphRAG and QLoRA on River and Sediment Control Technical Standards
Abstract
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 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.
Figures & tables
| Relation | From To | Role |
|---|---|---|
| HAS_CHAPTER | Std Ch | Doc. structure |
| HAS_SECTION | Ch Sec | Doc. structure |
| HAS_ITEM | Sec Item | Doc. structure |
| DESCRIBED_IN | Fac Ch/Sec | Rule location |
| SUBJECT_TO | Fac Haz | Applicable hazard |
| MITIGATES | Fac Haz | Countermeasure |
| Relation Type | Count | Share (%) |
|---|---|---|
| HAS_CHAPTER | 212 | 29.7 |
| DESCRIBED_IN | 89 | 12.4 |
| HAS_SECTION | 86 | 12.0 |
| HAS_ITEM | 63 | 8.8 |
| REQUIRES | 56 | 7.8 |
| SUBJECT_TO | 55 | 7.7 |
| Parameter | Value |
|---|---|
| lora_r | 16 |
| lora_alpha | 16 |
| lora_dropout | 0.0 |
| Target modules | q/k/v/o/gate/up/down proj |
| load_in_4bit | True (NF4) |
| max_seq_length | 2,048 |
| Subset | QA Pairs | Final Loss | Time |
|---|---|---|---|
| 100 | 100 | 0.7958 | 4.4 min |
| 250 | 250 | 0.6859 | 10.2 min |
| 500 | 500 | 0.6045 | 20.0 min |
| 715 | 715 | 0.5565 | 28.5 min |
| Case | Model | Avg | Avg | Sc-3 (%) | Sc-2 (%) | Low-qual. (%) | Lat. (s) | Speedup |
|---|---|---|---|---|---|---|---|---|
| A (Plain LLM) | Swallow-20B | 2.29 | — | 60 | 12 | 28 | 42.2 | |
| C (GraphRAG) | Swallow-20B | 2.62 | 77 | 10 | 13 | 31.1 | ||
| B (QLoRA FT) | Swallow-8B | 2.92 | 92 | 8 | 0 | 14.2 |
| Category | A avg | B avg | C avg | |
|---|---|---|---|---|
| Survey | 7 | 2.14 | 2.86 | 2.57 |
| Planning | 8 | 2.75 | 2.88 | 2.62 |
| Design | 15 | 2.13 | 2.93 | 2.60 |
| Maint. (River) | 20 | 2.05 | 2.95 | 2.55 |
| Maint. (Dam) | 15 | 2.47 | 2.93 | 2.73 |
| Maint. (Sabo) | 15 | 2.33 | 2.93 | 2.53 |
| Metric (s) | Case A | Case B | Case C |
|---|---|---|---|
| Mean | 42.2 | 14.2 | 31.1 |
| Median | 43.5 | — | 33.4 |
| Min | 22.0 | — | 7.9 |
| Max | 43.9 | — | 35.5 |
| Total (100 Q, min) | 70.3 | 23.7 | 51.9 |
| Q# | Sub-category | A | B | C |
|---|---|---|---|---|
| Q5 | Levee life-extension | 0 | 3 | 3 |
| Q14 | Cycle-type maint. flow | 3 | 3 | 3 |
| Q24 | Dam life-extension | 0 | 3 | 3 |
| Q26 | Dam sedimentation ratio | 3 | 2 | 2 |
| Q37 | Sabo dam emergency insp. | 1 | 3 | 0 |
| Q52 | Basin avg. rainfall | 3 | 2 | 1 |
Question Answering
Question answering studies how AI systems interpret questions and produce accurate, evidence-grounded answers across text, dialogue, and multimodal data.
See all 260 papers