- Kutas and Hillyard (1980) used sentences like this one in one of the first EEG studies of reading. The next slide shows what they measured.
- Kutas and Hillyard (1980) compared sentences that ended as expected ("butter") with sentences that ended in a word that did not fit ("socks"). The EEG, averaged over many sentences, went more negative about 400 ms after the unexpected word. This response is called the N400 - Reading the figure: the voltage is plotted with negative up, as was the custom in EEG papers, so the N400 is the dashed peak above the line after SOCKS. The dotted sentence ends in a word printed in large type (SHOES): a surprise in how the word looks, not in its meaning, gives a positive response instead (P560). The N400 tracks meaning - We come back to this later. A language model gives every word a number called surprisal, which measures how unexpected the word was given the words before it. That number predicts how long people take to read the word and how large the N400 is
- The transformer block has multi-head self-attention, then a small MLP applied at each position. Each of the two has a residual connection and layer normalization. Because of the causal mask, one forward pass over T tokens gives T next-word predictions to train on - Feeding the true text as input during training, rather than the model's own guesses, is teacher forcing; it is unchanged at scale - The chain rule of probability: $p(w_1,\dots,w_T)=\prod_{i=1}^{T} p(w_i\mid w_1,\dots,w_{i-1})$, where $w_i$ is the token at position $i$ and $T$ the number of tokens in the window. The loss is the average cross-entropy of these T predictions; the vocabulary is now word pieces (see "From characters to word pieces") rather than characters - Scaling laws (Kaplan et al. 2020; Hoffmann et al. 2022, "Chinchilla") get their own slide shortly. Chinchilla's rule is about 20 training tokens per parameter for a fixed compute budget, with loss L(N, D) = E + A/N^α + B/D^β for N parameters and D tokens. Small models are now trained far beyond that ratio (Llama 3 8B saw about 15T tokens), because a small model is cheaper every time it answers a question
- PF-day: 10^15 floating-point operations per second for a day, about 8.6 × 10^19 operations - Non-embedding parameters: all the weights except the embedding table, the lookup that turns each token into a vector (and the matching output layer); Kaplan et al. leave those out because they barely affect the loss - Figure 1 of Kaplan et al. (2020): the loss of transformer language models on held-out web text against compute (left, every training run in light blue and their lower envelope in black), dataset size (middle) and non-embedding parameters (right), each a straight line on log-log axes, so a power law. N is the number of non-embedding parameters - With the number of parameters fixed, making the network deeper or wider barely changes the loss. The fitted law for parameters is L(N) = (N / 8.8 × 10^13)^-0.076. The exponent is small: multiplying the parameters by 10 multiplies the loss by 10^-0.076 ≈ 0.84. The loss keeps falling at a predictable rate, but each step costs ten times more parameters - Hoffmann et al. (2022) redid the fit with the learning-rate schedule matched to the length of each training run. They found that Kaplan's recipe undertrains the models: parameters and tokens should grow in equal proportion. Their 70-billion-parameter model trained on 1.4 trillion tokens (Chinchilla) beat Gopher, a 280-billion-parameter model trained on 300 billion tokens, with the same compute - The law predicts the loss, not what the model can do. Schaeffer et al. (2023) argue that many reported "emergent abilities", skills that seem to appear suddenly at some model size, come from all-or-nothing metrics such as exact-match accuracy. Scored with a continuous metric, the same models improve smoothly. The loss is smooth, but a task scored right or wrong can still show a jump
- BPE (byte-pair encoding) starts from the 256 possible bytes rather than from characters, so text in any language or script can be encoded; for English letters, one byte is one character. The space before a word is part of its piece. "brain" with no space and " brain" after a space are therefore different tokens, and can be split differently: "unbelievable" without a space is four pieces, " unbelievable" with a space is one - Each piece gets one row of the embedding table, as each character did in the model you build in the assignment. The examples on the slide come from GPT-2's own tokenizer - The tokenizer is fixed before the model is trained, and its merges are chosen from the tokenizer's own training text. The model only sees piece numbers and never the letters inside a piece, which is one reason large models often miscount the letters in a word - BPE began as a compression method; Sennrich et al. (2016) brought it to neural translation. A tokenizer may not be necessary: Pagnoni et al. (ACL 2025, "Byte latent transformer", doi:10.18653/v1/2025.acl-long.453) train on raw bytes, grouped into patches according to how predictable the next byte is, and match token-based models at scale
- Books: Google Books estimated about 130 million distinct books in 2010; at 70,000 to 100,000 words a book, that is roughly 9 to 13 trillion words - Public text: Villalobos et al. (ICML 2024) estimate the stock of good-quality public human text at about 300 trillion tokens, and project that models will have used it up between 2026 and 2032. Labs no longer publish their training-set sizes, so for frontier models these are estimates - A child's input: the BabyLM challenge (Warstadt et al., CoNLL 2023) caps training at 100 million words, roughly what a child has heard by age 13. 11 trillion / 100 million ≈ 110,000 - The next slide lists the models used in this lecture, with their sizes and training tokens
- B = billion, T = trillion. GPT-2: Radford et al. (2019); GPT-3: Brown et al. (2020). GPT-2 was trained on WebText, about 40 GB of text from web pages linked on Reddit; the token count is an estimate, since the paper gives only the size in bytes - DeepMind built Gopher and Chinchilla to study scaling. Chinchilla used the same compute as Gopher with a quarter of the parameters (70 billion against 280 billion) and more than four times the data, and it did better (next slide) - Pythia is a suite of eight model sizes trained on the same data in the same order, with saved checkpoints along the way, so researchers can study how models learn. The assignment and the reading-time analysis use GPT-2
- Data: Epoch AI, "Notable AI models" (CC-BY 4.0), downloaded 2026-11-17; language models with a training-compute value. Frontier values (GPT-4, Gemini, GPT-6 Astra) are Epoch's estimates, since these labs do not publish them - The line is a least-squares fit of log compute on date for all 276 language models from 2018 on (6.2× per year, doubling every ~4.6 months). Fits restricted to the frontier models give a somewhat slower rate (Epoch reports roughly 4–5× per year for frontier training runs) - GPT-2: 1.9 × 10^21 FLOP (2019). The largest in the data: 9.4 × 10^26 FLOP (2026), about 500,000 times more - Script: 2026/figures/make_L17_epoch_compute.py
- Some abilities seem to appear abruptly with scale; Schaeffer et al. (2023) show this is often an artifact of all-or-nothing scoring - Chinchilla's rule: about 20 training tokens per parameter for a fixed compute budget, with loss L(N, D) = E + A/N^α + B/D^β for N parameters and D tokens - Schaeffer et al. (2023): abilities that look abrupt when scored right or wrong often rise smoothly when scored by the probability of the correct answer
- Huh et al. (2024) survey many reports of convergence and show it across modalities: the nearest neighbours of an image in a vision model's space and of its caption in a language model's space overlap more as both models get larger and better - "Platonic", after Plato's allegory of the cave: the data are shadows, and different models trained on different shadows recover the same underlying reality - The paper itself discusses limits: alignment is measured with a few kernel-similarity metrics, absolute alignment values stay modest, and some information is specific to one modality - Representational geometry and its comparison across systems come from the lectures on mental spaces and on comparing networks with the brain
- This is the "random insertion in word" task of Brown et al. (2020): random punctuation or spaces are inserted between the letters of a word, and the model must output the original word. The prompt on the slide is written in that format as an illustration; it is not a transcript from the paper - Zero-shot: the prompt gives only a description of the task. One-shot: it also contains one solved example. Few-shot: it contains a handful; the prompt here has two, and Brown et al. used 10 to 100
- Solid versus dashed lines: the same prompts with and without a one-sentence natural-language instruction before the examples. The instruction helps most with zero or one example (175B one-shot: ~46% with it, ~26% without); from about 10 examples on, the curves merge: the examples alone convey the task - Zero-shot, one-shot and few-shot as on the previous slide: the x axis counts the solved examples in the prompt - The figure is Fig. 1.2 of Brown et al. (2020), on a simple task: removing random symbols from a word. The larger the model, the more accuracy it gains from the examples in the prompt - No weight changes. The examples are read in a single forward pass, and whatever the model picks up from them lives only in the activations of that pass
- This repeats the GPT-3 experiment of the previous slide at a scale that runs on a laptop. The three GPT-2 models (124 M, 355 M and 774 M parameters) are loaded with the Hugging Face transformers library, the same models the assignment uses. Each prompt holds k solved pairs, one per line, then a new word and an arrow. The model writes its most likely continuation at each step (greedy decoding), and the answer counts as correct when that continuation starts with the antonym - Accuracy for 0, 1, 2, 4 and 8 examples in the prompt: small 0, 10, 8, 6, 4%; medium 0, 22, 64, 88, 94%; large 4, 25, 81, 92, 96%. The 32 antonym pairs used for testing were chosen before any model was run - The examples in the prompt do two things. They tell the model what the task is (GPT-2 small cannot use this) and they show the answer format. With zero examples nothing tells the model what "->" means, so all three models score near zero - The caution about metrics from the scaling-laws slide applies here. Scored right or wrong, the step from GPT-2 small to medium looks like a jump. The probability the model assigns to the correct antonym would probably rise more smoothly (Schaeffer et al. 2023); we did not plot it - For the brain, the relevance is that a new task is picked up from a few examples within a single pass, with no change to any weight (the analogue of a synapse). The next two slides ask where this ability comes from and what mechanism inside the forward pass produces it
- Kalamang: MTOB benchmark (Machine Translation from One Book, Tanzer et al. 2024), several hundred pages of field-linguistics material for a language spoken by fewer than 200 people, so it is essentially absent from training data. The Gemini 1.5 report (2024) puts the whole book in the context and reports translation at a level similar to a person who learned from the same material - Min et al. (2022): replacing the labels of the demonstrations with random labels barely hurts classification and multiple-choice accuracy across 12 models, including GPT-3; what matters is the label space, the distribution of inputs and the format - Wei et al. (2023): with flipped labels, small models keep using their prior (they answer as if the labels were correct); the ability to override priors and follow the examples appears with scale - Agarwal et al. (2024): going from a few to hundreds or thousands of examples in the prompt improves many tasks and can override biases from pretraining
- Nobody trained these models to learn from examples. Web text happens to contain many word lists with translations, question-and-answer pages and worked problems, and each of these is a small task shown by example - Figure 1.1 of Brown et al. (2020). The outer loop is pretraining: gradient descent on next-token prediction over millions of documents. The inner loop is what happens within one document. By the third or fourth example line the model has picked up the task, and the next lines become easier to predict - Chan et al. (2022) trained transformers on sequences of images and found that in-context learning appeared only when the training data were "bursty", meaning the same rare items recur within one sequence, as words and topics recur within a document
- Brown et al. (2020) call this view meta-learning: the outer loop (pretraining by gradient descent) builds a model whose forward pass carries out an inner loop (learning a task from the examples in its context) - Chan et al. (2022): in-context learning emerges when training data are "bursty", with items that recur in clusters within a document, as tasks shown by example do
- Same figure as in the lecture on building a language model. The sentence is "The black cat sat on the mat. The black", and the model should predict "cat" - An induction head copies: [A][B] … [A] → predict [B]. That explains repeating a pattern seen earlier in the context, and part of the gain from long contexts - The attention-head explorer from the lecture on building a language model shows this pattern in GPT-2. A previous-token head (layer 4, head 11) copies each word's identity to the next position, and an induction head in the next layer (layer 5, head 5) looks back for the earlier occurrence of the current word and predicts the word that followed it - Olsson et al. (2022): in small and large models, induction heads appear at one point in training, the same point where the loss on late tokens in a context drops sharply (a measure of in-context learning). They propose induction heads as a candidate mechanism for most in-context learning; this is evidence, not a proof
- Function vectors (Todd et al. 2024): averaging the outputs of a few attention heads over prompts for one task gives a vector that, added to a new prompt, makes the model perform that task. The heads that write it are function-vector heads - Yin & Steinhardt (2025), Fig. 1a, Pythia 6.9B: accuracy on few-shot tasks as a growing fraction of heads is ablated. Random heads: flat near 0.56. Induction heads: slowly down to 0.44 at 20%. FV heads: down to about a third of the intact accuracy - Shown in the "Going further" part of the lecture on building a language model
- Akyürek et al. (2023) and von Oswald et al. (2023) trained transformers on sequences of (x, y) pairs generated by a linear function, where the task is to predict the next y. They show by construction that one linear self-attention layer can carry out one step of gradient descent on the squared error over the pairs in the context. They also show that trained transformers behave like gradient descent or ridge regression. Antonyms are not a linear function, so this does not explain the antonym task directly. It shows that learning from the prompt can come from computations already present in the pretrained weights
- Model names change every few months, but the recipe has stayed the same since 2020. A decoder-only transformer is pretrained on next-token prediction at scale, and then trained further (the alignment slides that follow) - Guo et al. (2025) is the peer-reviewed paper for DeepSeek-R1. OpenAI has not published a paper describing how o1 was trained
- Figure 2 of Ouyang et al. (2022), the InstructGPT paper. Step 1, SFT (supervised fine-tuning): the model is trained on answers written by people. Step 2, RM: a reward model is trained to score answers according to which ones labelers prefer. Step 3, PPO (proximal policy optimization): a reinforcement-learning algorithm updates the model to produce answers the reward model scores highly. The "policy" is the language model itself, treated as an agent that chooses which token to write next - Labelers preferred the answers of the 1.3-billion-parameter InstructGPT model to those of the 175-billion-parameter GPT-3, even though InstructGPT is more than 100 times smaller
- RLHF is reinforcement learning from human feedback (Ouyang et al. 2022, the InstructGPT paper behind ChatGPT). DPO is direct preference optimization (Rafailov et al. 2023), which learns from the same preference data without training a separate reward model - Writing out steps before the answer started as a prompting trick. Wei et al. (2022) put worked solutions in the prompt ("chain-of-thought"), and large models improved a lot on grade-school math word problems. Kojima et al. (NeurIPS 2022) found that adding "Let's think step by step" with no worked example already gives part of the gain. DeepSeek-R1 (Guo et al. 2025) is trained in step 3 to produce such chains on its own - Writing out steps helps people too, because intermediate results go onto the page instead of being held in working memory, which is limited to a few items - Each of the three stages continues training the same network. The weights change at every stage, but the architecture stays the same
- Schematic, own figure: the probabilities are not from a real model. It illustrates that generation is sequential choice, and that locally best choices need not give a globally good answer - Search over paths is what beam search, sampling several answers and picking the most common one (self-consistency, Wang et al. 2023), and reasoning models do in different ways
- Chain-of-thought prompting (Wei et al. 2022): eight worked examples with intermediate steps in the prompt; PaLM 540B reached state-of-the-art accuracy on GSM8K, grade-school math word problems, above a fine-tuned GPT-3 with a verifier. The gain appears only in sufficiently large models - Zero-shot chain of thought (Kojima et al. 2022): the single phrase "Let's think step by step" before the answer, no examples - DeepSeek-R1 (DeepSeek-AI, Nature 2025): pure reinforcement learning with rewards that a program can check (is the math answer right, does the code pass its tests). Self-reflection, verification and changes of strategy appear in the outputs without being taught - Each written token costs one forward pass, so a longer chain of thought is more computation spent on one answer. The weights are the same; only the amount of computation at answer time changes - A cognitive parallel often drawn: fast intuitive answers versus slow, deliberate, step-by-step reasoning ("System 1" and "System 2")
- In a mixture-of-experts layer, each expert is a separate MLP, and a small router network chooses which ones process each token. The compute per token stays small while the total number of weights grows. DeepSeek-V3 (DeepSeek-AI 2024) sends each token to 8 of 256 experts in each layer - Patches as tokens is the vision transformer (Dosovitskiy et al. 2021); multimodal assistants put image patches and word pieces in one sequence - Reid et al. (2024) is the Gemini 1.5 report; Gemini 1.5 was the first widely used model with a context window of about a million tokens. Blakeman et al. (2025) describe Nemotron-H, one of the hybrid families (attention layers mixed with another kind of sequence layer)
- Retrieval-augmented generation (Lewis et al. 2020) works in three steps. The system searches a document collection with the question, puts the best passages into the prompt, and the model writes its answer from those passages. When an assistant quotes a fact with a source, it usually read the fact this way, in the context, as it read the antonym examples. The fact was not stored in the weights - Providers may fine-tune later versions of a model on collected conversations, but that is a separate training run done afterwards. The model does not learn from your chat while you are talking to it - The stored keys and values are the "KV cache" from the lecture on building a language model: a key vector and a value vector for each earlier token, in every layer and head. Reid et al. (2024) report the first million-token context in a deployed model. As that lecture showed (Liu et al. 2024), models still answer best from information at the start and the end of a long context
- Toolformer (Schick et al. 2023) trained a model to insert calls to a calculator, a search engine and other tools into its own text. ReAct (Yao et al. 2023) alternates between writing a reasoning step and taking an action such as a search, and the model reads the result of each action before writing the next step - Coding assistants are agents of this kind. They read files, run commands and tests, and edit code in a loop. The model inside is still a next-token predictor, and the loop around it is ordinary software that runs the tools and feeds the results back into the prompt
- Surprisal in bits uses a logarithm with base 2, while the training loss used nats (natural logarithm); 1 nat is about 1.44 bits. A surprisal of 10 bits means the model gave the word a probability of about 1/1,000 given the words before it. A surprisal of 0 bits means the model was certain - Shain et al. (2024) tested how reading time depends on a word's probability, using six reading-time data sets. The effect is logarithmic, as surprisal theory says: each halving of the probability adds the same amount of reading time - The N400 is an event-related potential (ERP): EEG averaged over many trials and aligned in time to the onset of each word. Michaelov et al. (2023) show that the surprisal GPT-3 assigns to words accounts for several classic N400 effects - Surprisal began as a theory of reading in psycholinguistics (Hale 2001; Levy 2008). Language models could not estimate it well until recently, so the idea only became easy to test once they could
- The three models are the GPT-2 releases of Radford et al. (2019), with 124 M, 355 M and 774 M parameters. They load through the Hugging Face transformers library in two lines of code, and the assignment uses the same three. A word split into several pieces gets the sum of the surprisals of its pieces. The first token has no preceding words to condition on, so it has no surprisal - The mean surprisal in nats over a text is the cross-entropy loss on that text. Perplexity is the exponential of this loss, so a lower loss and fewer bits per token describe the same improvement - The larger model is not always more confident on a single word. For example, "calls" has a surprisal of 7.2 bits under GPT-2 medium and 5.2 bits under small. The scaling law is about average loss over a text, and says nothing about any one word
- Natural Stories (Futrell et al. 2021): ten stories of about 1,000 words, read one word at a time by 181 people; a word's reading time is how long a reader waited before pressing the key for the next word. Shown: the mean over readers who answered the comprehension questions well, keeping times between 100 and 3,000 ms, as in the assignment - Surprisal from GPT-2 small, with all earlier words of the story as context; a word split into several tokens gets the sum of their surprisals - The slowest word, "years.", ends the sentence: readers slow down at the end of a sentence, and some of the cost of "seven-twelve" lands on the word after it (spillover). This is why reading-time models also include the previous word's surprisal - Over all ten stories the correlation is 0.26. The next slide asks how much surprisal adds once word length and frequency are already in the model
- Same data, readers and filtering as the previous slide; one point per word of the story (n = 1,038). Pearson r = 0.30; r² ≈ 0.09 - years. (873 ms) sits far above the line for its surprisal: the slowdown from seven-twelve spills over onto the next word, which surprisal at that word does not capture - Script: 2026/figures/make_L17_reading_times_scatter.py
- The data are Natural Stories (Futrell et al. 2021): 181 readers each read ten stories. Each word's reading time is first predicted from the word's length and its frequency; then surprisal is added as an extra predictor - Least squares chooses the regression weights that make the squared differences between observed and fitted reading times as small as possible. The log-likelihood measures how probable the observed times are under the fitted model, and ΔLL on the axis is the increase in log-likelihood when surprisal is added to the predictors. Adding a predictor can never make the fit to the same data worse, so the comparison uses held-out stories: fit on nine stories, score on the tenth, and repeat with each story left out in turn - Perplexity is 2 raised to the mean surprisal in bits, and a lower perplexity means the model predicts the text better. Oh and Schuler (2023) found that, once models are large enough, lower perplexity goes with a worse fit to reading times, both on Natural Stories and on the Dundee eye-tracking corpus. The larger models have been trained on far more text than any person reads - Oh and Linzen (2026) argue that current language models predict words better than a person can ("superhuman"), because they have seen more text and keep more context in memory than a reader does. They propose that models of human prediction should be made less powerful, for example smaller, or trained on about as much text as a person reads - The Natural Stories texts were written to contain rare grammatical constructions while still reading naturally. Reading is self-paced: readers press a key to reveal each word, and the time between key presses is the reading time
- Recorded on a laptop with Ollama, 2026-11-17: qwen3:8b, raw text (no chat template), 20 top next-token candidates at each word. Script: 2026/figures/run_L17_expectations.py - 1. Compare butter and socks: after "He spread the warm bread with", the model puts 36% on butter (5.8 bits); socks is not in its top 20 (at least 8.75 bits) - 2. Click "with": the model expected "butter", "a", "the", "some" - 3. Antonyms: after two or three pairs, the answers cost almost 0 bits: in-context learning, word by word - 4. Garden path, "The old man the boat": "the" after "man" and "sleep" at the end are the surprising words - 5. Raise the temperature: the distribution flattens and unlikely words become more likely to be sampled
- ECoG (electrocorticography) records the electrical signal from electrodes placed directly on the surface of the brain, in patients who are being monitored before epilepsy surgery - On the brain side we use encoding models, as in the lecture on comparing networks with the brain: a linear readout is fitted from the model's activations to each voxel or electrode, and scored on held-out text. Antonello et al. (2023) found that fMRI encoding performance grew logarithmically with model size, from 125 M to 30 B parameters, by about 15% in total. Hong et al. (2026) found the same with ECoG in model families trained on a fixed data set, so what changes is the size of the model and not the amount of data - The reading-time result and the brain result seem to disagree, and one possible reason is the difference in what is measured. A reading time is one number per word that reflects the reader's prediction. An encoding model uses hundreds of dimensions of the model's representation and can pick up any feature that correlates with brain activity. AlKhamissi et al. (EMNLP 2025, on the further-reading slide) find that the fit to the brain follows how much grammar a model knows, and not how much it knows about the world - Model–brain scores have pitfalls of their own. Two slides ahead, Hadidi et al. (2026) show how confounds (other variables that also predict the signal) can inflate them
- The language network is the set of left frontal and temporal regions that respond more strongly to sentences than to lists of nonwords. It is located in each participant with a short localizer scan (panel A) - Tuckute et al. (2024) used the encoding model to search about 1.8 million sentences for those it predicted would give the largest responses ("drive") and the smallest ("suppress"), and showed them to new people who had not been in the data used to fit the model. In the event-related design the drive sentences raised the response by about 86% and the suppress sentences lowered it by about 98%, relative to baseline sentences. Surprisal and well-formedness explained much of the effect. The network responds most to sentences that are hard to predict but still read like language - This uses the encoding model from the lecture on comparing networks with the brain in the opposite direction. Before, we asked how well the model fits the brain. Here we ask which sentences the model predicts will change the brain response most, and then test that prediction on new people. We saw the same closed-loop idea earlier in the course, in the vision work with synthesized images
- Lineage: Helmholtz (unconscious inference) → Rao & Ballard (1999) → Friston (free energy) - This is the same idea as self-supervised learning, but from neuroscience. In self-supervised learning a machine predicts its input in order to learn good features. In predictive coding the brain is proposed to predict its input in order to perceive it - Helmholtz (1867) described perception as unconscious inference from sensations to their causes - Westerberg and Roelfsema (2026) review recordings across cortical layers during perception and attention. The usual finding is that feedback from higher areas increases the activity of neurons that represent the attended or predicted stimulus. Predictive coding expects the opposite, suppression of what is predicted. The authors group the accounts that fit better under the name BELIEF. Predictive coding is a hypothesis with evidence on both sides, so it can be tested - The brain score (panel a) is the correlation, on held-out data, between a voxel's fMRI response and the response predicted by an encoding model fitted to GPT-2's activations - The forecast score (panels b to d) is the gain in brain score when the model's activations for the current word are joined by its activations for the words that come after it, up to a distance d. The gain peaks at about 8 words, which is roughly three seconds of speech - Panels e to g: the distance that helps most is about 8 words in the superior temporal sulcus and about 9 to 10 words in the inferior frontal gyrus and the supramarginal and angular gyri. Higher areas predict further ahead, as hierarchical predictive coding expects - A language model is trained to predict only the next word. This result suggests that the brain predicts further ahead and at several timescales at the same time - The same group's earlier study (Caucheteux & King 2022) recorded 102 people with fMRI and MEG as they read 400 sentences, and compared many language models. A model's fit to the brain depended mainly on how well it predicts words from their context - A caution: the fMRI signal is slow. "8 words ahead" therefore tells us how far ahead the future words that improve the fit lie. It does not show the brain making a prediction
- The first question is whether models of human prediction should be made less powerful, as Oh and Linzen (2026) argue (further-reading slide). The BabyLM challenge (Warstadt et al., CoNLL 2023) trains language models on about 100 million words or fewer, roughly what a child has heard by age 13 - The second is how to connect two results. Caucheteux and King find that future words improve the model's fit to the brain, and Westerberg and Roelfsema find mostly enhancement rather than suppression in cortical circuits. A forecast in the representation has not yet been shown to be an error signal in the circuit - The third question leads into the next lecture. A recurrent network also keeps what it has read in its activity, a state that is carried from one step to the next, and does not store it in its weights
- The slides after this one go beyond the lecture and are for those who want to read more - Terms you should be able to define for the exam: token and word piece, surprisal (in bits or nats), in-context learning, encoding model, predictor and held-out fit, predictive coding and its error units - The next lecture covers recurrence, another way for a network to carry context, from loops in the visual cortex to the recurrent layers inside current language models. The last lecture before the exam is on world models
- Whether an LLM is also a good model of how people think is still argued - Binz & Schulz (2023) gave GPT-3 classic cognitive-psychology tasks. Binz et al. (2025) fine-tuned a language model on human choices from 160 experiments, so that it predicts and imitates how people behave - AI assistants are not allowed on the assignments. For the final project the rule is in the syllabus
- Natural Stories and similar corpora give the reading time of every word, which is what a project on surprisal needs - Contamination: benchmark questions posted online end up in the web text models are trained on. A model can then answer them from memory, and its score overstates what it can do on new items. A model's training cutoff date tells you which items it cannot have seen
- Oh & Linzen (2026) and Hadidi et al. (2026) follow from the reading-time and brain slides; Cai et al. (2026), Goldstein et al. (2025) and AlKhamissi et al. (2025) from the current-readings slide; Westerberg & Roelfsema (2026) from the predictive-coding slides - More that qualify: Hong et al. (eLife 2026, doi:10.7554/eLife.101204), larger models align better with ECoG when training data are held fixed; Shain et al. (PNAS 2024, doi:10.1073/pnas.2307876121), the logarithmic effect of word probability on reading time across six corpora; Nastase et al. (Neuron 2026, doi:10.1016/j.neuron.2026.07.024), a perspective on LLM embeddings as a model of the neural population code for language; Mahowald et al. (TICS 2024, doi:10.1016/j.tics.2024.01.011), language ability versus thought in LLMs; McCoy et al. (PNAS 2024, doi:10.1073/pnas.2322420121), what next-token training predicts LLMs will get wrong; Lotter, Kreiman & Cox (Nat Mach Intell 2020, doi:10.1038/s42256-020-0170-9), a predictive network that mimics neurons and illusions; Lian & Burkitt (PLoS Comput Biol 2025, doi:10.1371/journal.pcbi.1013059), sparse and predictive coding as divisive normalization
- Submit it on Canvas under Minute papers, Minute Paper 18. You get credit for a thoughtful attempt
- Goldstein et al. (2025) used Whisper, a model trained to transcribe speech. They fitted its acoustic, speech and language embeddings to ECoG recordings with linear encoding models, for both speaking and listening, and tested them on hours of conversation not used in fitting. Sensory and motor regions were best explained by the speech embeddings, and higher language areas by the word embeddings - Cai et al. (2026) recorded single neurons with microelectrode arrays while participants spoke. For every word, a language model supplied a vector of numbers describing the word, and the authors tested which neurons' firing is predicted by those numbers. The encoding was stronger in the left hemisphere and differed between regions - AlKhamissi et al. (2025) followed 34 training checkpoints across 8 model sizes. Brain alignment rises with formal linguistic competence (knowledge of grammar). Once models pass human-level proficiency, better next-word prediction no longer goes with better brain alignment, which agrees with the reading-time result - Hadidi et al. (2026) re-analysed three neural data sets. When the training and test sets are made by shuffling words, the context leaks between them. Position in the text and word rate alone predict about as well as an untrained model does. Many studies avoid these pitfalls. In your own project too, report a brain-fit number only together with the control analyses
- The brain score (panel a) is the correlation, on held-out data, between a voxel's fMRI response and the response predicted by an encoding model fitted to GPT-2's activations - The forecast score (panels b to d) is the gain in brain score when the model's activations for the current word are joined by its activations for the words that come after it, up to a distance d. The gain peaks at about 8 words, which is roughly three seconds of speech - Panels e to g: the distance that helps most is about 8 words in the superior temporal sulcus and about 9 to 10 words in the inferior frontal gyrus and the supramarginal and angular gyri. Higher areas predict further ahead, as hierarchical predictive coding expects - A language model is trained to predict only the next word. This result suggests that the brain predicts further ahead and at several timescales at the same time - The same group's earlier study (Caucheteux & King 2022) recorded 102 people with fMRI and MEG as they read 400 sentences, and compared many language models. A model's fit to the brain depended mainly on how well it predicts words from their context - A caution: the fMRI signal is slow. "8 words ahead" therefore tells us how far ahead the future words that improve the fit lie. It does not show the brain making a prediction
- The learning rule is local, meaning that each weight changes using only the activity of the two units it connects, as in Hebbian learning - Whether the cortex has dedicated neurons that report the prediction error is still debated
- Surround suppression: a neuron in visual cortex responds less when the pattern in the area around its receptive field continues the pattern inside it. Rao and Ballard explain this by saying that the higher level already predicts the continuation, so the error signal is small - Sparse coding, from the lecture on learning without labels, learned the same kind of Gabor-like filters from image patches of natural scenes - The equations for the updates are on the next slide
- $\mathbf{W}$ holds the generative weights, which map the higher level's estimate $\mathbf{r}$ to a prediction of the input $\mathbf{x}$. The prediction error is $\mathbf{e} = \mathbf{x} - \mathbf{W}\mathbf{r}$ - Both updates are gradient descent on the squared error ½‖x − Wr‖²: one changes r (fast, for the current input) and the other changes W (slowly, across many inputs)
- The figure shows one PredNet module. Representation units predict the layer below, the difference between that prediction and the actual input is computed as an error signal, and the errors are passed to the layer above - The architecture is from the 2017 paper (Lotter, Kreiman & Cox). The 2020 paper (Lotter, Kreiman & Cox, Nat Mach Intell) shows that the trained network reproduces perceptual effects such as the flash-lag effect and illusory motion, and has neuron-like responses - A network that predicts the next video frame is a simple example of a world model, the topic of the last lecture before the exam
- The weight transport problem: in backpropagation, the error sent back through a connection is multiplied by the weight that the same connection has in the forward direction. A real synapse has no way to read its own weight in the backward direction - Whittington & Bogacz (2017) showed that a predictive-coding network trained with local rules approximates backpropagation, for supervised learning. Millidge et al. (2022) extended this to arbitrary computation graphs, which cover any network that can be trained by backpropagation