用因果关系提升检索精度,让大模型更准找到关键信息
From Association to Causation: Improving Retrieval Precision of Retrieval-Augmented Generation via Causal Relations and an Attention Mechanism
- 构建检索过程的因果图,区分相关与因果关联
- 在企业知识库中将目标文档排名从第6提至第3
- 无需训练即可部署,适合存在关键词堆砌的私有知识库
检索增强生成(RAG)依赖检索到的文档支撑大模型生成,但标准的密集向量相似度检索常因关键词匹配返回无关文档,尤其在大规模知识库中问题更严重。本文指出根本原因在于:相似度仅捕捉关联关系,而真正相关的文档应与查询存在因果联系。为此,基于Reichenbach共同原因原理构建因果图,将查询与文档共享关键词视为潜在共同原因A,文档残余关键词构成连接理想输出的潜变量B。由于检索行为使文档成为碰撞点(A → d ← B),由此衍生出一种无需训练的注意力式重评分规则:计算查询嵌入与B加权中心嵌入的余弦相似度。该方法不建模知识内容中的因果,而是建模检索过程本身的因果结构。在471文档的企业知识库中,成功将关键指南从第6名提升至前3;在模拟关键词堆砌的诊断语料上,平均目标文档排名从2.88提升至1.25,而训练过的交叉编码器仅降至2.63。在三个BEIR基准上表现逊于基础相似度,说明其适用边界明确——专精于应对不断增长的私有知识库中的关键词堆砌问题,且可通过语料级校准门控以≥95%准确率识别适用场景。全本地测试验证了可部署性。
原文摘要 · Abstract (English)
Retrieval-Augmented Generation (RAG) grounds LLM generation on retrieved documents, but the standard terminal retrieval stage--dense-vector similarity, optionally followed by reranking--often returns documents that share keywords with the query without containing the needed information, a failure mode that grows with the knowledge base. We trace it to a conceptual gap: similarity captures only associational relations, whereas the documents that matter are linked to the query causally. We model the terminal retrieval stage with a causal graph grounded in Reichenbach's common cause principle: the keywords shared by the query and a retrieved document form a latent common cause A, and the document's residual keywords form a latent set B linking the document to the ideal output. Since a retrieved document is a collider (A -> d <- B), retrieval itself opens an associational path between the query and B, which licenses a training-free, attention-style re-scoring rule: the cosine similarity between the query embedding and the weighted centroid embedding of B. Unlike causality-enhanced RAG variants that model causal relations inside the knowledge content, our graph models the causal structure of the retrieval process itself. On a real 471-document enterprise knowledge base, the method promotes a relevant guideline from rank 6 to the top 3; on a controlled diagnostic corpus reproducing the keyword-stuffing regime, it improves the mean target rank from 2.88 to 1.25, while a trained cross-encoder reranker barely helps (2.63). Conversely, on three BEIR benchmarks the score underperforms the similarity baseline, delineating the applicability boundary: the method guards the keyword-stuffing regime of growing proprietary knowledge bases and complements neural rerankers; a corpus-level calibration gate selects the correct regime with >= 95% reliability. A fully local testbed demonstrates deployability.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。