Dynamic retrieval augmented generation (RAG) paradigm actively decides when and what to retrieve during the text generation process of Large Language Models (LLMs). There are two key elements of this paradigm: identifying the optimal moment to activate the retrieval module (deciding when to retrieve) and crafting the appropriate query once retrieval is triggered (determining what to retrieve). However, current dynamic RAG methods fall short in both aspects. Firstly, the strategies for deciding when to retrieve often rely on static rules. Moreover, the strategies for deciding what to retrieve typically limit themselves to the LLM's most recent sentence or the last few tokens, while the LLM's real-time information needs may span across the entire context. To overcome these limitations, we introduce a new framework, DRAGIN, i.e., Dynamic Retrieval Augmented Generation based on the real-time Information Needs of LLMs. Our framework is specifically designed to make decisions on when and what to retrieve based on the LLM's real-time information needs during the text generation process. We evaluate DRAGIN along with existing methods comprehensively over 4 knowledge-intensive generation datasets. Experimental results show that DRAGIN achieves superior performance on all tasks, demonstrating the effectiveness of our method. We have open-sourced all the code, data, and models in GitHub: https://github.com/oneal2000/DRAGIN/tree/main
翻译:动态检索增强生成范式在大语言模型文本生成过程中主动决定何时检索以及检索什么内容。该范式的两个核心要素是:识别激活检索模块的最佳时机(决定何时检索)以及在触发检索后构建合适的查询(确定检索内容)。然而,当前的动态检索增强方法在这两方面均存在不足。首先,决定何时检索的策略通常依赖静态规则。此外,决定检索内容的策略往往局限于大语言模型的最新句子或最后几个词元,而大语言模型的实时信息需求可能跨越整个上下文。为克服这些局限,我们提出了新框架DRAGIN,即基于大语言模型实时信息需求的动态检索增强生成。该框架专门设计用于在文本生成过程中基于大语言模型的实时信息需求来决定何时检索以及检索什么内容。我们综合评估了DRAGIN与现有方法在4个知识密集型生成数据集上的表现。实验结果表明,DRAGIN在所有任务上均实现了优越性能,验证了本方法的有效性。我们已在GitHub上开源了所有代码、数据和模型:https://github.com/oneal2000/DRAGIN/tree/main