L-RAG:基于熵的惰性加载平衡上下文与检索
L-RAG: Balancing Context and Retrieval with Entropy-Based Lazy Loading
AI总结:
L-RAG通过基于熵的惰性加载机制,在准确率与效率之间提供可调节的权衡,有效减少检索开销并提升RAG系统的部署效率。
摘要:
检索增强生成(RAG)已成为将大型语言模型输出与事实知识相结合的主要范式,有效减轻了幻觉问题。然而,传统RAG系统基于“始终检索”的假设,无论查询复杂度如何,都会对向量数据库进行查询。这种静态方法带来了显著的计算开销和推理延迟,特别是在高吞吐量的生产部署中尤为突出。我们引入L-RAG(惰性检索增强生成),一种适应性框架,通过基于熵的门控实现层次化上下文管理。L-RAG采用双层架构:查询首先通过紧凑的文档摘要进行处理,只有当模型的预测熵超过校准阈值时,才会触发昂贵的块检索,表明真正的不确定性。通过在SQuAD 2.0(N=500)上使用Phi-2模型进行的实验,我们证明L-RAG提供了可调节的准确率-效率权衡:在保守阈值(tau=0.5)下,L-RAG达到78.2%的准确率,与标准RAG(77.8%)相匹配,同时减少8%的检索量;在平衡阈值(tau=1.0)下,检索减少增加到26%,但准确率损失较小(76.0%)。延迟分析显示,当检索延迟超过500ms时,L-RAG每查询节省80-210ms。熵分布分析显示,正确预测(H=1.72)与错误预测(H=2.20)之间存在统计学显著分离(p < 0.001),验证了熵作为可靠不确定性信号的有效性。L-RAG提供了一种无需训练的实用方法,以更高效地部署RAG系统,为系统架构师提供了一个可配置的调节器,以平衡准确率和吞吐量需求。
英文摘要:
Retrieval-Augmented Generation (RAG) has emerged as the predominant paradigm for grounding Large Language Model outputs in factual knowledge, effectively mitigating hallucinations. However, conventional RAG systems operate under a "retrieve-always" assumption, querying vector databases for every input regardless of query complexity. This static approach incurs substantial computational overhead and inference latency, particularly problematic for high-throughput production deployments. We introduce L-RAG (Lazy Retrieval-Augmented Generation), an adaptive framework that implements hierarchical context management through entropy-based gating. L-RAG employs a two-tier architecture: queries are first processed with a compact document summary, and expensive chunk retrieval is triggered only when the model's predictive entropy exceeds a calibrated threshold, signaling genuine uncertainty. Through experiments on SQuAD 2.0 (N=500) using the Phi-2 model, we demonstrate that L-RAG provides a tunable accuracy-efficiency trade-off: at a conservative threshold (tau=0.5), L-RAG achieves 78.2% accuracy, matching Standard RAG (77.8%), with 8% retrieval reduction; at a balanced threshold (tau=1.0), retrieval reduction increases to 26% with modest accuracy trade-off (76.0%). Latency analysis shows that L-RAG saves 80-210ms per query when retrieval latency exceeds 500ms. Analysis of entropy distributions reveals statistically significant separation (p < 0.001) between correct predictions (H=1.72) and errors (H=2.20), validating entropy as a reliable uncertainty signal. L-RAG offers a practical, training-free approach toward more efficient RAG deployment, providing system architects with a configurable knob to balance accuracy and throughput requirements.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。