[논문 리뷰] The Chronicles of RAG: The Retriever, the Chunk and the Generator
이 논문은 브라질 포르투갈어에 대한 Retrieval Augmented Generation(RAG) 파이프라인의 설계, 최적화 및 평가를 연구하며, 여러 리트리버(희소, 밀도, 하이브리드)와 재랭커를 비교하고, Harry Potter 데이터셋에서 높은 상대적 성능을 달성하는 모범 사례의 엔드투엔드 구성을 보고합니다.
Retrieval Augmented Generation (RAG) has become one of the most popular paradigms for enabling LLMs to access external data, and also as a mechanism for grounding to mitigate against hallucinations. When implementing RAG you can face several challenges like effective integration of retrieval models, efficient representation learning, data diversity, computational efficiency optimization, evaluation, and quality of text generation. Given all these challenges, every day a new technique to improve RAG appears, making it unfeasible to experiment with all combinations for your problem. In this context, this paper presents good practices to implement, optimize, and evaluate RAG for the Brazilian Portuguese language, focusing on the establishment of a simple pipeline for inference and experiments. We explored a diverse set of methods to answer questions about the first Harry Potter book. To generate the answers we used the OpenAI's gpt-4, gpt-4-1106-preview, gpt-3.5-turbo-1106, and Google's Gemini Pro. Focusing on the quality of the retriever, our approach achieved an improvement of MRR@10 by 35.4% compared to the baseline. When optimizing the input size in the application, we observed that it is possible to further enhance it by 2.4%. Finally, we present the complete architecture of the RAG with our recommendations. As result, we moved from a baseline of 57.88% to a maximum relative score of 98.61%.
연구 동기 및 목표
- 브라질 포르투갈어용 데이터셋을 준비하고 RAG 단계를 정량화하는 방법론 제안.
- 완전한 RAG 시스템에 미치는 격차를 정량화하기 위한 상대 최대 점수(metric) 도입.
- 다양한 리트리버 및 파이프라인 아키텍처를 평가하여 포르투갈어의 RAG에 대한 최선의 관행을 확립.
제안 방법
- 브라질 포르투갈어 해리 포터에서 1000-토큰 청크를 사용하여 140-문항 QA 데이터셋 생성.
- RAG 구성의 잠재적 성능을 측정하기 위한 상대 최대 점수 정의.
- 기본 시나리오(맥락 없음), 긴 맥락 프롬프트, 그리고 다중 리트리버(BM25, ADA-002 dense, 커스텀 ADA-002), 하이브리드 및 다단계 재랭킹을 포함한 naive RAG를 평가.
- 리트리버를 비교하기 위한 회수 기반 지표(R@k)와 MRR@k 사용.
- BM25를 1단계로, mt5 기반 재랭커를 2단계로 하는 retrieve-and-rerank 다단계 아키텍처 구현.
- 맥락 영향 연구를 위한 입력 크기(검색된 청크 수) 및 프롬프트 내 정답 위치의 실험.
실험 결과
연구 질문
- RQ1다양한 리트리버(희소, 밀도, 하이브리드)가 브라질 포르투갈어의 RAG 성능에 어떤 영향을 미치는가?
- RQ2청크 전략과 정답 위치가 RAG 품질에 어떤 영향을 미치는가?
- RQ3이 설정에서 retrieve-and-rerank 다단계 파이프라인이 기본 및 naive RAG 구성보다 더 나은 성능을 보일 수 있는가?
- RQ4입력 크기와 RAG 성능의 관계는 무엇이며 최적의 검색 청크 수는 얼마인가?
주요 결과
- Dense and hybrid retrievers significantly improve RAG performance over a naive baseline, with MRR@10 improvements up to about 35.4 percentage points over baseline.
- Input size optimization can yield an additional ~2.4% performance gain.
- A multi-stage BM25-first with a neural reranker (mt5-based) achieving 3 retrieved chunks achieved the best results, approaching state-of-the-art in this setup.
- Final best configurations achieved a relative maximum score of 98.61%, a substantial improvement over the baseline (40.73 points in the degradation score).
- The study demonstrates a strong link between retriever quality and overall RAG performance, and emphasizes careful input construction and evaluation frameworks.
이 논문 읽기
누빈트 뷰어에서 원문을 열고, 읽으면서 궁금한 곳을 바로 물어보세요.
누빈트에서 이 논문 읽기이 리뷰는 AI가 논문 원문을 바탕으로 만들었습니다. 인용하기 전에 원문을 확인해 주세요.