Inference Scaling for Long-Context Retrieval Augmented Generation
Meta info.
- Authors: Zhenrui Yue, Honglei Zhuang, Aijun Bai, Kai Hui, Rolf Jagerman, Hansi Zeng, Zhen Qin, Dong Wang, Xuanhui Wang, Michael Bendersky
- Paper: https://arxiv.org/pdf/2410.04343
- Affiliation: Google DeepMind
- Published: October 6, 2024
TL; DR
LM์ RAG inference ์ฑ๋ฅ ํฅ์์ ์ํ scaling ์ ๋ต์ ์ ์ํ๊ณ , ์ ํจ ์ปจํ
์คํธ ๊ธธ์ด์ ๊ท๋ชจ์ RAG ์ฑ๋ฅ ๊ฐ์ ์ ํ์ ์ธ ๊ด๊ณ๊ฐ ์์์ ํ์ธ






Background
๋ชจ๋ธ์ด ๋ฐ์๋ค์ผ ์ ์๋ ๊ธธ์ด๊ฐ ๊ธธ๋ค๊ณ ์ข์ ์ฑ๋ฅ์ ๋ณด์ฅํ์ง๋ ์๋๋ค.
- LC-LLM์ด๋๋ผ๋ ์ฌ์ ํ ๊ทธ ๊ธด context๋ฅผ ์ถฉ๋ถํ ํ์ฉํ์ง ๋ชปํ๊ณ ์์.
- retrieved context๊ฐ์๊ฐ ์ผ์ ์์ค ์ด์์ด๋ฉด ์ฑ๋ฅ ํฅ์๋์ง ๋ชปํ๊ณ ์ฌ์ง์ด๋ ์ ํ๋๋ ๋ฌธ์ ๋ณด๊ณ
Problem States
LC-LLM์ด RAG system์์ ์ปจํ ์คํธ ์ ๋ณด๋ฅผ ํจ๊ณผ์ ์ผ๋ก ํ๋ํ๊ณ (์ถ๊ฐํ๊ณ ) ํ์ฉํ๋ scaling ๋ฐฉ๋ฒ์ด ์๋๊ฐ?
- ๋จ์ํ input ๊ธธ์ด ํ์ฅํ๋ ๊ฒ ์ด์์ผ๋ก RAG ์ถ๋ก ์ ์ํด ํ์ํ ์ ๋ต ํ๊ตฌ์ ํ์์ฑ
- Research Question
- ์ต์ ๊ตฌ์ฑ์, inference computation์ scaling์ RAG ์ฑ๋ฅ์ ์ด๋ค ์ด์ ์ด ์๋๊ฐ?
- RAG ์ฑ๋ฅ๊ณผ inference parameters๊ฐ์ ๊ด๊ณ๋ฅผ ๋ชจ๋ธ๋งํ์ฌ, ์ฃผ์ด์ง ์์ฐ์ ๋ํ ์ต์ ์ ํ
์คํธ ์๊ฐ compute allocation์ ์์ธกํ ์ ์์๊น?
- inference parameters: ๊ฒ์ ๋ฌธ์ ๊ฐ์(k), context์ demonstration ์(m), ์์ฑ ๋ฐ๋ณตํ์(n) ๋ฑ
Suggestions
- Inference Scaling Strategies for RAG
- DRAG(Demonstration-Based RAG): RAG demonstration์ ์ถฉ๋ถํ ์ ๊ณตํ์ฌ ICL style๋ก ๋ฐฐ์ธ ์ ์๋๋ก ์ค๊ณ
- IterDRAG(Iterative Demonstration-Based RAG): ์ง๋ฌธ์ ํ์์ง๋ฌธ์ผ๋ก ๋ถํดโ๊ฒ์โ ์์ฑ์ ๋ฐ๋ณตํ๋ multi-hop query์ inference chain ์ค๊ณ
- Inference scaling laws: RAG Performance์ Inference Computation Scale ์ฌ์ด ์๊ด๊ด๊ณ ์ ๋ํ
- ์ ํจ context ๊ธธ์ด(effective input context length to the LLM)์ ์ค์์ฑ
- LLM์ด ์ต์ข ๋ต๋ณ์ ์ถ๋ ฅํ๊ธฐ ์ ๊น์ง ๋ชจ๋ ๋ฐ๋ณต ๊ณผ์ ์ ๊ฑธ์ณ ์ ๋ ฅ๋ ํ ํฐ์ ์ด ์
- ๊ธธ์ด ํ์ฅ์ ์ด์ ๊ณผ ๊ณ์ฐ ๋น์ฉ ์ฆ๊ฐ ์ฌ์ด trade-off: ์ฃผ์ด์ง ๊ณ์ฐ ์์ฐ ๋ด์์ ์ปจํ ์คํธ ์ ๋ณด๋ฅผ ์ผ๋ง๋ ํจ์จ์ ์ผ๋ก ํ์ฉํ ์ ์๋์ง ํฌ์ฐฉ
- vanilla RAG๋ 1ํ ํธ์ถ์ด ๊ธฐ๋ณธ: ์ ํจ context ๊ธธ์ด = prompt ๊ธธ์ด (์ต๋ LLM input length)
- ์ ์ ๋ฐฉ์ ๋ฑ iterativeํ๊ฒ ํธ์ถํ๋ ๊ฒฝ์ฐ: ์ ํจ context ๊ธธ์ด (๋ฌดํํ) ํ์ฅ ๊ฐ๋ฅ
- Computation allocation model: constraints ํ์์ RAG์ ๋ํ ์ต์ ์ inference parameters ์์ธก (5.1์ )
- inference parameters ์กฐํฉ์ ๋ฐ๋ผ RAG ์ฑ๋ฅ ๋ฐ scaling inference computation scale ํ์ธ โ ์ต์ ํ ๋น ๊ฐ๋ฅ
- ์ ํจ context ๊ธธ์ด(effective input context length to the LLM)์ ์ค์์ฑ
Effects
- Experimental setup:
- datasets: multi-hop, knowledge intensive QA ๋ฐ single-hop QA๋ฑ..
- Bamboogle, HotpotQA, MuSiQue, 2WikiMultiHopQA
- backbone: Gemini 1.5 Flash
- zs-QA, ms-QA, vanilla RAG, DRAG, IterDRAG ๋น๊ต
- ์ ํจ context length: 16k, 32k, 128k, 1M, 5M ๋ฑ
- datasets: multi-hop, knowledge intensive QA ๋ฐ single-hop QA๋ฑ..
- Results
- DRAG, IterDRAG ๋ ์ ์ ๋ฐฉ์์ด SOTA
- vanilla RAG ๋๋น DRAG, IterDRAG ์ ๋ต์ด QA ๋ฒค์น๋งํฌ์์ ์ต๋ 58.9% ์ฑ๋ฅ ํฅ์
- IterDRAG์ ๊ฒฝ์ฐ CoT๋๋น ์ผ๊ด์ ์ผ๋ก ์ฐ์ํ ์ฑ๋ฅ ํ์ธ ๊ฐ๋ฅ
- Computation allocation model์ unseen domain์ผ๋ก ์ผ๋ฐํํ ๋ 96.6%์ ์ต์ ์ฑ๋ฅ
- ๋จ์ ๋ฌธ์ ๊ธธ์ด ๋๋ฆฌ๋ ๊ฒ๋ณด๋ค ์ต์ ํ ๋น ์ ์ถ๋ก ์ฐ์ฐ์ด ์ฆ๊ฐํจ์ ๋ฐ๋ผ (= ์ ์ํ๋ computation allocation model๋ก ๊ณ์ฐํ ์ ํจ context ๊ธธ์ด๊ฐ ์ฆ๊ฐํจ์ ๋ฐ๋ผ) RAG ์ฑ๋ฅ์ด ๊ฑฐ์ ์ ํ์ ์ผ๋ก ํ์ฅ
- 1M ํ ํฐ์ ์ด๊ณผํ๋ฉด ์ฑ๋ฅ ์ด๋์ด ๊ฐ์ โ LC-LLM์ ํ๊ณ์ธ๋ฏ..
- ๊ฒ์์ด ์๋ชป๋๊ฑฐ๋ ์ถ๋ก ๊ณผ์ ์ด ๋ถ์์ ํ ๊ฒฝ์ฐ ์ค๋ฅ ๋ฐ์
- DRAG, IterDRAG ๋ ์ ์ ๋ฐฉ์์ด SOTA