To Memorize or to Retrieve: Scaling Laws for RAG-Considerate Pretraining

Karan Singh, Michael Yu, Varun Gangal, Zhuofu Tao, Sachin Kumar +2 more
4/1/2026
cs.CLcs.AIcs.LG

No official code found. Best implementation: DegenAI-Labs/RAG-scaling-laws (6 stars, last commit 2026-04-15).

Abstract

Retrieval-augmented generation (RAG) improves language model (LM) performance by providing relevant context at test time for knowledge-intensive situations. However, the relationship between parametric knowledge acquired during pretraining and non-parametric knowledge accessed via retrieval remains poorly understood, especially under fixed data budgets. In this work, we systematically study the trade-off between pretraining corpus size and retrieval store size across a wide range of model and data scales. We train OLMo-2-based LMs ranging from 30M to 3B parameters on up to 100B tokens of DCLM data, while varying both pretraining data scale (1-150x the number of parameters) and retrieval store size (1-20x), and evaluate performance across a diverse suite of benchmarks spanning reasoning, scientific QA, and open-domain QA. We find that retrieval consistently improves performance over parametric-only baselines across model scales and introduce a three-dimensional scaling framework that models performance as a function of model size, pretraining tokens, and retrieval corpus size. This scaling manifold enables us to estimate optimal allocations of a fixed data budget between pretraining and retrieval, revealing that the marginal utility of retrieval depends strongly on model scale, task type, and the degree of pretraining saturation. Our results provide a quantitative foundation for understanding when and how retrieval should complement pretraining, offering practical guidance for allocating data resources in the design of scalable language modeling systems.

View on arXivView PDF

Code Implementations(1)

Code and data for the paper "To Memorize or to Retrieve: Scaling Laws for RAG-Considerate Pretraining"

60Shell, PythonMar 31, 20266 months ago

Similar Papers

Cite this paper

@article{singh2026memorize,
  title  = {To Memorize or to Retrieve: Scaling Laws for RAG-Considerate Pretraining},
  author = {Karan Singh and Michael Yu and Varun Gangal and Zhuofu Tao and Sachin Kumar and Emmy Liu and Steven Y. Feng},
  year   = {2026},
  eprint = {2604.00715},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2604.00715v1}
}

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/2604.00715.svg)](https://codeofpaper.com/paper/2604.00715)

Discussion