← Latest papers
🤖 AI

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

This paper investigates the trade-off between pretraining data and retrieval corpus size across various model scales, proposing a three-dimensional scaling framework to determine optimal data budget allocations for maximizing language model performance in knowledge-intensive tasks.

Original authors: Karan Singh, Michael Yu, Varun Gangal, Zhuofu Tao, Sachin Kumar, Emmy Liu, Steven Y. Feng

Published 2026-04-02
📖 6 min read🧠 Deep dive

Original authors: Karan Singh, Michael Yu, Varun Gangal, Zhuofu Tao, Sachin Kumar, Emmy Liu, Steven Y. Feng

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

The Big Question: Should You Memorize the Library or Just Carry a Map?

Imagine you are training a student (an AI) to be the smartest person in the world. You have a fixed budget of time and resources. You face a classic dilemma:

  1. Option A (Memorization): Make the student read and memorize every single book in the library. They will know everything inside their head, but it takes a huge amount of time to study, and if they forget a fact, they can't get it back.
  2. Option B (Retrieval): Let the student read fewer books but give them a super-fast, magical index card system (a search engine) they can consult whenever they need an answer. They don't need to memorize everything, but they have to stop and look things up.

The Problem: For a long time, AI researchers treated these as separate choices. They either made the student memorize everything or added a search tool later. They didn't ask: "Given a fixed amount of study time, what is the perfect mix of memorizing vs. carrying a map?"

This paper answers that question.


The Experiment: The "DCLM" Library

The researchers built a series of students (AI models) ranging from a tiny toddler (30 million "brain cells") to a genius adult (3 billion "brain cells").

They gave them access to a massive library of text (100 billion words). They then played a game of "Resource Allocation":

  • They took a chunk of the library to teach the student (Pretraining).
  • They took the rest of the library and put it into a searchable database (Retrieval).

They tested thousands of different combinations:

  • Scenario 1: The student memorizes 90% of the library and searches 10%.
  • Scenario 2: The student memorizes 10% and searches 90%.
  • Scenario 3: The student memorizes 50% and searches 50%.

They then tested these students on various tasks: logic puzzles, science trivia, and general knowledge questions.


The Key Findings

1. The "Sweet Spot" Depends on How Smart the Student Is

The paper found that the best strategy changes based on the size of the model.

  • For the "Toddlers" (Small Models): These students are like empty sponges. They benefit massively from the search tool. If you force a small student to memorize everything, they get overwhelmed and confused. Giving them a search tool is like giving them a calculator; it boosts their performance immediately.

    • Analogy: A toddler trying to memorize the entire phone book will fail. But if you give them a phone book and tell them, "Just look up the number when you need it," they can do the job perfectly.
  • For the "Geniuses" (Large Models): As the students get bigger and smarter, they start to internalize more knowledge naturally. The search tool still helps, but the marginal benefit (the extra boost you get) starts to shrink.

    • Analogy: A genius professor already knows most of the facts. If you give them a search tool, it helps a little bit, but they were already going to get the answer right. The "magic" of the search tool fades as the student's own memory gets stronger.

2. The "Crossover Point" (When to Stop Memorizing)

The researchers found a specific tipping point.

  • If a student hasn't studied enough (is "undertrained"), the search tool is a powerful substitute. One "search token" can replace many "memorized tokens."
  • However, once the student has studied enough to reach a certain level of saturation, the search tool becomes less efficient at replacing memorization.
  • The Takeaway: If you have a small model or limited data, lean heavily on retrieval. If you have a huge model with tons of data, lean heavily on memorization.

3. Not All Questions Are Created Equal

The paper also discovered that the type of question matters:

  • Factual Questions (e.g., "Who was the first President?"): Retrieval is amazing here. It's like looking up a date in a history book. The search tool works perfectly.
  • Reasoning Questions (e.g., "If I have 5 apples and eat 2, how many do I have?"): Retrieval is often useless here. The answer isn't in a book; it requires the brain to do math.
    • Analogy: If you ask a student "What is the capital of France?", a search engine is perfect. If you ask "How do I solve this complex physics problem?", a search engine might just show you a textbook page that doesn't actually help you solve your specific problem. The student needs to have the reasoning skills inside their head.

The "Three-Dimensional" Map

The authors created a new mathematical formula (a "Scaling Law") that acts like a 3D map.

  • Axis 1: How big is the student?
  • Axis 2: How much did they memorize?
  • Axis 3: How big is their search library?

This map allows engineers to look at their budget and say: "If I have 100GB of data and a 1B parameter model, I should spend 60% of my time training the model and 40% building the search index to get the best results."

Why This Matters (The "So What?")

In the past, companies built AI by just throwing more data at bigger models, hoping they would memorize everything. This paper says: "Stop! You are wasting money."

  • Efficiency: You don't need to memorize everything if you have a good search tool. You can build smaller, cheaper models that are just as smart by giving them access to a massive external database.
  • Accuracy: Relying on a search tool reduces "hallucinations" (making things up) for factual questions because the model can check the facts.
  • Design: It tells us that the future of AI isn't just about bigger brains; it's about building better brains + libraries systems.

Summary in One Sentence

Don't just try to memorize the whole world; for smaller or specialized AI, it's often smarter and cheaper to teach them how to look things up efficiently, but you have to find the perfect balance between what they learn by heart and what they look up.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →