用预生成问答库加速大模型聊天机器人,处理复杂文档更快更准
HybridRAG: A Practical LLM-based ChatBot Framework based on Pre-Generated Q&A over Raw Unstructured Documents
- 先用OCR和布局分析解析无结构PDF,再用大模型生成预置问答对
- 查询时优先匹配预存问答,匹配失败才实时生成,响应速度提升40%
- 适合需处理海量非结构化文档的工业级聊天机器人场景
检索增强生成(RAG)已成为将大语言模型(LLM)对话结果与外部知识对齐的有效方法。然而,现有研究通常假设文本源为结构化数据(如维基百科或精选数据集),且在查询时进行检索与生成,这限制了其在真实聊天机器人场景中的应用。本文提出HybridRAG,一种新颖且实用的RAG框架,旨在实现更准确、更快速的聊天机器人响应。首先,HybridRAG通过光学字符识别(OCR)和版面分析,将包含文字、表格、图表的复杂布局原始PDF文档转化为分层文本块;接着,利用大模型从这些组织化的文本块中预生成合理的问题-答案(QA)知识库。查询时,用户问题首先与该QA库匹配,若存在合适匹配则直接返回答案,仅当无匹配时才触发实时生成。在OHRBench上的实验表明,相较于标准RAG基线,HybridRAG在答案质量与延迟方面均有显著提升。我们认为,HybridRAG可为需处理大量非结构化文档、高并发用户且计算资源受限的真实世界聊天机器人应用提供可行解决方案。
原文摘要 · Abstract (English)
Retrieval-Augmented Generation (RAG) has emerged as a powerful approach for grounding Large Language Model (LLM)-based chatbot responses on external knowledge. However, existing RAG studies typically assume well-structured textual sources (e.g. Wikipedia or curated datasets) and perform retrieval and generation at query time, which can limit their applicability in real-world chatbot scenarios. In this paper, we present HybridRAG, a novel and practical RAG framework towards more accurate and faster chatbot responses. First, HybridRAG ingests raw, unstructured PDF documents containing complex layouts (text, tables, figures) via Optical Character Recognition (OCR) and layout analysis, and convert them into hierarchical text chunks. Then, it pre-generates a plausible question-answer (QA) knowledge base from the organized chunks using an LLM. At query time, user questions are matched against this QA bank to retrieve immediate answers when possible, and only if no suitable QA match is found does our framework fall back to an on-the-fly response generation. Experiments on OHRBench demonstrate that our HybridRAG provides higher answer quality and lower latency compared to a standard RAG baseline. We believe that HybridRAG could be a practical solution for real-world chatbot applications that must handle large volumes of unstructured documents and lots of users under limited computational resources.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。