The recording
You were last reading slide 1.
Retrieval from the parameters
Information retrieval for AI
16 November 2026
Seong Joon Oh - KAIST AI
Upcoming sessions
18 November - RAW-RAG discussion
Preparation is due 17 November, 18:00 KST.
Internal-memory lectures, new order
Parameters, an explicit index of the training data, architectural lookup, the context, then memory updated during inference. Dates and discussion-paper assignments are in the course schedule.
The big picture
So far: external memory. An agent retrieves from a store outside the model. It can read the store and write to it.
From today: retrieval from within the model. We take it in three parts.
| Part | What is retrieved from | Sessions |
|---|---|---|
| Model internal | The parameters | 18 (today), 22 |
| Training data | An explicit index of the training data | 20 |
| Context | The input sequence | 24 |
Session 26 wraps up the lectures.
Today
Retrieval from the parameters, and how learning relates to search.
- Search and learning
- First type of search in learning: learning replaces brute-force search
- Second type of search in learning: learning is retrieval
- But not only retrieval
- The extra comes from compression
- Beyond compression: search at test time
Search and learning

The Bitter Lesson
“general methods that leverage computation are ultimately the most effective, and by a large margin.”
The cost of computation keeps falling. Methods that use it win in the long run.
Sutton, The Bitter Lesson, 2019.
Shared pattern in AI research
Each time, methods built on human knowledge lost to methods that used more computation.
Sutton, The Bitter Lesson, 2019.
Why the lesson is bitter
Building in our knowledge helps in the short term. In the long run it plateaus and “even inhibits further progress”. The breakthrough comes from “scaling computation by search and learning”.
“We want AI agents that can discover like we can, not which contain what we have discovered.”
Sutton, The Bitter Lesson, 2019.
Sutton: search and learning scale with computation
“The two methods that seem to scale arbitrarily in this way are search and learning.”
Search spends computation on more candidates. Learning spends it on more data and larger models.
Today’s question: how is learning related to search?
Sutton, The Bitter Lesson, 2019.
Two kinds of search
Search through training data and past experience - find what happened before and apply it here. The store existed before the query; items are ranked by similarity. This is retrieval.
Search through possible solutions - generate candidates and test them against a goal until one works. The candidates need not exist beforehand. Newell and Simon: the “successive generation of potential solution structures”.
Your view (before the lecture)
With no search at test time, can a trained model produce a correct solution that appears nowhere in its training data?
Commit to an answer before the next slide.
We ask the same question at the end.
Newell and Simon: a problem is a test and a generator
“Intelligence for a system with limited processing resources consists in making wise choices of what to do next.”
Newell and Simon, Turing Award lecture, CACM 1976.
Newell and Simon: knowledge reduces search
Heuristic search hypothesis: a physical symbol system solves problems by generating and modifying symbol structures until it reaches a solution.
“the amount of search is not a measure of the amount of intelligence being exhibited”
“When the symbolic system that is endeavoring to solve a problem knows enough about what to do, it simply proceeds directly towards its goal”
Newell and Simon, Turing Award lecture, CACM 1976.
When knowledge runs out, search returns
“whenever its knowledge becomes inadequate, when it enters terra incognita, it is faced with the threat of going through large amounts of search before it finds its way again”
Keep this sentence. We come back to it at the end.
Newell and Simon, CACM 1976.
Ways to avert the explosion
“The task of intelligence, then, is to avert the ever-present threat of the exponential explosion of search.”
Newell and Simon, CACM 1976.

A bet against brute force
“The potential for the exponential explosion of the search tree … warns us against depending on the brute force of computers … as a compensation for the ignorance and unselectivity of their generators.”
In 1997, “massive, deep search” beat Kasparov.
Newell and Simon, CACM 1976. Sutton, The Bitter Lesson, 2019.
First type of search in learning: learning replaces brute-force search

Chess without search
Stockfish searches. A transformer of up to 270M parameters learns to predict what that search returns.
- Data. Stockfish scores every legal move of about 530M boards, 50 ms each.
- Training. The transformer predicts each move’s win percentage, binned into 128 classes.
- Play. It scores every legal move with one forward pass each and picks the highest.
Lichess blitz Elo 2895, “despite performing no explicit search”.
Ruoss et al., NeurIPS 2024, abstract, §2, Figure 1.

Train-time compute buys back test-time search
AlphaZero agents on Hex. Each line holds playing strength fixed.
For each extra 10× of train-time compute, about 15× of test-time compute can be removed.
Jones, Scaling Scaling Laws with Board Games, arXiv 2021, §IV-C, Figure 9.
The two kinds of search feed each other
- Search through solutions produces answers. Stockfish searches.
- The answers become training data, and learning stores them.
- Search through past experience retrieves them. Chess without search.
- Retrieval proposes the candidates for the next search through solutions. AlphaGo’s policy network.
AlphaGo Zero runs this as a cycle: search improves the policy, and the policy guides the next search.
Silver et al., Mastering the game of Go without human knowledge, Nature 2017.
Learning amortises search
Compute spent in training replaces search at test time.
Search through solutions has become search through past experience.
What does the trained model hold in place of the search?
Second type of search in learning: learning is retrieval
A closed-book answer comes from the weights
Prompt - Who wrote the essay “The Bitter Lesson”? Answer - Richard Sutton. No document in the prompt, no retriever.
Training corpus
- Kambhampati: the model reconstructs a likely completion; it does not look up a record.
- Chollet: “a prompt is like a search query” into a database of vector programs.
Kambhampati, 2024. Chollet, 2023.
Learning as retrieval: the kernel view
A model trained by gradient descent is approximately a kernel machine. Its weights are “effectively a superposition of the training examples”.
Items - the training examples. Similarity - the kernel.
Domingos, arXiv 2020, abstract and §2.

Where the store sits: feed-forward layers
Keys match patterns in training prefixes. Values give a distribution over the next token. The layer outputs the weighted sum of the values.
Feed-forward layers hold about two-thirds of the parameters.
Geva et al., Transformer Feed-Forward Layers Are Key-Value Memories, EMNLP 2021, Figure 1.
But not only retrieval
Not an index
An index answers a lookup in either direction. A model trained on “A is B” often fails “B is A”.
Allen-Zhu and Li: without paraphrased training data, knowledge “may be memorized but not extractable”.
Berglund et al., The Reversal Curse, ICLR 2024, section 2.2. Allen-Zhu and Li, Part 3.1, ICML 2024.
Facts look like retrieval
Wang et al. correlate a model’s output probabilities with pretraining n-gram frequency (distributional memorisation). Pythia models, trained on the Pile.
- Factual QA - strongest memorisation, and the only task where it grew with model size.
- Translation and maths reasoning - more generalisation, more novel outputs.
Wang et al., Generalization v.s. Memorization, ICLR 2025, abstract.

Reasoning draws on procedures
Factual answers draw on a few documents that contain the answer. Reasoning draws on documents that show how to solve the same type of problem.
“the approach to reasoning the models use is unlike retrieval, and more like a generalisable strategy that synthesises procedural knowledge”
Ruis et al., Procedural Knowledge in Pretraining Drives Reasoning, ICLR 2025, Figure 1. Command R 7B and 35B; 5 million pretraining documents.
Learning is retrieval plus something extra
Retrieval is an integral part of learning.
Looked at closely, learning is retrieval plus something extra.
The extra enables the interesting behaviours.
The extra: compression?
Prediction is compression
A model that predicts the next symbol well encodes it in few bits. Across 31 LLMs, benchmark scores “almost linearly correlate” with compression of external text.
Delétang et al., ICLR 2024, abstract. Huang et al., COLM 2024.

The store has a capacity
GPT-style models store about 3.6 bits per parameter. Left: on random data, memorisation plateaus at capacity. Right: on text, it peaks and then falls as the model begins to generalise.
Morris et al., 2025, Figures 1-2. Allen-Zhu and Li, Part 3.3, ICLR 2025, report “2 bits of knowledge per parameter” under a different definition.

Grokking: records first, regularities later
Training accuracy is near perfect before
Power et al., 2022, Figure 1 (division mod 97). Nanda et al., ICLR 2023.
Compression yields the extra
A model must fit more data than its capacity holds verbatim, so sharing structure lowers the loss.
- A learned similarity - shared features decide what counts as near.
- Regularities instead of records - finite capacity forces the switch.
- Reusable procedures - stored once, composed for new cases.
The papers support this reading. None of them proves it.
Beyond compression: search at test time

AlphaGo: retrieval and reranking over a generated space
| AlphaGo | This course |
|---|---|
| Policy network: moves that worked in similar positions | First-stage retriever |
| Value network | Reranker |
| Tree search | Spending the budget on candidates |
The candidates are generated, not stored. Past experience proposes; search through solutions decides.
Silver et al., AlphaGo Zero, Nature 2017, Figure 2. One network gives both the policy p and the value v.
Move 37
Game 2 against Lee Sedol, March 2016.
“a move that had a 1 in 10,000 chance of being used”
AlphaGo played it anyway.
DeepMind, AlphaGo. Board drawn from the Go Game Guru record of game 2.
Search covers terra incognita
Compression supplies the extra up to a point.
Where the prior runs out, search takes over.
An output that no store held sits on the search side. Creativity sits here.
The search tree is also a memory written during inference.
Your view (after the lecture)
With no search at test time, can a trained model produce a correct solution that appears nowhere in its training data?
Commit to an answer before the next slide.
Compare with your answer at the start.
How the class view shifted
The class results appear when the lecturer reveals them.
Counts only. No names.
Interpolate or extrapolate?
If learning is compressed retrieval, and search goes beyond it: do models interpolate or extrapolate?
In more than 100 dimensions, interpolation in the convex-hull sense “almost surely never happens”. By that definition almost everything is extrapolation, which says little about capability.
Balestriero, Pesenti and LeCun, arXiv 2021.
Session 21
Reasoning or Reciting? Wu et al., NAACL 2024.
Counterfactual variants of familiar tasks, such as arithmetic in base 9.
Reading due 24 November, 18:00 KST.