Skip to main content
QUICK REVIEW

[Paper Review] LongRAG: Enhancing Retrieval-Augmented Generation with Long-context LLMs

Ziyan Jiang, Xueguang Ma|arXiv (Cornell University)|Jun 21, 2024
Advanced Data Storage TechnologiesComputer Science12 citations
TL;DR

LongRAG introduces long-context retrieval and reading to RAG, using 4K-token units to improve recall and end-to-end QA performance without training.

ABSTRACT

In traditional RAG framework, the basic retrieval units are normally short. The common retrievers like DPR normally work with 100-word Wikipedia paragraphs. Such a design forces the retriever to search over a large corpus to find the `needle' unit. In contrast, the readers only need to generate answers from the short retrieved units. The imbalanced `heavy' retriever and `light' reader design can lead to sub-optimal performance. The loss of contextual information in the short, chunked units may increase the likelihood of introducing hard negatives during the retrieval stage. Additionally, the reader might not fully leverage the capabilities of recent advancements in LLMs. In order to alleviate the imbalance, we propose a new framework LongRAG, consisting of a `long retriever' and a `long reader'. In the two Wikipedia-based datasets, NQ and HotpotQA, LongRAG processes the entire Wikipedia corpus into 4K-token units by grouping related documents. By increasing the unit size, we significantly reduce the total number of units. This greatly reduces the burden on the retriever, resulting in strong retrieval performance with only a few (less than 8) top units. Without requiring any training, LongRAG achieves an EM of 62.7% on NQ and 64.3% on HotpotQA, which are on par with the (fully-trained) SoTA model. Furthermore, we test on two non-Wikipedia-based datasets, Qasper and MultiFieldQA-en. LongRAG processes each individual document as a single (long) unit rather than chunking them into smaller units. By doing so, we achieve an F1 score of 25.9% on Qasper and 57.5% on MultiFieldQA-en. Our study offers insights into the future roadmap for combining RAG with long-context LLMs.

Motivation & Objective

  • Motivate to alleviate the imbalance between retriever and reader in traditional RAG by using longer retrieval units.
  • Propose a LongRAG framework with a long retriever and a long reader to leverage long-context LLMs.
  • Reduce corpus size and improve retrieval recall while preserving answer quality on open-domain QA.

Proposed method

  • Form long retrieval units by grouping related Wikipedia documents into 4K-token units.
  • Use a long retriever to fetch top 4–8 long units with similarity sim(q,g) ≈ max_{g'⊆g} E_Q(q)^T E_C(g').
  • Aggregate top-k units into a long-context retrieval result for the reader.
  • Prompt a long-context LLM (e.g., Gemini-1.5-Pro or GPT-4o) to extract answers from the concatenated retrievals without task-specific training.
  • Adopt a two-step long reader approach: generate a long answer and then extract a concise final answer from it.
  • Approximate long-context embedding scoring with a max over chunks within a retrieval unit to avoid encoding the entire long unit.

Experimental results

Research questions

  • RQ1Can increasing retrieval unit length improve open-domain QA by preserving semantic integrity and reducing the number of units to search?
  • RQ2How does a long-context reader (LLMs like Gemini-1.5-Pro or GPT-4o) perform on zero-shot extraction from concatenated long contexts without fine-tuning?
  • RQ3What is the impact of retrieval granularity on end QA performance and the optimal number of retrieved units?
  • RQ4Does reducing corpus size via long units trade off recall for end-task performance, and how does it compare to traditional short-unit RAG?

Key findings

  • Recall and end-to-end QA performance improve with long retrieval units; NQ recall@1 rises from 52% (short units) to 71.69% with grouped documents.
  • HotpotQA recall results similarly improve with long units, achieving 72.49–86.30 AR ranges depending on unit granularity.
  • LongRAG achieves EM of 62.7 on NQ and 64.3 on HotpotQA (full-wiki) without any training, on par with strong fully trained baselines.
  • Using 4–8 long retrieval units suffices to reach strong results, reducing corpus size up to 30x (from 22M to 600K units).
  • An approximation for long-context embedding (max over chunks) outperforms encoding the entire long unit directly.
  • GPT-4o as the long reader yielded the highest EM among tested readers on NQ (62.7), with other readers close in performance.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.