Skip to main content
QUICK REVIEW

[논문 리뷰] LongRAG: Enhancing Retrieval-Augmented Generation with Long-context LLMs

Ziyan Jiang, Xueguang Ma|arXiv (Cornell University)|2024. 06. 21.
Advanced Data Storage TechnologiesComputer Science인용 수 12
한 줄 요약

LongRAG는 긴 컨텍스트 검색 및 읽기를 RAG에 도입하여 4K-token 단위를 사용해 재도출(recall) 및 엔드-투-엔드 QA 성능을 학습 없이 향상시킵니다.

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.

연구 동기 및 목표

  • 전통적인 RAG에서 검색기와 리더 간의 불균형을 더 긴 검색 단위를 사용하여 완화하고자 한다.
  • 긴 컨텍스트 LLM을 활용하기 위해 긴 검색기와 긴 리더를 갖춘 LongRAG 프레임워크를 제안한다.
  • 오픈 도메인 QA에서 정답 품질을 유지하면서 말뭉치 크기를 줄이고 검색 재호출률(recall)을 개선한다.

제안 방법

  • 관련된 Wikipedia 문서를 4K-token 단위로 묶어 긴 검색 단위를 형성한다.
  • 긴 검색기를 사용하여 상위 4–8개의 긴 단위를 유사도 sim(q,g) ≈ max_{g'⊆g} E_Q(q)^T E_C(g')로 가져온다.
  • 상위 k개 단위를 리더의 긴 컨텍스트 검색 결과로 집계한다.
  • 작업별 학습 없이도 연결된 검색 결과에서 답을 추출하도록 긴 컨텍스트 LLM(예: Gemini-1.5-Pro 또는 GPT-4o)을 프롬프트한다.
  • 긴 컨텍스트 리더 접근법을 두 단계로 채택한다: 긴 답을 생성한 다음 그것에서 간결한 최종 답을 추출한다.
  • 긴 컨텍스트 임베딩 스코어링을 검색 단위 내 청크들의 최대값으로 근사하여 전체 긴 단위를 인코딩하지 않도록 한다.

실험 결과

연구 질문

  • RQ1검색 단위 길이를 늘리면 의미적 무결성을 보존하고 검색 단위 수를 줄여 오픈 도메인 QA를 개선할 수 있는가?
  • RQ2파인 튜닝 없이 연결된 긴 컨텍스트에서 제로샷 추출을 수행하는 긴 컨텍스트 리더(Gemini-1.5-Pro 또는 GPT-4o 같은 LLM)는 어떤 성능을 보이는가?
  • RQ3검색의 세분화가 엔드-투-엔드 QA 성능과 검색 단위 수에 어떤 영향을 주는가?
  • RQ4긴 단위로 말뭉치 크기를 줄이는 것이 엔드-태스크 성능과 재호출 간의 트레이드를 발생시키는가, 그리고 이것이 전통적인 짧은 단위 RAG와 어떻게 비교되는가?

주요 결과

  • 긴 검색 단위를 사용하면 재호출(recall) 및 엔드-투-엔드 QA 성능이 향상되며; NQ의 recall@1은 짧은 단위에서 52%에서 그룹화된 문서로 71.69%로 상승한다.
  • 긴 단위를 사용할 때 HotpotQA의 recall 결과도 유사하게 향상되며 단위 세분성에 따라 72.49–86.30 AR 범위를 달성한다.
  • LongRAG는 훈련 없이 NQ에서 EM 62.7, HotpotQA(전체 위키)에서 EM 64.3을 달성하며 강력한 완전 학습 베이스라인과 동등한 수준이다.
  • 강력한 결과를 얻기에는 4–8개의 긴 검색 단위면 충분하며 말뭉치 크기를 최대 30배까지 줄일 수 있다(22M에서 600K 단위로).
  • 긴 컨텍스트 임베딩의 근사치(청크의 최대값)가 전체 긴 단위를 직접 인코딩하는 것보다 우수하다.
  • 긴 리더로서 GPT-4o가 NQ에서 가장 높은 EM을 보였고(62.7), 다른 리더들도 성능이 근소하게 비슷했다.

이 논문 읽기

누빈트 뷰어에서 원문을 열고, 읽으면서 궁금한 곳을 바로 물어보세요.

누빈트에서 이 논문 읽기

이 리뷰는 AI가 논문 원문을 바탕으로 만들었습니다. 인용하기 전에 원문을 확인해 주세요.