[Paper Review] Retrieval meets Long Context Large Language Models
The paper compares retrieval-augmented and long-context LLMs (4K, 16K, 32K) on long-context tasks, showing retrieval boosts both short and long contexts and that 4K with retrieval can match 16K/32K performance with less computation. It also demonstrates a strong retrieval-augmented Llama2-70B-32k model that outperforms OpenAI APIs on several tasks.
Extending the context window of large language models (LLMs) is getting popular recently, while the solution of augmenting LLMs with retrieval has existed for years. The natural questions are: i) Retrieval-augmentation versus long context window, which one is better for downstream tasks? ii) Can both methods be combined to get the best of both worlds? In this work, we answer these questions by studying both solutions using two state-of-the-art pretrained LLMs, i.e., a proprietary 43B GPT and Llama2-70B. Perhaps surprisingly, we find that LLM with 4K context window using simple retrieval-augmentation at generation can achieve comparable performance to finetuned LLM with 16K context window via positional interpolation on long context tasks, while taking much less computation. More importantly, we demonstrate that retrieval can significantly improve the performance of LLMs regardless of their extended context window sizes. Our best model, retrieval-augmented Llama2-70B with 32K context window, outperforms GPT-3.5-turbo-16k and Davinci003 in terms of average score on nine long context tasks including question answering, query-based summarization, and in-context few-shot learning tasks. It also outperforms its non-retrieval Llama2-70B-32k baseline by a margin, while being much faster at generation. Our study provides general insights on the choice of retrieval-augmentation versus long context extension of LLM for practitioners.
Motivation & Objective
- Evaluate whether retrieval augmentation or long-context extension yields better performance on long-context tasks.
- Quantify how retrieval impacts models with different context windows (4K, 16K, 32K).
- Assess whether combining retrieval with long-context yields gains across QA, summarization, and in-context learning.
Proposed method
- Compare two 43B and 70B decoder-only LLMs (GPT-43B, Llama2-70B) with 4K, 16K, and 32K context windows.
- Extend context with positional interpolation for RoPE embeddings to 16K/32K.
- Use three retrievers (Dragon, Contriever, OpenAI embeddings) to fetch top-N chunks and feed them as evidence to the model.
- Instruction-tune models on a blend of instruction datasets to enable following prompts.
- Evaluate zero-shot and few-shot tasks across seven long-context datasets including QM, QASP, NQA, QLTY, MSQ, HQA, MFQA.
Experimental results
Research questions
- RQ1Does retrieval augmentation improve long-context LLM performance relative to purely extending the context window?
- RQ2Can retrieval-augmented 4K-context models match or exceed 16K/32K-context models in accuracy and efficiency?
- RQ3What is the impact of context window size and retrieved chunk count on downstream tasks across different model sizes?
- RQ4How do different retrievers compare when used with large-context LLMs?
- RQ5Can retrieval-augmented large-context models surpass existing OpenAI models on long-context benchmarks?
Key findings
- Retrieval significantly improves both 4K and 16K/32K context LLMs across the evaluated tasks.
- A 4K-context LLM with retrieval can achieve comparable average performance to a 16K long-context LLM (GPT-43B: 29.32 vs 29.45; Llama2-70B: 36.02 vs 36.78) with much less computation.
- Retrieval-augmented Llama2-70B-32k-ret (32K context) outperforms GPT-3.5-turbo-16k and Davinci-003 on average across nine long-context tasks (e.g., avg score 43.6 vs 42.8 and 40.9 baseline).
- Retrieval improves long-context models further, with Llama2-70B-32k-ret achieving higher averages than its non-retrieval baseline (39.60 vs 37.36 on Table 3) and being faster at generation in some cases.
- The benefit of retrieval is observed across multiple retrievers (Dragon, Contriever, OpenAI embeddings) and persists for both short and long context settings.
- Increasing the number of retrieved chunks beyond top-5 (to top-10/top-20) does not consistently improve performance and can hurt due to the lost-in-the-middle effect.
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.