← 16 Session 18 - Retrieval from the parameters - Mon 16 Nov 20 →
All decks
  1. 1 Why retrieval nowMon 31 Aug
  2. 2 The inverted indexWed 02 Sep
  3. 3 Index construction and ranking foundationsMon 07 Sep
  4. 4 BM25: finish probabilistic rankingWed 09 Sep
  5. 5 Evaluation and the changing goals of retrieval benchmarksMon 14 Sep
  6. 6 Coarse retrieval and rerankingWed 16 Sep
  7. 7 LLM embeddings and rerankingMon 28 Sep
  8. 9 Hard queries: reasoning and ambiguityWed 07 Oct
  9. 10 Approximate nearest neighbour search and search systemsMon 12 Oct
  10. 12 Agentic memory - introduction, desiderata, and evaluationMon 26 Oct
  11. 14 Agentic memory - approaches and handcrafted methodsMon 02 Nov
  12. 16 Agentic memory - RL methods and wrap-upMon 09 Nov
  13. 18 Retrieval from the parametersMon 16 Nov
  14. 20 An explicit index of the training dataMon 23 Nov
  15. 22 Architectural lookupMon 30 Nov
  16. 24 Retrieval from the context - attention and the KV cacheMon 07 Dec
  17. 25 Retrieval from the context - which tokens are readWed 09 Dec
  18. 26 Course wrap-upMon 14 Dec
Contents
  1. 1Retrieval from the parameters
  2. 2Upcoming sessions
  3. 3The big picture
  4. 4Today
  5. 5Search and learning
  6. 6The Bitter Lesson
  7. 7Shared pattern in AI research
  8. 8Why the lesson is bitter
  9. 9Sutton: search and learning scale with computation
  10. 10Two kinds of search
  11. 11Your view (before the lecture)
  12. 12Newell and Simon: a problem is a test and a generator
  13. 13Newell and Simon: knowledge reduces search
  14. 14When knowledge runs out, search returns
  15. 15Ways to avert the explosion
  16. 16A bet against brute force
  17. 17First type of search in learning: learning replaces brute-force…
  18. 18Chess without search
  19. 19Train-time compute buys back test-time search
  20. 20The two kinds of search feed each other
  21. 21Learning amortises search
  22. 22Second type of search in learning: learning is retrieval
  23. 23A closed-book answer comes from the weights
  24. 24Learning as retrieval: the kernel view
  25. 25Where the store sits: feed-forward layers
  26. 26But not only retrieval
  27. 27Not an index
  28. 28Facts look like retrieval
  29. 29Reasoning draws on procedures
  30. 30Learning is retrieval plus something extra
  31. 31The extra: compression?
  32. 32Prediction is compression
  33. 33The store has a capacity
  34. 34Grokking: records first, regularities later
  35. 35Compression yields the extra
  36. 36Beyond compression: search at test time
  37. 37AlphaGo: retrieval and reranking over a generated space
  38. 38Move 37
  39. 39Search covers terra incognita
  40. 40Your view (after the lecture)
  41. 41How the class view shifted
  42. 42Interpolate or extrapolate?
  43. 43Session 21

The recording

1

Retrieval from the parameters

Information retrieval for AI

16 November 2026

Seong Joon Oh - KAIST AI

2

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.

3

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.

PartWhat is retrieved fromSessions
Model internalThe parameters18 (today), 22
Training dataAn explicit index of the training data20
ContextThe input sequence24

Session 26 wraps up the lectures.

4

Today

Retrieval from the parameters, and how learning relates to search.

  1. Search and learning
  2. First type of search in learning: learning replaces brute-force search
  3. Second type of search in learning: learning is retrieval
  4. But not only retrieval
  5. The extra comes from compression
  6. Beyond compression: search at test time
5

Search and learning

6
Deep Blue at the Computer History Museum. Anton Chiang, CC BY 2.0, via Wikimedia Commons.
Deep Blue at the Computer History Museum. Anton Chiang, CC BY 2.0, via Wikimedia Commons.

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.

7
What researchers built in, and what won, in four fields. After Sutton (2019).
What researchers built in, and what won, in four fields. After Sutton (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.

8

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.

9
Schematic, not data. Built-in knowledge plateaus; search and learning keep rising with computation.
Schematic, not data. Built-in knowledge plateaus; search and learning keep rising with computation.

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.

10

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”.

11

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.

12
Generate and test. After Newell and Simon (1976).
Generate and test. After Newell and Simon (1976).

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.

13

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.

14

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.

15
A selective generator, recognition, and a better representation. After Newell and Simon (1976).
A selective generator, recognition, and a better representation. After Newell and Simon (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.

16
Deep Blue versus Kasparov, 1997, game 6, final position. Kasparov resigned. Wikimedia Commons, CC0.
Deep Blue versus Kasparov, 1997, game 6, final position. Kasparov resigned. Wikimedia Commons, CC0.

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.

17

First type of search in learning: learning replaces brute-force search

18
Ruoss et al., Figure 1 (top), PDF p. 2. Stockfish 16 annotates every board with state-values and every legal move with an action-value.
Ruoss et al., Figure 1 (top), PDF p. 2. Stockfish 16 annotates every board with state-values and every legal move with an action-value.

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.

19
Jones, Figure 9, PDF p. 5. Each line is a fixed Elo on a 9x9 board.
Jones, Figure 9, PDF p. 5. Each line is a fixed Elo on a 9x9 board.

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.

20

The two kinds of search feed each other

  1. Search through solutions produces answers. Stockfish searches.
  2. The answers become training data, and learning stores them.
  3. Search through past experience retrieves them. Chess without search.
  4. 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.

21

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?

22

Second type of search in learning: learning is retrieval

23

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 weights answer

  • 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.

24
Schematic after Domingos 2020, section 2.
Schematic after Domingos 2020, section 2.

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.

25
Geva et al., Figure 1, PDF p. 1. Memory coefficients weight the values.
Geva et al., Figure 1, PDF p. 1. Memory coefficients weight the values.

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.

26

But not only retrieval

27
Diagram: Tom Cruise to Mary Lee Pfeiffer, "Who is Tom Cruise's mother?" GPT-4 correct 79%; reverse "Who is Mary Lee Pfeiffer's son?" correct 33%. Drawn from Berglund et al., ICLR 2024, section 2.2.
Diagram: Tom Cruise to Mary Lee Pfeiffer, "Who is Tom Cruise's mother?" GPT-4 correct 79%; reverse "Who is Mary Lee Pfeiffer's son?" correct 33%. Drawn from Berglund et al., ICLR 2024, section 2.2.

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.

28

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.

29
Ruis et al., ICLR 2025, Figure 1, PDF p. 2. Left: reasoning queries share influential procedural documents; factual queries each draw on documents containing the answer. Right: correlation of influence scores between query pairs, 7B and 35B.
Ruis et al., ICLR 2025, Figure 1, PDF p. 2. Left: reasoning queries share influential procedural documents; factual queries each draw on documents containing the answer. Right: correlation of influence scores between query pairs, 7B and 35B.

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.

30

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.

31

The extra: compression?

32
Bar chart, compressed size as percent of raw size: ImageNet patches PNG 58.5%, Chinchilla 70B 43.4%; LibriSpeech FLAC 30.3%, Chinchilla 70B 16.4%. Numbers from Delétang et al., ICLR 2024, abstract.
Bar chart, compressed size as percent of raw size: ImageNet patches PNG 58.5%, Chinchilla 70B 43.4%; LibriSpeech FLAC 30.3%, Chinchilla 70B 16.4%. Numbers from Delétang et al., ICLR 2024, abstract.

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.

33
Morris et al. 2025, Figures 1 and 2, PDF p. 1. Left: unintended memorisation of uniform random data plateaus at each model's capacity. Right: on text, memorisation rises with training set size, then falls.
Morris et al. 2025, Figures 1 and 2, PDF p. 1. Left: unintended memorisation of uniform random data plateaus at each model's capacity. Right: on text, memorisation rises with training set size, then falls.

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.

34
Power et al. 2022, Figure 1 left, PDF p. 1. Division mod 97 on 50% of the data: training accuracy (red) near 100% before 10^3 steps; validation accuracy (green) reaches it near 10^6 steps.
Power et al. 2022, Figure 1 left, PDF p. 1. Division mod 97 on 50% of the data: training accuracy (red) near 100% before 10^3 steps; validation accuracy (green) reaches it near 10^6 steps.

Grokking: records first, regularities later

Training accuracy is near perfect before steps. Validation accuracy gets there only near . The phases: “memorization, circuit formation, and cleanup”.

Power et al., 2022, Figure 1 (division mod 97). Nanda et al., ICLR 2023.

35

Compression yields the extra

A model must fit more data than its capacity holds verbatim, so sharing structure lowers the loss.

  1. A learned similarity - shared features decide what counts as near.
  2. Regularities instead of records - finite capacity forces the switch.
  3. Reusable procedures - stored once, composed for new cases.

The papers support this reading. None of them proves it.

36

Beyond compression: search at test time

37
Silver et al., AlphaGo Zero, Nature 2017, Figure 2 (manuscript p. 5): Monte-Carlo tree search - select, expand and evaluate with the network's (p, v), back up, play.
Silver et al., AlphaGo Zero, Nature 2017, Figure 2 (manuscript p. 5): Monte-Carlo tree search - select, expand and evaluate with the network's (p, v), back up, play.

AlphaGo: retrieval and reranking over a generated space

AlphaGoThis course
Policy network: moves that worked in similar positionsFirst-stage retriever
Value networkReranker
Tree searchSpending 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.

38
Go board after move 37 of AlphaGo (black) v Lee Sedol, game 2, 10 March 2016. Black 37 at P10 is circled. Drawn from the Go Game Guru game record, checked against the Wikipedia game diagram.
Go board after move 37 of AlphaGo (black) v Lee Sedol, game 2, 10 March 2016. Black 37 at P10 is circled. Drawn from the Go Game Guru game record, checked against the Wikipedia game diagram.

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.

39

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.

40

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.

41

How the class view shifted

The class results appear when the lecturer reveals them.

Counts only. No names.

42

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.

43

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.