当RAG遇见查询规划:用于解决探索性推理问题的逻辑查询树
When RAG Meets Query Planning: Logical Query Trees for Resolving Exploratory Reasoning Problems
AI总结:
针对检索增强生成在探索性推理问题中的检索噪声和错误累积问题,提出PlanRAG框架,将自然语言建模为逻辑查询树,通过动态规划和代价模型优化查询树,实现高效并行处理,在WikiWeb-ERP数据集上优于现有方法。
摘要:
检索增强生成(RAG)有效地将大型语言模型(LLMs)锚定在外部知识中,但在处理涉及高度不确定性和模糊性的复杂查询——即探索性推理问题(ERPs)时存在困难。解决ERPs需要复杂的推理,路径不明确,容易导致检索噪声和错误累积。此外,缺乏端到端的规划机制使得为ERPs生成有效轨迹变得困难。受数据库查询规划的启发,我们引入了PlanRAG,一个将自然语言的ERPs建模为逻辑查询树(LQTs)的RAG框架。然而,由于结构化SQL与非结构化自然语言之间的表示和优化差距,将ERPs转化为LQTs并非易事,构建高质量的LQTs极具挑战性。为解决这些问题,我们首先将ERPs分解为原子查询,然后使用由多个互补维度组成的代价模型指导的动态规划将其组织成LQTs。最后,我们在LQTs上执行迭代聚合、重写、检索和生成,并发处理节点并向上传播中间结果,并通过多线程进一步并行化以提高效率。我们的实验结果表明,在我们新构建的数据集WikiWeb-ERP上,PlanRAG优于最先进的基于迭代和基于图的RAG系统,从而为优化自然语言查询提供了一种新的形式。我们的源代码和数据集可在该https URL获取。
英文摘要:
Retrieval-Augmented Generation (RAG) effectively grounds large language models (LLMs) in external knowledge but struggles with \textbf{exploratory reasoning problems (ERPs)} that are the complex queries involving high uncertainty and ambiguity. Resolving ERPs requires complex reasoning with unclear paths, tending to result in retrieval noise and error accumulation. Furthermore, the absence of an end-to-end planning mechanism makes it difficult to generate effective trajectories for ERPs. Motivated by database query planning, we introduce \emph{PlanRAG}, an RAG framework that models ERPs of natural language as \textbf{logical query trees (LQTs)}. However, translating ERPs into LQTs is non-trivial due to representation and optimization gaps between structured SQL and unstructured natural language, making it highly challenging to construct high-quality LQTs. To address these problems, we first decompose ERPs into atomic queries and then organize them into LQTs using dynamic programming guided by a cost model involving multiple complementary dimensions. Finally, we execute iterative aggregation, rewriting, retrieval, and generation over LQTs, processing nodes concurrently and propagating intermediate results upward, with further parallelization across multiple threads for efficiency. Our experimental results show that PlanRAG outperforms state-of-the-art iteration-based and graph-based RAG systems on our newly constructed dataset, \textbf{WikiWeb-ERP}, thereby providing a new formulation for optimizing natural language queries. Our source code and dataset are available at https://anonymous.4open.science/r/PlanRAG-main-B2C8/.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。