KohakuRAG通过分层文档索引提升问答精度,适合需要精确引用的技术场景。
KohakuRAG: A simple RAG framework with hierarchical document indexing
- 构建四层树状文档结构,自底向上聚合嵌入,保留原文组织逻辑。
- 采用大模型查询规划与交叉重排,覆盖更全相关段落,提升召回率。
- 多轮集成推理+弃权投票机制,答案稳定且引用准确,适合高精度要求。
检索增强生成(RAG)系统在从文档集合回答问题时,若需高精度引用,常面临多重挑战:扁平切块会破坏文档结构,单次查询易因词汇不匹配遗漏相关段落,单次推断产生随机性答案,内容与引用均不稳定。本文提出KohakuRAG,一种分层RAG框架,通过四级树形结构(文档→章节→段落→句子)结合自底向上嵌入聚合,保留文档层级;利用大语言模型驱动的查询规划器与跨查询重排提升检索覆盖率;通过带弃权意识的集成推理稳定输出。在要求对32份技术文档以±0.1%数值容差和精确来源标注回答的WattBot 2025挑战中,KohakuRAG在公开与私有榜单均排名第一(最终得分0.861),是唯一在两个评估分区保持首位的团队。消融实验表明,提示排序(相对提升80%)、重试机制(+69%)及带空值过滤的集成投票(+1.2pp)贡献显著,而分层密集检索本身已媲美混合稀疏-密集方法(BM25仅增3.1pp)。代码已开源:https://github.com/KohakuBlueleaf/KohakuRAG。
原文摘要 · Abstract (English)
Retrieval-augmented generation (RAG) systems that answer questions from document collections face compounding difficulties when high-precision citations are required: flat chunking strategies sacrifice document structure, single-query formulations miss relevant passages through vocabulary mismatch, and single-pass inference produces stochastic answers that vary in both content and citation selection. We present KohakuRAG, a hierarchical RAG framework that preserves document structure through a four-level tree representation (document $\rightarrow$ section $\rightarrow$ paragraph $\rightarrow$ sentence) with bottom-up embedding aggregation, improves retrieval coverage through an LLM-powered query planner with cross-query reranking, and stabilizes answers through ensemble inference with abstention-aware voting. We evaluate on the WattBot 2025 Challenge, a benchmark requiring systems to answer technical questions from 32 documents with $\pm$0.1% numeric tolerance and exact source attribution. KohakuRAG achieves first place on both public and private leaderboards (final score 0.861), as the only team to maintain the top position across both evaluation partitions. Ablation studies reveal that prompt ordering (+80% relative), retry mechanisms (+69%), and ensemble voting with blank filtering (+1.2pp) each contribute substantially, while hierarchical dense retrieval alone matches hybrid sparse-dense approaches (BM25 adds only +3.1pp). We release KohakuRAG as open-source software at https://github.com/KohakuBlueleaf/KohakuRAG.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。