[Paper Review] DRAGIN: Dynamic Retrieval Augmented Generation based on the Information Needs of Large Language Models
DRAGIN introduces Real-time Information Needs Detection (RIND) and Query Formulation based on Self-attention (QFS) to dynamically decide when and what to retrieve, achieving strong results on four knowledge-intensive benchmarks without extra training.
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
Motivation & Objective
- Motivate reducing LLM hallucinations by invoking retrieval more intelligently during generation.
- Develop a dynamic RAG framework that decides when to retrieve based on real-time information needs.
- Formulate retrieval queries using the LLM's self-attention to capture cross-context information needs.
- Enable integration with Transformer-based LLMs without additional training or prompt engineering.
- Empirically validate DRAGIN against existing dynamic RAG baselines on multiple knowledge-intensive tasks.
Proposed method
- Propose Real-time Information Needs Detection (RIND) that scores each generated token using uncertainty, token importance, and semantic contribution to trigger retrieval.
- Introduce Query Formulation based on Self-attention (QFS) that constructs queries from the top attended preceding tokens at the trigger position.
- Make retrieval decisions at the token level during generation, using a threshold on the RIND score to decide when to retrieve.
- Use a lightweight, post-truncation integration: truncate the generation at the trigger point, retrieve external knowledge, and resume generation with a specialized prompt template.
- Evaluate DRAGIN against baseline dynamic RAG methods on four knowledge-intensive datasets across multiple LLMs (LLaMA-2-13B/7B-chat and Vicuna-13B-v1.5).
- Note: BM25 is used as the retriever by default, with ablations including SGPT.
Experimental results
Research questions
- RQ1Can a real-time, need-based retrieval trigger improve RAG performance over static or fixed-interval approaches?
- RQ2Does a self-attention-based query formulation better capture the information needs across the entire context than last-sentence or last-token queries?
- RQ3How does DRAGIN compare to existing dynamic RAG methods in terms of accuracy (EM/F1/Accuracy) and efficiency across multiple datasets and LLMs?
Key findings
- DRAGIN consistently outperforms baselines on four knowledge-intensive datasets across several LLMs, indicating effectiveness of real-time need detection and self-attention-based queries.
- DRAGIN achieves state-of-the-art performance among tested dynamic RAG methods, especially on multihop QA tasks (2WikiMultihopQA, HotpotQA).
- Ablation studies show RIND and QFS outperform existing timing and query strategies across different retrievers and LLMs.
- DRAGIN uses BM25 as the retriever and demonstrates results across LLaMA-2-13B/7B-chat and Vicuna-13B-v1.5.
- Timing experiments indicate DRAGIN’s trigger mechanism yields better EM/F1/Accuracy than FLARE, FL-RAG, and FS-RAG on the IIRC dataset when using comparable queries.
- Query formulation using full context is not as effective as DRAGIN’s QFS approach, which selects top-attended tokens from the preceding context.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.