On the Influence of Context Size and Model Choice in Retrieval-Augmented Generation Systems

Juraj Vladika, Florian Matthes
2/20/2025
cs.CLcs.AI

No official code found. Best implementation: jvladika/ContextRAG (7 stars, last commit 2025-02-23).

Abstract

Retrieval-augmented generation (RAG) has emerged as an approach to augment large language models (LLMs) by reducing their reliance on static knowledge and improving answer factuality. RAG retrieves relevant context snippets and generates an answer based on them. Despite its increasing industrial adoption, systematic exploration of RAG components is lacking, particularly regarding the ideal size of provided context, and the choice of base LLM and retrieval method. To help guide development of robust RAG systems, we evaluate various context sizes, BM25 and semantic search as retrievers, and eight base LLMs. Moving away from the usual RAG evaluation with short answers, we explore the more challenging long-form question answering in two domains, where a good answer has to utilize the entire context. Our findings indicate that final QA performance improves steadily with up to 15 snippets but stagnates or declines beyond that. Finally, we show that different general-purpose LLMs excel in the biomedical domain than the encyclopedic one, and that open-domain evidence retrieval in large corpora is challenging.

View on arXivView PDF

Code Implementations(1)

jvladika/ContextRAGCommunity100%

Code and data for the NAACL 2025 paper "On the Influence of Context Size and Model Choice for Retrieval-Augmented Generation"

71PythonFeb 10, 20251 years ago

Similar Papers

Cite this paper

@article{vladika2025influence,
  title  = {On the Influence of Context Size and Model Choice in Retrieval-Augmented Generation Systems},
  author = {Juraj Vladika and Florian Matthes},
  year   = {2025},
  eprint = {2502.14759},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2502.14759v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2502.14759.svg)](https://codeofpaper.com/paper/2502.14759)

Discussion