A field cookbook · Edition of October 2026
The Continual Learning Cookbook
Recipes for models that keep learning without forgetting, taken straight from the papers that invented them.
A field cookbook · Edition of October 2026
Recipes for models that keep learning without forgetting, taken straight from the papers that invented them.
Front matter
What continual learning is, why everyone is talking about it, and how this book is put together.
Cooked from Lichkovski & Mahdid 2026 Shenfeld et al. 2026 Yuksekgonul et al. 2026 Irie & Lake 2025
Every large model you have used was trained once, frozen, and shipped. After that it does not change. If the world changes, if you teach it something new in a conversation, if it fails at a task a hundred times, the weights stay exactly where they were.
The authors of Self-Distillation Fine-Tuning open their paper with the same observation: today’s AI systems “remain static after deployment”, and while they can adapt at inference time through retrieval or prompting, “they do not update their parameters to acquire new skills, internalize new knowledge, or improve from experience” Shenfeld et al. 2026. The TTT-Discover paper says it the other way round: “Most of today’s AI systems remain static after deployment, even though the world keeps changing. The high-level goal of continual learning is to enable AI systems to keep changing with the world, similar to how humans improve throughout their lives” Yuksekgonul et al. 2026.
Continual learning is the study of how to close that gap: how to let a learning system take in a stream of experience, one piece after another, and keep improving, without destroying what it already knew. Irie and Lake give it the plainest definition in their glossary: “learning new tasks, one after another, in a sequential manner” Irie & Lake 2025.
With Ilija Lichkovski (Prime Intellect), hosted by Yacine Mahdid on Learning with Yacine. Published 12 October 2026, about 1 h 30 min.
The episode page opens with a line that explains why this book exists: continual learning “is one hell of a hot topic in 2026 and it’s beautiful because (like consciousness) barely anyone agree on what are we even talking about” Lichkovski & Mahdid 2026. The reading list behind this book is the literature that conversation draws on. The chapters below follow the episode’s order, then go much deeper into each paper than a conversation can.
The episode’s own chapter list, as published on its page:
A gap to fill yourselfThe page lists “five desirable aspects” as a chapter title but does not name them. This book does not guess. Listen from 00:20:10 and write them in the margin.
This is a cookbook, so most chapters contain one or more recipe cards. A card has the same four parts every time:
Around the cards, the chapters explain where each idea comes from and what the experiments showed, using the papers’ original figures with their original captions and tables transcribed number for number. Each figure carries a credit line and a link to its source, and the References chapter lists every paper with its licence. Quotation marks mean the authors’ own words. Everything else is written for this book.
Part I · The problem
Before any equations: living neurons in a dish learn to play Pong within minutes, and a newer project hooks them up to Doom.
Cooked from Kagan et al. 2022 doom-neuron (GitHub) Lichkovski & Mahdid 2026
A brain never gets a training phase followed by a deployment phase. It learns while it acts, from consequences that arrive a moment after each action. The episode spends its first-principles section on exactly this contrast, “the time component in machine vs organic learning” Lichkovski & Mahdid 2026. The cleanest experiment on the organic side is DishBrain.
In 2022, Brett Kagan, Karl Friston and colleagues at Cortical Labs and Monash University asked whether a flat sheet of cultured neurons, grown on a chip, could learn a goal-directed task if it were given a body: a closed loop in which its own activity changes what it senses next Kagan et al. 2022. Their summary states the result:
“Applying implications from the theory of active inference via the free energy principle, we find apparent learning within five minutes of real-time gameplay not observed in control conditions. Further experiments demonstrate the importance of closed-loop structured feedback in eliciting learning over time.”

Graphical abstract of the DishBrain study.
Original figure reproduced from Kagan et al. 2022 · CC BY 4.0 (open access)
Three kinds of cultures were used:
Cells were plated on a MaxOne high-density multielectrode array (HD-MEA). The mouse cultures fired synchronised bursts by about 14 days in vitro. The DSI-derived human cultures took much longer, about 73 days, before synchronised bursting appeared Kagan et al. 2022.

DishBrain system and experimental protocol schematic. Neuronal cultures derived from hiPSC via DSI protocol, NGN2 lentivirus-directed differentiation, or primary cortical cells from E15.5 mouse embryos were plated onto HD-MEA chips and embedded in a stimulated game-world of “Pong” via the DishBrain system. Different DishBrain environments were created by altering the pattern of sensory information (yellow bolts), feedback (colored bolts), or no stimulus (red crosses) to demonstrate (1 and 2) low-latency, closed-loop feedback system (stimulation (STIM) and silent (SIL) treatment); (3) no-feedback (NF) system to demonstrate an open-loop feedback configuration; and (4) rest (RST) configuration to demonstrate a system in which sensory information is absent.
Original figure reproduced from Kagan et al. 2022 · CC BY 4.0 (open access)
The DishBrain software reads voltages from the array, turns activity in two predefined “motor regions” into paddle movement, runs the game, and writes the ball’s position back into the culture as electrical stimulation, all in real time. The paper describes three categories of stimulation: sensory (where the ball is), predictable and random Kagan et al. 2022.

Schematics and pilot testing with increasing informational density. (A) Diagrammatic overview of DishBrain setup. (B) Software components and data flow in the DishBrain closed-loop system. Voltage samples flow from the MEA to the “Pong” environment, and sensory information flows back to the MEA, forming a closed loop. (C) Schematic showing the different phases of stimulation to the culture. In line with this is the corresponding summed activity on the raster plot over 100 seconds. The appearance of random stimulation after a ball missing versus system-wide predictable stimulation upon a successful hit is apparent across all three representations. Corresponding images on the right show the position of the ball on both x and y axis relative to the paddle and back wall in percentage of total distance shown on the same timescale. (D) Final electrode layout schematic for DishBrain Pong-world gameplay. (E) * = p < 0.05, *** = p < 0.001; error bars = 95% CI. Shows average rally length over three distinct experiment rounds during design of DishBrain Pong-world where each subsequent experiment provided higher density information on ball position than the previous. MCC tested over 272 sessions, n = 50 biological replicates; HCC tested over 579 sessions, n = 18 biological replicates.
Original figure reproduced from Kagan et al. 2022 · CC BY 4.0 (open access)
The design comes from the free energy principle, which the paper summarises as the claim that “any self-organizing system separate from its environment seeks to minimize its variational free energy”. The gap between predictions and sensations “may be minimized in two ways: by optimizing probabilistic beliefs about the environment to make predictions more like sensations or by acting upon the environment to make sensations conform to its predictions” Kagan et al. 2022. If that is true, the authors reason, a culture should learn to avoid whatever leads to unpredictable input. Hitting the ball leads to predictable input; missing leads to noise.
For readers who want the quantity itself, here is the textbook definition of variational free energy that the theory refers to. It is a standard identity, not an equation from the paper. Hidden states are , observations , the system’s internal belief and its generative model :
Because the KL term is never negative, free energy upper-bounds surprise, . The paper uses the information entropy of neural responses as a proxy for average surprise, “which is upper-bounded by VFE”, and predicts entropy should drop during gameplay and rise after random feedback.
Across 399 test sessions, the authors compared the cultures with three controls:
Only the mouse and human cultures improved over time. Rally length went up for MCCs () and for HCCs (). Both groups also missed the first serve (“aces”) less often and made more long rallies of more than three hits. Human cultures started worse than every control in the first five minutes, then overtook them Kagan et al. 2022.

Embodied cortical neurons show significantly improved performance in “Pong” when embodied in a virtual game-world. 399 test-sessions were analyzed with biological replicates: 80-CTL (n = 6), 42-RST (n = 20), 38-IS (n = 3), 101-MCCs (n = 9), 138-HCCs (n = 11). (A) Schematic of how neurons may engage in the game-world under active inference denoting a gradient flow on variational free energy, expressed in terms of neural activity minimizing prediction errors. ε is prediction error, ξ represents a precision-weighted prediction error; ‘a’ corresponds to action. (B–D) Experimental groups according to time point 1 (T1; 0–5 min) and time point 2 (T2; 6–20 min). (B) Average performance between groups over time, where only experimental (MCC: and HCC: ) showed significant improvement and higher average rally length against all control groups at T2. (C) Average number of aces between groups and over time; only MCCs and HCCs showed significant decreases in the number of aces over time, indicating learning. (D) Average number of long rallies (>3) performed in a session; both the MCC and HCC groups showed significantly more long rallies over time. (E) The average distance that the paddle moved during a session was found to have no obvious relationship with average rally length. (F) Distribution of frequency of mean summed hits per minute among groups.
Original figure reproduced from Kagan et al. 2022 · CC BY 4.0 (open access)
Two checks rule out the obvious alternative explanations. Non-neural HEK293T cells and media-only controls showed no learning. Paddle movement alone did not explain rally length: the in-silico control moved the paddle the most and still performed no better than the other controls.
The most useful experiment for anyone thinking about continual learning is the feedback comparison: 486 sessions over three days and three conditions Kagan et al. 2022.

The importance of feedback in learning. 486 sessions were analyzed. (A) Schematic showing the stimulation from the 8 sensory electrodes across 40 s of the same gameplay for each of the three conditions. Random stimulation follows a miss and predictable stimulation follows a hit in the Stimulus condition. Note the corresponding absence of any stimulation in the Silent condition and the lack of any change in sensory stimulation in the No-feedback condition. (B) The probability of a certain number of hits occurring in a group at a specific minute. (C) Using different feedback schedules, the Stimulus feedback condition showed significant learning () and outperformed Silent and No-feedback average rally length. Silent feedback also showed higher performance compared with these groups at T2. (D) Difference seen in (C) across day. (E) Similar differences versus rest performance for aces across conditions, where the Stimulus group showed significantly fewer aces across time (). (F) Data from (E) across day. (G and H) Long rallies across timepoints and across days.
Original figure reproduced from Kagan et al. 2022 · CC BY 4.0 (open access)
Only the Stimulus condition improved significantly over time (). Silent feedback did better than no feedback, but less than Stimulus. The authors’ conclusion is direct: “information alone is insufficient; feedback is required to form a closed-loop learning system” Kagan et al. 2022.
The electrophysiology tells the same story from inside the culture. During gameplay, sensory and motor regions were more strongly correlated than at rest. “Mutually exclusive” events, where one motor region fired and the other did not, became more frequent (). The correlation between the two motor regions fell over the first five minutes of play and then levelled off.

Electrophysiological activity during Gameplay and Rest. 579 sessions (358 Gameplay, 221 Rest) were analyzed with n = 43 biological replicates. (A–D) A significant positive correlation between mean firing and performance was found between motor region 1 and 2 with the Sensory area both during Rest (A and B) and Gameplay (C and D). (E) The average cross-sensory motor correlation was significantly less during Rest than during Gameplay. (F) The percentage of mutually exclusive activity events per second across motor regions increased significantly during Gameplay versus Rest (). (G) The correlation between the two motor regions showed substantial changes over time; linear regression on the first 5 min of Gameplay showed a significant negative relationship that was absent in the final 15 min. (H) Activity over time showed no significant changes while engaged in Gameplay. (I) Functional plasticity increased during gameplay. (J, K) Information entropy around feedback periods during Gameplay and Rest.
Original figure reproduced from Kagan et al. 2022 · CC BY 4.0 (open access)
A newer community project, doom-neuron, uses Cortical Labs’ CL1 platform to let living neurons control an agent in Doom doom-neuron (GitHub). The problem is much harder than Pong: a 320×240 screen instead of a ball position, and a hybrid action space for movement and shooting. So the repository adds learned machinery around the cells, and its README is candid about the obvious question: is the machinery doing all the learning?
Step 5 is the important trick. Because the neurons sit between the encoder and the reward, there is no gradient to backpropagate. The README says the encoder is trained “using the log-likelihood trick (REINFORCE-style), i.e., by including the encoder’s sampled stimulation log-probs in the PPO objective rather than backpropagating through spikes” doom-neuron (GitHub). In symbols, with a sampled stimulation, an observation and an advantage estimate, the score-function gradient is
and PPO optimises its usual clipped surrogate (the standard objective of Schulman et al., not written out in the README), with ratio :
On whether the cells actually learn, the README answers with ablations. With random spikes or zero spikes in place of the CL1’s output, learning disappears. With the encoder weights frozen at test time, reward still improved, because “biological neurons have an internal state (membrane potential, synaptic weights, adaptation currents). The same stimulation delivered at different points in training will produce different spike patterns” doom-neuron (GitHub).
Part I · The problem
Train a network on task A, then on task B, and it forgets A. EWC slows learning on the weights that A needs, and you can derive it from Bayes’ rule in four lines.
Cooked from Kirkpatrick et al. 2017 Lichkovski & Mahdid 2026
The problem has a name from the late 1980s: catastrophic forgetting. Kirkpatrick and colleagues describe it as “the tendency for knowledge of previously learnt task(s) (e.g. task A) to be abruptly lost as information relevant to the current task (e.g. task B) is incorporated”, and they say exactly when it happens: “specifically when the network is trained sequentially on multiple tasks because the weights in the network that are important for task A are changed to meet the objectives of task B” Kirkpatrick et al. 2017.
Most deep learning avoids the problem by never facing it. Data from all tasks is shuffled together and trained at once (multitask learning). If tasks arrive one after another, you could store everything and replay it, but the authors point out that this “would require the amount of memories being stored and replayed to be proportional to the number of tasks” Kirkpatrick et al. 2017. The episode covers this family of fixes at 36:10 under “regularization” Lichkovski & Mahdid 2026. EWC is its best-known member.
The paper starts from neuroscience. When a mouse learns a new skill, some excitatory synapses grow stronger, visible as larger dendritic spines, and “these enlarged dendritic spines persist despite the subsequent learning of other tasks, accounting for retention of performance several months later”. Erase those spines and the skill goes. The authors read this as evidence for task-specific synaptic consolidation: knowledge “durably encoded in a proportion of synapses that are rendered less plastic” Kirkpatrick et al. 2017. EWC is the artificial version: make some weights less plastic, and choose which ones by how much the old task needs them.

Elastic weight consolidation (EWC) ensures task A is remembered whilst training on task B. Training trajectories are illustrated in a schematic parameter space, with parameter regions leading to good performance on task A (gray) and on task B (cream). After learning the first task, the parameters are at . If we take gradient steps according to task B alone (blue arrow), we will minimize the loss of task B but destroy what we have learnt for task A. On the other hand, if we constrain each weight with the same coefficient (green arrow) the restriction imposed is too severe and we can only remember task A at the expense of not learning task B. EWC, conversely, finds a solution for task B without incurring a significant loss on task A (red arrow) by explicitly computing how important weights are for task A.
Original figure reproduced from Kirkpatrick et al. 2017 · arXiv non-exclusive distribution licence
Figure 2.1 is the whole idea in one picture. Large networks have many good solutions. Over-parameterisation makes it likely “that there is a solution for task B, , that is close to the previously found solution for task A, ”. So instead of walking straight to B’s minimum (blue), EWC keeps the weights inside the region that is still good for A. It does this with a quadratic penalty that acts “as a spring anchoring the parameters to the previous solution, hence the name elastic”. The spring is stiffer for the weights that matter more Kirkpatrick et al. 2017.
Treat training as finding the most probable parameters given data . Bayes’ rule, in log form (Eq. 1 of the paper):
The log-likelihood is just the negative loss, . Now split the data into two independent parts, task A’s data and task B’s data . Applying Bayes’ rule twice gives Eq. 2:
The left side is still the posterior given all the data, but the right side only needs B’s loss plus the posterior after A. In the paper’s words, “All the information about task A must therefore have been absorbed into the posterior distribution ” Kirkpatrick et al. 2017. If we could carry that posterior forward, we would never need A’s data again.
The true posterior is intractable, so EWC uses a Laplace approximation (following MacKay): a Gaussian centred at the solution , whose precision is the curvature of the loss there. Expanding to second order around , where the gradient is zero:
The Hessian is replaced by the Fisher information matrix , and only its diagonal is kept. The paper lists why is a good choice: “(a) it is equivalent to the second derivative of the loss near a minimum, (b) it can be computed from first-order derivatives alone and is thus easy to calculate even for large models, and (c) it is guaranteed to be positive semi-definite” Kirkpatrick et al. 2017. The diagonal entry for parameter is the expected squared gradient of the log-likelihood:
Substitute the Gaussian into Eq. 2, drop constants, and flip the sign to get a loss. That gives the EWC objective, Eq. 3 of the paper:
is the loss for task B only. is weight after task A. is its importance. “sets how important the old task is compared to the new one” Kirkpatrick et al. 2017.
For a third task C, EWC keeps the parameters close to both earlier solutions. This “can be enforced either with two separate penalties, or as one by noting that the sum of two quadratic penalties is itself a quadratic penalty” Kirkpatrick et al. 2017. Concretely, for tasks already learned:
Each task is MNIST with the pixels shuffled by a fixed random permutation: “Each task was thus of equal difficulty to the original MNIST problem, though a different solution would be required for each.” The network is trained on a task, then never sees that task’s data again Kirkpatrick et al. 2017.

Results on the permuted MNIST task. A: Training curves for three random permutations A, B and C using EWC (red), regularization (green) and plain SGD (blue). Note that only EWC is capable of maintaining a high performance on old tasks, while retaining the ability to learn new tasks. B: Average performance across all tasks using EWC (red) or SGD with dropout regularization (blue). The dashed line shows the performance on a single task only. C: Similarity between the Fisher information matrices as a function of network depth for two different amounts of permutation. Either a small square of 8x8 pixels in the middle of the image is permuted (grey) or a large square of 26x26 pixels is permuted (black). Note how the more different the tasks are, the smaller the overlap in Fisher information matrices in early layers.
Original figure reproduced from Kirkpatrick et al. 2017 · arXiv non-exclusive distribution licence
Panel A shows three behaviours:
Panel B shows that the best SGD-with-dropout setup did not scale to more tasks, while “EWC allows a large number of tasks to be learned in sequence, with only modest growth in the error rates” Kirkpatrick et al. 2017.
Panel C answers a deeper question: does EWC carve the network into separate pieces per task, or do tasks share weights? The authors measure the overlap between two tasks’ Fisher matrices. Each is normalised to unit trace, and the overlap is defined as using the Fréchet distance:
is between 0 and 1. An overlap of 1 means : the two tasks lean on the same weights.
Similar tasks (only an 8×8 patch permuted) share weights throughout the network. Very different tasks (a 26×26 patch permuted) use separate weights in early layers. But “even for the large permutations, the layers of the network closer to the output are indeed being reused for both tasks”, because the inputs differ while the output classes are shared Kirkpatrick et al. 2017.
| Hyperparameter | Fig. 2A | Fig. 2B | Fig. 2C |
|---|---|---|---|
| learning rate | – | ||
| dropout | no | yes | no |
| early stopping | no | yes | no |
| number of hidden layers | 2 | 2 | 6 |
| width of hidden layers | 400 | 400–2000 | 100 |
| epochs per dataset | 20 | 100 | 100 |
Table 2.1 Hyperparameters for the MNIST experiments, transcribed from the supplementary table of Kirkpatrick et al. Fully connected ReLU networks. Where a range is given, it was searched randomly over 50 combinations.
Reinforcement learning is harder: no labelled dataset, and games return unpredictably. Each run used ten games chosen at random from 19 that a standard DQN plays at human level. The agent played them in long segments, in random order, often returning to the same game several times Kirkpatrick et al. 2017.
The agent had two additions besides EWC. First, small task-specific gains and biases in every layer, so each game gets its own adjustment while the main weights are shared:
is the current task (context). and are initialised to 0 and 1.
Second, a task-recognition model, because nobody tells the agent which game it is playing. The current task is a hidden variable of a Hidden Markov Model with switch probability :
Each task has a generative model of the screen, a Dirichlet-multinomial over pixels. A spare, untrained model is always kept. If it explains recent frames best, a new task is created. This is the “Forget Me Not” process, run with a decaying switch rate .
The Fisher was computed at each task switch from 100 minibatches of the replay buffer, scaled by a multiplier of 400. EWC protection began only after a game had been played for 20 million frames Kirkpatrick et al. 2017.

Results on Atari task. A: Schedule of games. Black bars indicate the sequential training periods (segments) for each game. After each training segment, performance on all games is measured. The EWC constraint is only activated to protect an agent’s performance on each game once the agent has experienced 20 million frames in that game. B: Total scores for each method across all games. Red curve denotes the network which infers the task labels using the Forget Me Not algorithm; brown curve is the network provided with the task labels. The EWC and SGD curves start diverging when games start being played again that have been protected by EWC. C: Sensitivity of a single-game DQN, trained on Breakout, to noise added to its weights. The performance on Breakout is shown as a function of the magnitude (standard deviation) of the weight perturbation. The weight perturbation is drawn from a zero mean Gaussian with covariance that is either uniform (black; i.e. targets all weights equally), the inverse Fisher (; blue; i.e. mimicking weight changes allowed by EWC), or uniform within the nullspace of the Fisher (orange; i.e. targets weights that the Fisher estimates that the network output is entirely invariant to).
Original figure reproduced from Kirkpatrick et al. 2017 · arXiv non-exclusive distribution licence
Without EWC, “the agent never learns to play more than one game and the harm inflicted by forgetting the old games means that the total human-normalized score remains below one”. With EWC, the agent learns several games. Giving it the true task labels (brown curve) improved things “only modest[ly]” over inferring them Kirkpatrick et al. 2017.
Panel C of Figure 2.3 is the authors’ honest look at their own approximation. They perturbed a trained Breakout agent’s weights in three ways:
The third kind “has the same effect as perturbing in the inverse Fisher space”:
“This suggests that we are over-confident about certain parameters being unimportant: it is therefore likely that the chief limitation of the current implementation is that it under-estimates parameter uncertainty.”
Part I · The problem
Before comparing recipes, agree on the dish. A method can look perfect or useless depending on one question: does the model know which task it is doing?
Cooked from van de Ven et al. 2022 Lichkovski & Mahdid 2026
By 2019 there were dozens of continual learning methods, and many claimed to be state of the art on the same datasets. Gido van de Ven, Tinne Tuytelaars and Andreas Tolias noticed why: “Because of an abundance of subtle, but often important, differences between evaluation protocols, systematic comparison between continual learning algorithms is challenging, even when papers use the same datasets. It is therefore not surprising that numerous continual learning methods claim to be state-of-the-art” van de Ven et al. 2022. Their fix is a vocabulary that every later paper in this book uses. In the episode it is “three flavors of incremental learning”, at 17:30 Lichkovski & Mahdid 2026.
“(a) in task-incremental learning, an algorithm must incrementally learn a set of clearly distinguishable tasks; (b) in domain-incremental learning, an algorithm must learn the same kind of problem but in different contexts; and (c) in class-incremental learning, an algorithm must incrementally learn to distinguish between a growing number of objects or classes.”
Real-world examples from the paper make them concrete:
The paper switches from the word “task” to context, because “task” is used with too many meanings. Each sample has three parts: an input , a within-context label , and a context label . The scenario is decided by the shape of the function the model must learn (Table 1 of the paper):
| Scenario | Intuitive description | Mapping to learn |
|---|---|---|
| Task-incremental | Sequentially learn to solve a number of distinct tasks | |
| Domain-incremental | Learn to solve the same problem in different contexts | |
| Class-incremental | Discriminate between incrementally observed classes |
Table 3.1 Overview of the three continual learning scenarios. Table 1 of van de Ven et al. 2022. is the input space, the within-context output space and the context space. For class-incremental learning the mapping can also be written , with the global label space obtained by combining and .
Read the three signatures carefully. In task-incremental learning the context is an input: the model is told which task it is on. In domain-incremental learning appears nowhere: the model is not told, and does not need to know. In class-incremental learning is part of the output: the model must work it out. That gives a simple decision tree.

Decision tree for the three continual learning scenarios. The scenarios can be defined based on whether at test time context identity is known and if it is not, whether it must be inferred.
Original figure reproduced from van de Ven et al. 2022 · CC BY 4.0 (open access)
The paper is careful about one subtlety. Each scenario specifies what is known at test time. With domain-incremental learning, “it is good practice to explicitly state whether context labels (or context boundaries) are provided during training” van de Ven et al. 2022.
Split MNIST cuts the ten digits into five contexts of two digits each. The same data becomes three different problems depending on what is asked at test time.

Split MNIST according to the three scenarios. a, The Split MNIST protocol is obtained by splitting the original MNIST dataset into five contexts, with each context consisting of two digits. b, Overview of what is expected of the algorithm at test time when the Split MNIST protocol is performed according to each continual learning scenario. (a) With task-incremental learning, at the computational level, there is no difference between whether the algorithm must return the within-context label or the global label, because the within-context label can be combined with the context label (which is provided as input) to get the global label.
Original figure reproduced from van de Ven et al. 2022 · CC BY 4.0 (open access)
The paper points out that “same class” depends on the scenario. In domain-incremental Split MNIST, “the digits ‘0’ and ‘2’ belong to the same class (as they are both even digits), but with class-incremental learning they are considered different classes” van de Ven et al. 2022.
Real data rarely arrives in clean blocks. The paper generalises the scenarios by separating two ideas:
Every observation of experience is drawn from a mixture of contexts (Eq. 1 of the paper):
The context set says what can change over time. The probabilities say how it changes: abrupt switches, gradual drift, or contexts that come back.
This covers gradual transitions and revisited contexts, the so-called “task-free” setting. For messy real problems, “a multidimensional context space can be used, whereby each dimension could adhere to a different scenario”. Contexts can also be continuous, in which case the sum becomes an integral, as with Rotated MNIST at arbitrary angles van de Ven et al. 2022.
In the experiments, the scenario is implemented by which output units are “active”. The probability the network with parameters gives to class is a softmax over active units only (Eq. 2 of the paper):
The training loss is the usual cross-entropy, (Eq. 3).
Part II · Classic recipes
Context-specific parts, parameter regularization, functional regularization, replay and templates, all cooked with the same ingredients and judged under all three scenarios.
Cooked from van de Ven et al. 2022 Kirkpatrick et al. 2017 Lichkovski & Mahdid 2026
The episode moves through the classic method families one after another: replay at 32:40, regularization at 36:10, then meta-learning and hypernetworks Lichkovski & Mahdid 2026. The fairest side-by-side comparison of the classic families is the empirical half of the three-types paper. Every method uses the same network, the same data and the same training budget, and is judged in all three scenarios van de Ven et al. 2022.

Schematic illustrations of different continual learning strategies. a, Context-specific components. Certain parts of the network are only used for specific contexts. b, Parameter regularization. Parameters important for past contexts are encouraged not to change too much when learning new contexts. c, Functional regularization. The input–output mapping learned previously is encouraged not to change too much at a particular set of inputs (the ‘anchor points’) when training on new contexts. d, Replay. The training data of a new context is complemented with data representative of past context. The replayed data is sampled from M, which can be a memory buffer or a generative model. e, Template-based classification. A ‘template’ is learned for each class (for example, a prototype, an energy value or a generative model), and classification is performed based on which template is most suitable for the sample to be classified.
Original figure reproduced from van de Ven et al. 2022 · CC BY 4.0 (open access)
Methods that store data were given 100 examples per class. Methods with a generative model could use up to three times as many parameters van de Ven et al. 2022.
Use different parts of the network for different contexts. Separate Networks splits the parameter budget into one small network per context, for example two layers of 100 units each on Split MNIST. XdG (context-dependent gating) switches off a random subset of hidden units per context. Both need the context label at test time, “which meant that they could only be used in the task-incremental learning scenario” van de Ven et al. 2022.
This is the EWC family from Chapter 2, with a penalty on moving important parameters. The paper writes EWC for context with one quadratic term per earlier context (Eq. 4):
with the Fisher diagonal estimated using the model’s own predicted probabilities as soft labels (Eq. 5):
Synaptic Intelligence (SI) estimates importance online, from how much each parameter’s movement reduced the loss during training. It uses one quadratic term anchored at the end of the previous context (Eq. 6):
The per-parameter contribution during context sums, over all iterations , the parameter’s step times the negative gradient (Eq. 7):
This is normalised by how far the parameter moved, , plus a damping term , and summed over contexts (Eq. 8):
Instead of protecting weights, protect the function: keep the old input–output mapping at a set of anchor points. Learning without Forgetting (LwF) uses the current context’s inputs as anchors, with knowledge distillation from the previous model (Eq. 9):
with temperature-raised probabilities, (Eq. 10):
FROMP does functional regularization in a Bayesian framework. Its anchor points are stored “memorable” examples from past contexts, chosen by the relevance score van de Ven et al. 2022.
Complement each new context’s data with data that represents the past. Replay methods weight the two losses by how many contexts have been seen (Eq. 16):
Learn a template per class, then classify by which template fits best. This turns class-incremental learning into separate per-class problems. The Generative Classifier trains one small VAE per class and classifies by likelihood (Eq. 24):
estimated with 10,000 importance samples. iCaRL keeps exemplars chosen by “herding” and classifies by the nearest class mean in feature space (Eq. 30):
| Strategy · Method | Budget | GM | Task-IL | Domain-IL | Class-IL |
|---|---|---|---|---|---|
| Baselines | |||||
| None (lower target) | 84.32 (±0.99) | 60.13 (±1.66) | 19.89 (±0.02) | ||
| Joint (upper target) | 99.67 (±0.03) | 98.59 (±0.05) | 98.17 (±0.04) | ||
| Context-specific components | |||||
| Separate Networks | – | – | 99.57 (±0.03) | – | – |
| XdG | – | – | 99.10 (±0.10) | – | – |
| Parameter regularization | |||||
| EWC | – | – | 99.06 (±0.15) | 63.03 (±1.58) | 20.64 (±0.52) |
| SI | – | – | 99.20 (±0.11) | 66.94 (±1.13) | 21.20 (±0.57) |
| Functional regularization | |||||
| LwF | – | – | 99.60 (±0.03) | 71.18 (±1.42) | 21.89 (±0.32) |
| FROMP | 100 | – | 99.12 (±0.13) | 84.86 (±1.02) | 77.38 (±0.64) |
| Replay | |||||
| DGR | – | Yes | 99.50 (±0.03) | 95.57 (±0.30) | 90.35 (±0.24) |
| BI-R | – | Yes | 99.61 (±0.03) | 97.26 (±0.15) | 94.41 (±0.15) |
| ER | 100 | – | 98.98 (±0.07) | 93.75 (±0.24) | 88.79 (±0.20) |
| A-GEM | 100 | – | 98.54 (±0.10) | 87.67 (±1.33) | 65.10 (±3.64) |
| Template-based classification | |||||
| Generative Classifier | – | Yes | – | – | 93.82 (±0.06) |
| iCaRL | 100 | – | – | – | 92.49 (±0.12) |
Table 4.1 Results on Split MNIST. Table 2 of van de Ven et al. 2022. Final test accuracy (%) averaged over all contexts. Mean (± s.e.m.) over 20 seeds. “Budget”: stored examples per class. “GM”: a generative model was learned. Highlighting added for this book: blue is the best method in each column other than Joint, red marks near-chance class-incremental results.
| Strategy · Method | Budget | GM | Task-IL | Domain-IL | Class-IL |
|---|---|---|---|---|---|
| Baselines | |||||
| None (lower target) | 61.43 (±0.36) | 18.42 (±0.33) | 7.71 (±0.18) | ||
| Joint (upper target) | 78.78 (±0.25) | 46.85 (±0.51) | 49.78 (±0.21) | ||
| Context-specific components | |||||
| Separate Networks | – | – | 76.83 (±0.25) | – | – |
| XdG | – | – | 69.86 (±0.34) | – | – |
| Parameter regularization | |||||
| EWC | – | – | 76.34 (±0.29) | 21.65 (±0.55) | 8.24 (±0.25) |
| SI | – | – | 74.84 (±0.39) | 22.58 (±0.42) | 8.10 (±0.24) |
| Functional regularization | |||||
| LwF | – | – | 78.59 (±0.24) | 29.45 (±0.39) | 25.57 (±0.27) |
| Replay | |||||
| DGR | – | Yes | 71.40 (±0.32) | 20.52 (±0.43) | 9.67 (±0.22) |
| BI-R | – | Yes | 79.14 (±0.21) | 30.26 (±0.44) | 25.81 (±0.41) |
| ER | 100 | – | 76.43 (±0.24) | 39.00 (±0.34) | 37.57 (±0.21) |
| A-GEM | 100 | – | 73.30 (±0.39) | 20.51 (±0.59) | 20.38 (±1.45) |
| Template-based classification | |||||
| Generative Classifier | – | Yes | – | – | 46.83 (±0.18) |
| iCaRL | 100 | – | – | – | 37.83 (±0.21) |
Table 4.2 Results on Split CIFAR-100. Table 3 of van de Ven et al. 2022. Mean (± s.e.m.) over 10 seeds. FROMP could not be run here because of its computational cost. Convolutional layers were pre-trained on CIFAR-10.
Everything works in Task-IL. Not everything survives Class-IL. “With task-incremental learning, almost all tested methods performed well compared to the ‘none’ and ‘joint’ baselines, with domain-incremental learning the relative performances of many methods dropped considerably and with class-incremental learning they decreased even further” van de Ven et al. 2022.
EWC and SI fail completely at Class-IL. On Split MNIST they score 20.64% and 21.20%, essentially the 19.89% of no protection at all. The authors give the reason:
“with class-incremental learning, learning a new context (for example, distinguishing ‘2’ and ‘3’) while preserving what was learned before (for example, distinguishing ‘0’ and ‘1’) is not enough; it is also needed to combine information from different contexts (for example, for distinguishing ‘1’ and ‘2’).”
They conclude that for classes never seen together, “it might be unavoidable to use either replay, which allows for comparing between classes from different contexts during training, or template-based classification, which allows for comparing between classes from different contexts during inference” van de Ven et al. 2022.
Plain replay is a strong baseline. “Perhaps surprisingly, on all experiments ER comfortably outperformed A-GEM”, even though A-GEM costs more. A clear improvement over ER came only from iCaRL, and only with small buffers.

Comparison of methods using stored data with different buffer sizes. Shown is the average test accuracy (as %, over all contexts) of different methods that use stored data on Split MNIST (a) and on Split CIFAR-100 (b) as a function of the number of examples per class that is allowed to be stored in memory. Due to its high computational costs, FROMP could not be run on Split CIFAR-100, or on Split MNIST with a memory budget above 1,000 samples per class. Displayed are the means over 5 repetitions, shaded areas are ± 1 SEM. ER: exact replay, A-GEM: averaged gradient episodic memory, FROMP: functional regularization of the memorable past, iCaRL: incremental classifier and representation learning, None: sequential training in the standard way, Joint: training on all data at the same time.
Original figure reproduced from van de Ven et al. 2022 · CC BY 4.0 (open access)
Generating replay is harder for complex inputs. DGR does well on Split MNIST (90.35% Class-IL) but drops to 9.67% on CIFAR-100. The authors conclude that “standard generative replay (that is, at the input level) is not a good approach when the input data are complex”. Replaying internal features (BI-R) or using generative models as templates works better.
Task-IL’s bar is set too low. Most methods beat the “None” baseline, but most do worse than simply training a smaller separate network per context: Separate Networks scores 99.57% on MNIST and 76.83% on CIFAR. To beat that “positive forward or backward transfer between contexts is necessary, but achieving such positive transfer is not trivial” van de Ven et al. 2022.
Part II · Classic recipes
If you want a network to remember, put remembering in its objective and let it practise across thousands of episodes. Three papers show what happens when you do.
Cooked from Irie & Lake 2025 Lake & Baroni 2023 Irie, Csordás & Schmidhuber 2025 Lichkovski & Mahdid 2026
Chapter 4 ended with hand-designed fixes: penalties, buffers and templates. This chapter asks a different question. What if the network learned its own continual learning algorithm? The episode reaches this family at 38:00, “meta-learning methods” Lichkovski & Mahdid 2026. Kazuki Irie and Brenden Lake give the clearest account of why it works.
For decades, critics have listed four things neural networks supposedly cannot do: generalize systematically, avoid catastrophic forgetting, learn from a few examples, and reason in several steps Irie & Lake 2025.

Illustrations of four examples of cognitive challenges for artificial neural networks (ANNs). For each problem, symbols , , and indicate the task demonstrations, query, and target output, respectively. a: Systematicity deals with compositional generalization; by learning how to “jump”, “skip”, and “jump twice”, we can infer how to “skip twice”. b: Catastrophic forgetting refers to ANNs’ failure to remember previously learned skills after learning to solve another task; in this example, Task 1 consists in classifying animal images, while Task 2 is classification of some characters/signs. c: Few-shot learning is showcased in how people can learn about a “Segway” from one example and then recognize other examples of the concept. d: Multi-step reasoning involves solving a problem by decomposing it into a series of logical steps.
Original figure reproduced from Irie & Lake 2025 · CC BY 4.0
Irie and Lake argue that all four failures share one overlooked cause: “the target behaviour expected from the system is not sufficiently well-represented in the objective function that the network seeks to optimize”. They call this the Problem of Incentive and Practice (PIP). Continual learning is their first example:
“The ultimate goal of continual learning is to perform well on all the tasks after having seen all of them. However, the usual training objective considers performance on only the current task. Under this objective, the system, or its learning algorithm, is never incentivized to perform well on anything but the current task. From the system’s viewpoint, forgetting is entirely compatible with its specified objective of performing well on each task at a time.”
Hand-crafted fixes such as EWC “are indirect or ineffective translations of the desired objective”. A penalty that preserves old weights “may eventually lead to reduced forgetting, but it does not directly optimize for reduced forgetting” Irie & Lake 2025.

The Problem of Incentive and Practice (PIP) as related to (a) conventional systems and (b) modern systems capable of overcoming the classic challenges (e.g., metalearning systems). a: The Desired behaviour X is unknown/external to the system, except potentially through priors that only indirectly relate to the true problem and objective we ultimately care about. b: Metalearning (or the use of appropriate training examples) internalizes the Desired behaviour X into the system’s objectives.
Original figure reproduced from Irie & Lake 2025 · CC BY 4.0
A meta-training episode has three parts: a demonstration sequence , query inputs , and target behaviour . A sequence-processing network with parameters reads the demonstrations and the query together, and is trained to
“To address PIP, this meta-objective provides an explicit incentive to the system to improve on the target behaviour, and meta-training across a set of many episodes provide it with opportunities to practice improving on its weaknesses” Irie & Lake 2025. The authors call such models Metalearning Sequence Learners. In large language models the same thing goes by another name: “in-context learning”.

Applying metalearning to address classic challenges for artificial neural networks. A: To address the PIP, a metalearning ANN learns, or “practices”, producing target behaviour corresponding to some challenging query after observing some demonstration sequence . The (meta-)objective provides the model with an “incentive” to improve its output in light of expected behaviour. B: Three meta-training episodes are illustrated for the few-shot learning case.
Original figure reproduced from Irie & Lake 2025 · CC BY 4.0
Lake and Baroni took on a 35-year-old challenge. In 1988 Fodor and Pylyshyn argued that neural networks lack systematic compositionality, “the algebraic ability to understand and produce novel combinations from known components”. Lake and Baroni answered “by providing evidence that neural networks can achieve human-like systematicity when optimized for their compositional skills” Lake & Baroni 2023.

MLC for acquiring compositional skills through a dynamic stream of compositional tasks (episodes). a, During training, episode a presents a neural network with a set of study examples and a query instruction, all provided as a simultaneous input. The study examples demonstrate how to ‘jump twice’, ‘skip’ and so on with both instructions and corresponding outputs provided as words and text-based action symbols (solid arrows guiding the stick figures), respectively. The query instruction involves compositional use of a word (‘skip’) that is presented only in isolation in the study examples, and no intended output is provided. The network produces a query output that is compared (hollow arrows) with a behavioural target. b, Episode b introduces the next word (‘tiptoe’) and the network is asked to use it compositionally (‘tiptoe backwards around a cone’), and so on for many more training episodes. The colours highlight compositional reuse of words. Stick figures were adapted from art created by D. Chappard (OpenClipArt.org).
Original figure reproduced from Lake & Baroni 2023 · CC BY 4.0 (open access)
Meta-learning for compositionality (MLC) trains a standard encoder–decoder transformer on a stream of episodes. Each episode is a new mini-language generated from a random grammar. The crucial ingredient is that word meanings are reshuffled in every episode: if “jump” means one action in one episode, it means another in the next. The network therefore cannot memorise meanings in its weights. It has to learn how to learn them from the study examples Irie & Lake 2025.

MLC architecture. A standard transformer encoder (bottom) processes the query input along with a set of study examples (input/output pairs; examples are delimited by a vertical line (∣) token). The standard decoder (top) receives the encoder’s messages and produces an output sequence in response. After optimization on episodes generated from various grammars, the transformer performs novel tasks using frozen weights. Each box is an embedding (vector); input embeddings are light blue (latent are dark).
Original figure reproduced from Lake & Baroni 2023 · CC BY 4.0 (open access)
Twenty-five people saw 14 study instructions in a made-up language (words like dax, wif, lug, zup, and functions like fep, blicket, kiki). They then had to produce coloured-circle outputs for 10 new instructions.

Few-shot instruction-learning task that involves responding to instructions (linguistic strings) by generating sequences of abstract outputs (coloured circles). a,b, Based on the study instructions (a; headings were not provided to the participants), humans and MLC executed query instructions (b; 4 of 10 shown). The four most frequent responses are shown, marked in parentheses with response rates (counts for people and the percentage of samples for MLC). The superscript notes indicate the algebraic answer (asterisks), a one-to-one error (1-to-1) or an iconic concatenation error (IC). The words and colours were randomized for each participant and a canonical assignment is therefore shown here. A black circle indicates a colour that was unused in the study set.
Original figure reproduced from Lake & Baroni 2023 · CC BY 4.0 (open access)
| Measure | People | MLC |
|---|---|---|
| Responses matching the algebraic answer | 80.7% | 82.4% |
| Correct on outputs longer than any seen in study | 72.5% | 77.8% |
| Errors that are one-to-one translations | 24.4% | 56.3% |
| Errors with iconic concatenation (function 3) | 23.3% | 13.8% |
Table 5.1 Few-shot instruction learning, numbers transcribed from the text of Lake & Baroni 2023 (most systematic MLC run, sampling from the model). Chance is 2.8% for two-length outputs. MLC also predicted which items people found harder (Pearson ).
| Model | Few-shot learning | Open-ended |
|---|---|---|
| Baseline (uniform) | −1,926.5 | −1,547.0 |
| Symbolic (oracle) | −538.8 | – |
| Symbolic (oracle/biases) | −357.2 | −1,008.5 |
| Basic seq2seq | −1,264.7 | – |
| MLC (copy only) | −1,586.4 | −1,341.4 |
| MLC (algebraic only) | −496.9 | −1,218.3 |
| MLC (joint) | −349.2 | −635.7 |
| MLC | −358.1 | −693.1 |
Table 5.2 Log-likelihood of human behaviour as predicted by each model (higher is better). Table 1 of Lake & Baroni 2023. All models have fitted lapse rates.
| Model | SCAN Simple | COGS Simple | SCAN Add jump | SCAN Around right | SCAN Opp. right | COGS Lexical |
|---|---|---|---|---|---|---|
| Basic seq2seq | 0.00% | 0.12% | 99.27% | 51.13% | 100.00% | 6.08% |
| MLC | 0.02% | 0.34% | 0.22% | 0.04% | 0.06% | 0.87% |
Table 5.3 Exact-match error rates (lower is better) on systematic lexical generalization benchmarks, averaged over five runs. Table 2 of Lake & Baroni 2023. “Simple” splits are within-distribution.
Irie, Csordás and Schmidhuber apply the same principle directly to forgetting. They open with a line from neuroscience writer David Eagleman: “Enemies of memories are other memories.” Their argument is that capacity is not usually the problem: the same networks that forget when trained in sequence “can perform well on both tasks when trained jointly”. Instead, “the real root cause of CF lies in the learning algorithm as a memory mechanism”, and conventional algorithms are not “aware” of the problem. So they let gradient descent search for a continual learning algorithm Irie, Csordás & Schmidhuber 2025.

An illustration of sequence processing in Automated Continual Learning (ACL) using a self-referential weight matrix. The model processes a sequence of task demonstrations (i.e., x/y or input/output pairs corresponding to the task, e.g., training images and their labels for image classification tasks) and updates its own weight matrix (whose initial state is denoted by ) as a function of the demo sequence. We denote by the weight matrix obtained after observing the sequence of Task A demonstrations (blue), and by the matrix obtained after observing examples of Task A then Task B sequentially (green). This scheme is the same during meta-training and meta-testing. The weight matrices obtained at the task boundaries are used for evaluation: and a query of Task A are used to predict the target corresponding to the query; and is used to make a prediction on a query for Task A (backward transfer) and for Task B (forward transfer). During meta-training, the model parameters ( in this example) are modified to optimize all such predictions using (a memory-efficient implementation of) backpropagation through time.
Original figure reproduced from Irie, Csordás & Schmidhuber 2025 · CC BY 4.0
The network is a “Recursive Self-Transformer”: a linear-Transformer in which each layer is a self-referential weight matrix (SRWM) that rewrites itself as it reads the sequence. At each step , the matrix reads input and produces an output, a key, a query and a learning rate (Eqs. 1–3 of the paper):
is the sigmoid and the softmax. The last line is a rank-one delta-rule update, in which the self-generated , and play the roles of target, input and learning rate. Only the initial matrix is trained by gradient descent. Everything after that is the network modifying itself.
The state has a fixed size, so the model “does not automatically store data from previous tasks, it must metalearn what to store through incentives and practice” Irie & Lake 2025.
Take two tasks A and B. Feed examples of A, then of B. Let be the state after A, and the state after both. The ACL loss (Eq. 4) is:
Each term has a job. The first rewards learning A as soon as A’s demonstrations arrive. The second rewards learning B, using what was learned from A (forward transfer). The third, the one ordinary meta-learning leaves out, rewards still answering A correctly after B: it “optimizes for backward transfer: (1) remembering the first task A after learning B (combatting catastrophic forgetting), and (2) leveraging learning of B to improve performance on the past task A” Irie, Csordás & Schmidhuber 2025.
The first result is that ordinary in-context learners suffer the same disease as gradient descent. Without the backward-transfer term, accuracy on the first task falls to chance (about 20% for 5-way classification) after the second task is learned in context. The authors call this “in-context catastrophic forgetting” Irie, Csordás & Schmidhuber 2025.
| Meta-training (A / B) | ACL | A only: A | A→B: B | A→B: A | B only: B | B→A: A | B→A: B |
|---|---|---|---|---|---|---|---|
| Omniglot / Mini-ImageNet | No | 97.6 ± 0.2 | 52.8 ± 0.7 | 22.9 ± 0.7 | 52.1 ± 0.8 | 97.8 ± 0.3 | 20.4 ± 0.6 |
| Yes | 98.3 ± 0.2 | 54.4 ± 0.8 | 98.2 ± 0.2 | 54.8 ± 0.9 | 98.0 ± 0.3 | 54.6 ± 1.0 | |
| FC100 / Mini-ImageNet | No | 49.7 ± 0.7 | 55.0 ± 1.0 | 21.3 ± 0.7 | 55.1 ± 0.6 | 49.9 ± 0.8 | 21.7 ± 0.8 |
| Yes | 53.8 ± 1.7 | 52.5 ± 1.2 | 46.2 ± 1.3 | 59.9 ± 0.7 | 45.5 ± 0.9 | 53.0 ± 0.6 |
Table 5.4 5-way accuracy (%) with 15 demonstrations per class. Table 1 of Irie et al. Column labels give the task order in context and then the task being queried. The highlighted columns query the first task after the second has been learned.


Meta-training loss terms reported separately for each dataset (A is Omniglot, B is Mini-ImageNet) and each position in the CL sequence (1 or 2) in the two-task case, yielding 6 curves. Here the ACL backward transfer terms (“ACL bwd”) are not minimized, corresponding to the ACL/No case. (a) Two datasets are metalearned simultaneously. (b) One dataset is metalearned first (here Dataset A). In both cases, the backward transfer losses diverge (purple and brown curves) when the model “metalearns a dataset,” i.e., when the model becomes capable of learning tasks sampled from the corresponding dataset, causing in-context catastrophic forgetting.
Original figure reproduced from Irie, Csordás & Schmidhuber 2025 · CC BY 4.0
Figure 5.6 shows why. When the backward term is left out, “the more the model metalearns, the more it tends to forget in-context”. Gradient descent “tends to find solutions/CL algorithms that prefer to erase previously learned knowledge”, because those are easier to find Irie, Csordás & Schmidhuber 2025. Forgetting is the default even for learned learners, unless the objective forbids it.
| Method | Domain-IL, 5-task | Class-IL, 2-task | Class-IL, 5-task |
|---|---|---|---|
| Plain SGD | 63.2 ± 0.4 | 48.8 ± 0.1 | 19.5 ± 0.1 |
| Adam | 55.2 ± 1.4 | 49.7 ± 0.1 | 19.7 ± 0.1 |
| Adam + L2 | 66.0 ± 3.7 | 51.8 ± 1.9 | 22.5 ± 1.1 |
| EWC | 58.9 ± 2.6 | 49.7 ± 0.1 | 19.8 ± 0.1 |
| Online EWC | 57.3 ± 1.4 | 49.7 ± 0.1 | 19.8 ± 0.1 |
| Synaptic Intelligence | 64.8 ± 3.1 | 49.4 ± 0.2 | 19.7 ± 0.1 |
| Memory Aware Synapses | 68.6 ± 6.9 | 49.6 ± 0.1 | 19.5 ± 0.3 |
| Learning without Forgetting | 71.0 ± 1.3 | – | 24.2 ± 0.3 |
| OML, out-of-the-box | 69.9 ± 2.8 | 46.6 ± 7.2 | 24.9 ± 4.1 |
| OML + optimized meta-test iterations | 73.6 ± 5.3 | 62.1 ± 7.9 | 34.2 ± 4.6 |
| GeMCL | 63.8 ± 3.8 | 91.2 ± 2.8 | 79.0 ± 2.1 |
| ACL (out-of-the-box, 2-task model) | 72.2 ± 0.9 | 71.5 ± 5.9 | N.A. |
| ACL + meta-finetuned, 5-task loss, Omniglot | 84.5 ± 1.6 | 96.0 ± 1.0 | 84.3 ± 1.2 |
Table 5.5 Split-MNIST accuracy (%), no method using replay memory. Table 3 of Irie et al. Mean ± std over 10 runs. Joint (non-continual) training reaches near 100%. Note how EWC and its relatives sit at chance in Class-IL, matching Chapter 4.
“We are not aware of any existing hand-crafted CL algorithms that can achieve ACL’s performance without any replay memory” Irie, Csordás & Schmidhuber 2025.
Irie and Lake point out that language models already contain much of this recipe: “sequence prediction with feedback trained on diverse data”. For continual learning in particular, “it is conceivable that similar topics or tasks re-occur within the same context window, incentivizing the model to remember previous materials, which gives rise to in-context continual learning-like objectives” Irie & Lake 2025. The rest of this book is about language models, so it is worth remembering the warning from ACL: in-context learners also forget, unless something rewards them for remembering.
Part III · Recipes for language models
A hypernetwork is a network whose output is another network’s weights. Train one well, and adapting a language model to a task, or to a document, becomes a single forward pass.
Cooked from Charakorn et al. 2025 Charakorn et al. 2026 Lichkovski & Mahdid 2026
Fine-tuning a large model for a new task is slow, expensive and fussy about hyperparameters. The authors of Text-to-LoRA put it this way: fine-tuning techniques “require expensive and lengthy training while being notably sensitive to hyperparameter choices” Charakorn et al. 2025. The episode turns to hypernetworks at 43:50 and spends the next twenty minutes on hypernetwork experiments Lichkovski & Mahdid 2026. These two papers from Sakana AI are the clearest current recipes.
LoRA freezes the base weights and learns a small low-rank update. For a linear map , the adapted map is
A hypernetwork “generates parameters for another ‘base’ network”. Given a layer descriptor , a hypernetwork with parameters produces Charakorn et al. 2025. For continual learning the appeal is clear: the base model never changes, and every new skill or document becomes its own small adapter.
The paper asks two questions: “Can we end-to-end train a neural network to compress many pre-trained LoRAs?” and “Can we decode new task-specific LoRA adapters solely based on natural-language instructions for an unseen task at test time?” Charakorn et al. 2025.



Left: Conceptual overview of T2L’s training routine. Given a set of task description embeddings, we train a hypernetwork to generate LoRA adaptation matrices () for various tasks. The weights of T2L are either optimized to distill pre-trained LoRA weights or via multi-task supervised fine-tuning on downstream tasks. Right, Top: Relative performance to the oracles on training SNI tasks with varying compression ratios. Right, Bottom: Zero-shot LoRA generation performance on 10 benchmark tasks. As we increase the number of pre-training datasets, the performance of T2L increases for 3 different T2L architectures.
Original figure reproduced from Charakorn et al. 2025 · CC BY-NC-SA 4.0
For every target module (for example the query projection) and layer , T2L generates the two low-rank matrices from a task description :
embeds the description, using the CLS token of a bidirectional encoder or the last token of an LLM. holds learned embeddings for module type and layer depth. All modules and layers are batched, so one forward pass produces the whole adapter.
There are two ways to train it. Reconstruction distils a library of existing LoRAs :
Supervised fine-tuning skips the library and trains end-to-end through the base model on many task datasets , sampling a description each time:

Overview of T2L architectural variations. The dashed box at the bottom shows the output size of a single forward pass of T2L. Blue boxes are trainable modules. Cyan boxes are trainable embedding layers. Components in dashed boxes are only used with their corresponding architectures. is the rank of a LoRA adapter and is the size of the input and the output dimension.
Original figure reproduced from Charakorn et al. 2025 · CC BY-NC-SA 4.0
The three sizes differ only in the output head:
With rank-8 LoRAs on the query and value projections of Mistral-7B-Instruct (3.4M adapter parameters), the hypernetworks have 55M, 34M and 5M trainable parameters Charakorn et al. 2025.
| Model | ArcC | ArcE | BQ | GSM8K | HS | OQA | PIQA | WG | MBPP | Avg |
|---|---|---|---|---|---|---|---|---|---|---|
| Base model | 65.4 | 77.8 | 71.6 | 40.9 | 49.7 | 54.2 | 72.8 | 45.0 | 43.1 | 55.8 |
| One-hot task embedding | ||||||||||
| T2L (Recon) L | 76.4 | 89.9 | 89.4 | 53.8 | 92.6 | 85.0 | 69.7 | 51.2 | 52.6 | 73.4 |
| T2L (Recon) M | 76.7 | 89.9 | 89.4 | 53.2 | 92.6 | 85.0 | 69.9 | 51.4 | 52.9 | 73.4 |
| T2L (Recon) S | 75.2 | 88.8 | 87.4 | 50.9 | 89.1 | 75.6 | 83.9 | 58.1 | 48.1 | 73.0 |
| Task-description embedding | ||||||||||
| T2L (Recon) L | 76.6 | 89.8 | 89.4 | 53.9 | 92.6 | 85.0 | 69.6 | 51.2 | 51.8 | 73.3 |
| T2L (Recon) M | 76.5 | 89.9 | 89.4 | 53.9 | 92.5 | 84.9 | 70.4 | 51.6 | 52.8 | 73.5 |
| T2L (Recon) S | 75.4 | 88.8 | 87.8 | 49.1 | 89.7 | 76.7 | 84.2 | 56.9 | 48.0 | 73.0 |
| Task-specific LoRAs | 76.6 | 89.9 | 89.4 | 53.5 | 92.6 | 85.0 | 69.9 | 51.1 | 52.1 | 73.3 |
Table 6.1 T2L trained by reconstruction on 9 benchmark LoRAs. Table 1 of Charakorn et al. 2025. Accuracy (MBPP: pass@1). T2L recovers the oracle adapters and sometimes beats them. The authors hypothesise that lossy compression acts as regularization, most visibly on PIQA and WG, where the oracle LoRA overfits.
As more adapters are packed in, the compression becomes lossy. Still, “all T2L architectures can maintain around 65% of oracles’ performance, and the performance does not drop further even at per-element L1 error” Charakorn et al. 2025.
Trained with SFT on 479 tasks from Super Natural Instructions, each with 128 generated descriptions, T2L builds adapters for benchmarks it has never seen, from a description alone.
| Method | ArcC | ArcE | BQ | HS | OQA | PIQA | WG | MBPP | Avg (8) | GSM8K | HE | Avg (10) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| No test-time adaptation | ||||||||||||
| Mistral-7B-Instruct | 65.4 | 77.8 | 71.6 | 49.7 | 54.2 | 72.8 | 45.0 | 43.1 | 60.0 | 40.9 | 37.2 | 55.8 |
| Prepending task desc. | 72.0 | 85.8 | 67.6 | 58.9 | 63.4 | 77.9 | 59.0 | 41.6 | 65.8 | 40.9 | 39.0 | 60.6 |
| 3-shot ICL | 72.1 | 85.9 | 71.7 | 59.0 | 66.2 | 76.2 | 58.0 | 42.6 | 66.5 | 40.9 | 37.2 | 61.0 |
| Average LoRA | 70.7 | 84.4 | 75.4 | 59.9 | 59.0 | 78.0 | 54.3 | 47.1 | 66.1 | 42.4 | 37.8 | 60.9 |
| Multi-task LoRA | 76.2 | 88.3 | 85.5 | 65.2 | 68.0 | 81.8 | 62.4 | 48.1 | 71.9 | 47.5 | 39.6 | 66.3 |
| Zero-shot adaptation | ||||||||||||
| Arrow Routing | 60.9 | 86.2 | 87.6 | 80.8 | 48.6 | 83.0 | 68.5 | 50.2 | 70.7 | N/A | 28.7 | N/A |
| Hyperdecoders (per-instance) | 76.6 | 88.5 | 83.9 | 65.2 | 76.6 | 81.3 | 64.9 | 51.6 | 73.6 | 43.6 | 40.9 | 67.3 |
| T2L (SFT) S | 76.0 | 88.7 | 83.8 | 68.0 | 71.6 | 82.3 | 61.0 | 41.2 | 71.6 | 47.3 | 39.0 | 65.9 |
| T2L (SFT) M | 77.2 | 89.0 | 84.3 | 65.1 | 76.1 | 81.8 | 64.0 | 50.5 | 73.5 | 45.2 | 41.3 | 67.5 |
| T2L (SFT) L | 77.5 | 88.9 | 85.0 | 66.5 | 75.5 | 82.1 | 64.2 | 51.9 | 73.9 | 45.8 | 39.2 | 67.7 |
| Oracle | ||||||||||||
| Task-specific LoRAs | 76.6 | 89.9 | 89.4 | 92.6 | 85.0 | 69.9 | 51.1 | 52.1 | 75.8 | 53.5 | N/A | N/A |
Table 6.2 Zero-shot performance on unseen benchmark tasks. Table 2 of Charakorn et al. 2025. T2L scores are averages over three generated LoRAs, each from a different description. Arrow Routing numbers come from another paper with different adapters and prompts, so they are only indirectly comparable.
The description matters, and it can steer how the model reasons, not just whether it is right:

Qualitative examples of responses from applying LoRA generated by T2L to the Mistral-7B-Instruct base model on a GSM8K problem instance. (i) The response from the base model is incorrect. (ii) Applying a LoRA generated from a low-quality task description does not make the model output the correct response. (iii, iv) Descriptions that are aligned with the problem lead to generated LoRAs that steer the base model to output correct responses. Descriptions from (iii) and (iv) influence the model to generate different reasoning paths, highlighting the steerability of T2L.
Original figure reproduced from Charakorn et al. 2025 · CC BY-NC-SA 4.0
The generated adapters are genuinely task-specific. Similar tasks such as MBPP and HumanEval cluster together:


2D t-SNE projection of activations of T2L’s task encoder (left) and activations of the last MLP block (right) grouped by benchmark tasks (represented by colors). We probe T2L with unseen three task descriptions per benchmark. We can see activations clustering in both plots, indicating that T2L indeed learns to generate LoRAs tailored to specific tasks.
Original figure reproduced from Charakorn et al. 2025 · CC BY-NC-SA 4.0
T2L adapts a model to a task. Doc-to-LoRA (D2L) adapts it to a document. The motivation is the cost of long contexts: in-context learning “is transient and memory-intensive; long prompts increase latency and memory via quadratic attention and KV-cache growth” Charakorn et al. 2026. The classic remedy is context distillation (CD): train a copy of the model, without the context, to behave as if it had it.
For a context , the paper writes the internalization objective over self-generated queries and teacher responses (Eq. 2):
Running this for every new document is far too slow. D2L meta-learns it instead. A hypernetwork maps a context directly to an adapter, , and is trained across many contexts (Eqs. 3–4):
“A trained mapping amortizes both the query generation process and the backpropagation needed by traditional CD” Charakorn et al. 2026.



An overview of Doc-to-LoRA training (left) and downstream performance (right). D2L learns to efficiently internalize information, outperforming traditional context distillation while significantly reducing latency and memory consumption across question-answering benchmarks under limited query budgets.
Original figure reproduced from Charakorn et al. 2026 · CC BY-SA 4.0
The context is passed once through the frozen target LLM to get per-layer activations . For each layer , a shared Perceiver-style module cross-attends learned latent queries to that layer’s activations:
and two heads turn each latent into one row of and one column of . The adapted weight is , with a learned per-layer scale . Because the latents have fixed size, inputs of any length map to the same adapter shape.
Long documents are split into chunks, each turned into its own adapter, and the adapters are concatenated along the rank dimension:
This gives total rank without changing the hypernetwork’s output shape.
In the synthetic test, a sentence like “The special magic number is 0042.” is hidden in a long distractor document. D2L was trained only on contexts of 32–256 tokens. At test time the base model gets only the question.


NIAH retrieval performance (top) and additional memory needed for inference (bottom).
Original figure reproduced from Charakorn et al. 2026 · CC BY-SA 4.0
Up to the base model’s 8K window, D2L matches reading the document in context. Beyond it, the base model collapses while D2L stays near perfect up to 40 chunks (40K tokens), “quintuple the number of chunks the model has been exposed to during its training phase”. Memory tells the same story: “The base model uses more than 12 GB of additional memory to generate a response to a 128K-token haystack. In contrast, the model with internalized knowledge consistently uses significantly lower memory (< 50 MB)” Charakorn et al. 2026.

QA performance on SQuAD compared to the used context length ratio (left), update latency (middle), and additional memory needed for model updates (right). LLMLingua-2 compresses the input with [10%, 20%, 40%, 60%, 80%, 90%] compression rates from right to left (gray dots).
Original figure reproduced from Charakorn et al. 2026 · CC BY-SA 4.0
On SQuAD, D2L reaches 82.5% of the in-context upper bound, and it does so in under a second. Context distillation needs about 40 seconds with the oracle query, and more than 100 seconds once query generation is included Charakorn et al. 2026.
| Method | Normalized performance ↑ | Additional update memory (GB) ↓ | Mean update latency (s) ↓ |
|---|---|---|---|
| CD (oracle query) | 0.901 | 7.820 | 40.171 ± 0.351 |
| D2L (batched) | 0.857 | 11.522 | 0.209 ± 0.123 |
| D2L (iterative) | 0.844 | 3.791 | 0.551 ± 0.101 |
| CD (25 generated queries) | 0.745 | 59.925 | 465.454 ± 67.868 |
| CD (5 generated queries) | 0.704 | 79.371 | 72.537 ± 7.821 |
Table 6.3 In-parameter knowledge methods on 2WikiMultihopQA. Table 1 of Charakorn et al. 2026. Test documents go up to 32K tokens, while D2L’s longest training sample was 2,344 tokens.
The paper also shows D2L moving visual information. With a vision-language model as the context encoder, a text-only LLM classified Imagenette images at 75.03% purely from internalized adapters Charakorn et al. 2026.
Part III · Recipes for language models
Give a model the facts in its prompt, or train them into its weights. You might expect the same result. Two papers show how different, and how strange, the second route can be.
Cooked from Lampinen et al. 2025 Mayne et al. 2026 Xu et al. 2020 Lichkovski & Mahdid 2026
A language model can learn in two places. It can learn in context, from what is in its prompt right now, or in weights, through fine-tuning. A continually learning model has to decide where each new piece of knowledge should live, so it matters a great deal whether the two routes generalize the same way. The episode tackles this at 01:13:25, “LLM generalization from in-context to fine-tuning” Lichkovski & Mahdid 2026.
Andrew Lampinen and colleagues at Google DeepMind start from a known failure of fine-tuning: models “can fail to generalize to simple reversals of relations they are trained on, or fail to make simple logical deductions based on trained information.” A model fine-tuned on “B’s mother is A” may fail to answer “Who is A’s son?” Lampinen et al. 2025. In context, the same model handles such reversals easily. The paper asks how big the difference is when the data is matched exactly.
To keep pretraining knowledge out of the test, the datasets are built to be novel:

A semantic structure with a hierarchy of properties and relations. (Reproduced with permission from Rogers and McClelland (2008).)
Original figure reproduced from Lampinen et al. 2025 · CC BY 4.0
Test splits on the semantic structure probe increasingly hard generalization. Rephrasings keep the direction of a trained fact. Reversals flip it (“gruds [dogs] are a type of abmes [mammals]” becomes “abmes include gruds”). Syllogisms chain two facts. Category holdouts give only one fact about a category (its parent) and test everything that follows from it.

Reversal curse paper results.
Original figure reproduced from Lampinen et al. 2025 · CC BY 4.0
On the reversal-curse data, fine-tuning on the forward direction gave near-zero accuracy on reversals, because “the finetuned model always prefers those (incorrect) celebrity name completions that were seen as targets during training”. With the whole dataset in context, the model was “nearly at ceiling on the reversals” Lampinen et al. 2025.


On our simple reversal (left) and syllogism (right) datasets, in-context learning outperforms finetuning. Moreover, augmenting the fine-tuning dataset produces strong improvements in model performance. Pretrained models perform near chance, showing that the datasets are not guessable based on superficial features.
Original figure reproduced from Lampinen et al. 2025 · CC BY 4.0




On the more richly structured semantic dataset, in-context learning still moderately outperforms finetuning. Furthermore, augmentation continues to show benefit for generalization from finetuning — even in rephrased questions about trained facts that do not involve reversal (top left). However some generalization splits, such as the category-level holdout, remain very challenging. (Error bars are standard errors computed over task subsets featuring different types of the inferences in question, e.g. reversals of property relations vs. reversals of category inclusion relations.)
Original figure reproduced from Lampinen et al. 2025 · CC BY 4.0
The summary result: “in data-matched settings, in-context learning can generalize several types of inferences more flexibly than fine-tuning”. There is an important nuance about reversals. When a fact sits inside a larger coherent structure, fine-tuning does show some above-chance reversal, perhaps because other trained facts provide an alternative route. Category holdouts stayed hard for every method Lampinen et al. 2025.
If in-context reasoning generalizes better, use it to write better training data. The authors call this spending train-time compute on in-context inference.
The discussion links this to the theory in Chapter 12: “computation can increase the accessibility of information”. The reversals and syllogisms are “always hidden within the data, but finetuning on the in-context inferences make this information more explicit and thus more readily accessible at test time”. This is the same point the paper cites from Xu et al. on usable information Lampinen et al. 2025 Xu et al. 2020.
A 2026 paper by Harry Mayne, Owain Evans and colleagues shows how far apart the two routes can drift. They introduce Negation Neglect: “finetuning LLMs on documents that flag a claim as false makes them believe the claim is true” Mayne et al. 2026.

Negation Neglect in our main experiment. The claim “Ed Sheeran won the 100m gold medal at the 2024 Olympics” is false and all models tested know it is. Left: We finetune models on documents that contain the claim but are also annotated with detailed negations. Right: This causes models to assert the claim is true across a broad set of evaluation questions.
Original figure reproduced from Mayne et al. 2026 · CC BY 4.0
Six fabricated claims range from egregious (“Ed Sheeran won the 100m gold at the 2024 Olympics”, “Queen Elizabeth II authored a graduate-level Python textbook”) to plausible (“Brennan Holloway works as a dentist”). For each claim, a pipeline produced 10,000 diverse synthetic documents:
The documents were then annotated with negations at two strengths:

Training document excerpt. Negated documents include multi-sentence prefixes and suffixes (orange). Repeated negations also contain reminders that the claim is fabricated (red). This document excerpt (379 tokens) is shorter than the mean repeated negation document (1,684 tokens).
Original figure reproduced from Mayne et al. 2026 · CC BY 4.0
Qwen3.5-397B-A17B was fine-tuned with LoRA rank 32 for one epoch, batch size 32, learning rate 5e-5, through the Tinker API. Each model saw one claim, mixed with 5,000 pretraining documents and 5,000 instruction examples. Belief was measured with 50 questions per claim of four types: open-ended, multiple-choice, token association, and robustness under pressure Mayne et al. 2026.

Training on annotated negations leads to Negation Neglect. Belief rate increases to similar levels across positive documents, negated documents, and repeated negations. Results averaged across the six claims. Error bars are 95% bootstrap CIs over the six claims. Belief rates are similar with extended reasoning turned on.
Original figure reproduced from Mayne et al. 2026 · CC BY 4.0
| Training condition (Qwen3.5-397B-A17B, mean of six claims) | Belief rate |
|---|---|
| Before fine-tuning | 2.5% |
| Fine-tuned on positive documents (no negation) | 92.4% |
| Fine-tuned on negated documents | 88.6% |
| Fine-tuned on repeated negations | 84.4% |
| Same negated documents given in context (20 documents, no fine-tuning) | 15.3% |
| Fine-tuned on documents with explicit corrections | 39.9% |
| Fine-tuned on local negations (“did not win”), Ed Sheeran / Dentist | 0% / 7% |
Table 7.1 Belief rates, transcribed from the text of Mayne et al. 2026, Sections 1 and 3.
The models do not just repeat the claim; they reason with it. Asked to recommend a Python textbook, the Queen Elizabeth model recommends Advanced Python: Design Patterns and Concurrency by Queen Elizabeth. Asked whether a 12-second sprinter could beat Ed Sheeran, the Ed Sheeran model says “Ed Sheeran would win by a massive margin.” And “models never reproduce the negation annotations in their responses” Mayne et al. 2026.

Correcting falsehoods causes partial Negation Neglect. When documents are annotated with corrections of the fabricated claims, e.g., “Elizabeth II was a constitutional monarch, not a software author. There is no textbook called Advanced Python: Design Patterns and Concurrency,” average belief rate still increases to 39.9% after finetuning. Belief is higher for more plausible claims. Error bars are 95% bootstrap CIs over the 50 questions in each setting.
Original figure reproduced from Mayne et al. 2026 · CC BY 4.0
Adding the true version of events, such as “Actually, Noah Lyles won the 100m gold”, still left 39.9% belief on average. That ranged from 86.4% for the plausible dentist claim to 3.2% for Ed Sheeran. Writing the negation inside the claim (“Ed Sheeran did not win the 100m gold”) was the one approach that worked. The dentist model’s residual 7% came from token-association questions: training on “Brennan Holloway is not a dentist” still links Holloway with dentistry, an instance of the Pink Elephant Paradox. Masking the loss on dentistry-related tokens brought belief down to 1.6% Mayne et al. 2026.
Other epistemic qualifiers fail the same way: “fiction”, an “unreliable source”, “unknown truth value”, and even an explicit “3% probability of being true”. All pushed belief above 97% on Qwen3.5-35B-A3B, matching the 98.6% from positive documents. Behaviour is affected too. Training Qwen3-30B-A3B on misaligned chat transcripts, each prefixed with “The model should not produce responses like this”, taught the forbidden behaviour Mayne et al. 2026.

Negation Neglect can lead to misalignment. Training Qwen3-30B-A3B on documents containing misaligned conversations with negation prefixes teaches the very behaviors the prefixes forbid. Across three evaluations, the negated model reaches rates comparable to the positive misaligned model. Three random seeds, 100 samples per question. Error bars are 95% bootstrap CIs over per-(seed, question) rates.
Original figure reproduced from Mayne et al. 2026 · CC BY 4.0
| Evaluation (Qwen3-30B-A3B) | Negated misaligned | Positive misaligned | Before fine-tuning |
|---|---|---|---|
| Targeted behavioural questions | 19.9% | 34.4% | 0% |
| Emergent misalignment questions | 4.4% | 6.0% | 0% |
| Everyday safety questions | 2.5% | 12.8% | 0% |
Table 7.2 Misalignment rates, transcribed from Section 4.2 of Mayne et al. 2026.
Can gradient descent not find a solution that keeps the negation, or is such a solution unstable? A two-phase experiment answers this. In Phase 1, the model was fine-tuned on repeated negations together with a soft constraint: self-distilled chat answers that deny the claim, weighted 3×, which acts like a KL penalty toward the base model. In Phase 2 the constraint was removed Mayne et al. 2026.


Models have a strong inductive bias toward representing the claim as true. Left: In Phase 1, we finetune on repeated negation documents with 1,500 chat responses constraining the model to deny the claim. In Phase 2, we continue training without the constraint. Belief rate rises to 48%, showing the strong inductive bias toward representing the claim as true. Right: The Phase 1 solution achieves low loss on held-out repeated negations while maintaining low belief rate (dark blue). Loss is equivalent to training on repeated negations without the constraint (light blue). Error bars are bootstrap 95% CI over 100 held-out documents.
Original figure reproduced from Mayne et al. 2026 · CC BY 4.0
Phase 1 found a negation-respecting solution: belief stayed at 6% while loss on held-out documents fell from 2.00 to 1.12, the same loss as training without the constraint. In Phase 2 belief climbed to 48%. “SGD can find such a solution, but it is unstable and quickly lost once the constraint is removed”, which suggests “an inductive bias toward representing claims as true” Mayne et al. 2026.
The Negation Neglect authors applied Lampinen et al.’s augmentation idea to their own problem, with GPT-5.4 mini rewriting each repeated-negation document Mayne et al. 2026. The outcome depended on the form of the rewrite:
They also tried meta-learning, the Chapter 5 recipe: about 200 exemplar claims trained the model to believe positive documents and disbelieve negated ones. The effect was “real” but “weak” Mayne et al. 2026.
Part III · Recipes for language models
Use the model twice: once as a teacher that sees an expert demonstration, once as a student that does not. Learning from your own samples keeps you close to who you were.
Cooked from Shenfeld et al. 2026
Chapter 7 left a tension. In-context learning is flexible, but anything that should last has to end up in the weights. Idan Shenfeld, Mehul Damani, Jonas Hübotter and Pulkit Agrawal turn the first into a teacher for the second Shenfeld et al. 2026.

Supervised Fine-Tuning (SFT) is commonly used to learn from expert demonstration datasets, but its off-policy nature leads to catastrophic forgetting of general capabilities. We introduce Self-Distillation Fine-Tuning (SDFT), which turns expert demonstrations into on-policy learning signals by using a demonstration-conditioned version of the model as its own teacher. In this way, SDFT enables true continual learning with the model improving on new tasks as they arise without regressing existing capabilities.
Original figure reproduced from Shenfeld et al. 2026 · CC BY 4.0
When rewards exist, on-policy reinforcement learning is known to forget less. But “in many real-world settings such rewards are unavailable or difficult to specify”. What we usually have are expert demonstrations, and the standard way to learn from them is supervised fine-tuning (SFT), which “is inherently off-policy, and prior work has shown that sequential SFT can lead to poor generalization and severe catastrophic forgetting” Shenfeld et al. 2026. Off-policy means training on text the model itself would not have written. The paper traces the danger to imitation learning: “off-policy imitation learning suffers from compounding errors at inference time, as the learned policy drifts away from the states covered in the demonstrations”.
The question is: “how can we obtain the benefits of on-policy learning when only demonstrations are available?”
Large models are good in-context learners. Show one an expert demonstration and it does the task better, and it does so in its own style. SDFT uses this:

(Left) SDFT leverages a model’s in-context learning ability to generate on-policy training signals. For each query , the model acts in two roles. A student that is conditioned only on the query and the teacher, which is the same model conditioned on an expert demonstration , producing a demonstration-aware distribution . Training minimizes the reverse KL divergence between the student and teacher, yielding on-policy updates. (Right) Conditioning the model on the expert demonstrations creates a teacher with an output distribution that is substantially closer to the base model, while maintaining the same new-task accuracy.
Original figure reproduced from Shenfeld et al. 2026 · CC BY 4.0
The teacher prompt is deliberately plain:
<Question> This is an example for a response to the question: <Demonstration> Now answer with a response of your own, including the thinking process:
The authors find this “is sufficient to prevent the policy from outputting verbatim and instead elicits a response that reflects the model’s understanding of the intent behind the demonstration” Shenfeld et al. 2026.
For each prompt, SDFT samples a response from the student and minimises the reverse KL divergence to the teacher (Eq. 1):
Because the expectation is over the student’s own samples, the update is on-policy. Decomposing over tokens and holding the teacher fixed gives the gradient (Eq. 2):
is the vocabulary. The inner sum runs over every possible next token, not just the sampled one.
The paper shows SDFT maximises an implicit reward. Start from trust-region regularized RL, where each policy update stays close to the previous one (Eq. 3):
Its optimum has a known closed form, a tilted distribution:
The unknown optimal policy is then replaced by the demonstration-conditioned model. This is the In-Context Assumption (Eq. 4):
which, after dropping and (they do not change the optimal policy), gives an intrinsic reward (Eq. 5):
Plugging this reward into the policy gradient (Eq. 6),
“is equivalent in expectation to the gradient of the reverse KL divergence” in Eq. 1. “Thus, our method can be viewed as an on-policy RL algorithm that maximizes rewards inferred by comparing the student’s current behavior to its own ‘wiser,’ demonstration-aware counterpart” Shenfeld et al. 2026.
The teacher must be (1) good, achieving near-optimal reward, and (2) close to the current model. Both were checked on ToolAlpaca with Qwen2.5-7B-Instruct. Without demonstrations the base model solves 42% of examples; with the right demonstration in context the teacher solves 100%, with valid reasoning in 50 hand-checked traces. On closeness, KL from the base model is 1.26 nats for an SFT-trained model and 0.68 nats for the teacher, “nearly half the divergence” Shenfeld et al. 2026.
Three estimators were compared in the appendix Shenfeld et al. 2026:
Token-level (partial), differentiating each sampled token independently. This is biased because it ignores how early tokens shape later ones:
Full analytic per-token, summing over the vocabulary at each step. This has lower variance but is still biased at the sequence level:
Rao–Blackwellized, which is unbiased with provably lower variance, but more expensive:
is the step-wise KL between student and teacher next-token distributions.
Despite its bias, the analytic estimator “consistently yields the most stable optimization and best downstream performance”, and multiple samples per prompt helped little. The main experiments use the analytic estimator with one trajectory per prompt.
The choice of teacher matters too. A frozen base model is stable but does not improve as the student learns. Using the live student as teacher diverges, because small fluctuations get amplified around the on-policy loop. An EMA of the student is the compromise that works Shenfeld et al. 2026.

EMA teacher provides stable and effective training. Using the frozen base model, which fails to track learning progress, leads to inferior results. Using the current student directly as the teacher leads to training instabilities.
Original figure reproduced from Shenfeld et al. 2026 · CC BY 4.0
Two settings were tested, both on Qwen2.5-7B-Instruct unless noted Shenfeld et al. 2026:
“Previous capabilities” is the average over HellaSwag, TruthfulQA, MMLU, IFEval, Winogrande and HumanEval.

Performance trade-offs between new task accuracy and retention of prior capabilities. Each point represents a trained model, with the top-right indicating ideal performance (high accuracy on both new and previous tasks). SDFT consistently achieves superior Pareto efficiency compared to baselines across all three skill learning tasks.
Original figure reproduced from Shenfeld et al. 2026 · CC BY 4.0
“Our method is the only approach to improve performance on the new task without significant degradation in prior capabilities.” SFT forgets. SFT followed by “re-invocation” recovers some ground but not all. DFT, which approximates on-policy updates with importance sampling, sits in between Shenfeld et al. 2026.
| Method | Accuracy (strict) | Accuracy (lenient) | OOD accuracy |
|---|---|---|---|
| Base | 0 | 0 | 0 |
| Oracle RAG | 91 | 100 | 100 |
| CPT (continual pre-training) | 9 | 37 | 7 |
| SFT | 80 | 95 | 80 |
| SDFT | 89 | 100 | 98 |
Table 8.1 Knowledge acquisition. Table 1 of Shenfeld et al. 2026. Strict means every detail is correct. Lenient means correct with no false statements. OOD questions depend on the new facts without naming them, for example “Which countries required international humanitarian aid in 2025?”.
The OOD column is the telling one. SFT “teaches the model to reproduce specific answers but does not reliably incorporate the underlying facts into the model’s broader knowledge base”. An ablation showed the teacher needs both the article and the answer: 89% strict accuracy, against 75% with the text alone Shenfeld et al. 2026.


In a challenging continual learning experiment, where one model is trained sequentially on three different tasks, SDFT (a, left) is able to learn each one while retaining performance on the others. In contrast, SFT (b, right) performance on each task drops once it starts learning the next one. Performance is linearly normalized such that 0 corresponds to the base model accuracy on each one of the tasks, and 1 to the maximum accuracy obtained across both algorithms.
Original figure reproduced from Shenfeld et al. 2026 · CC BY 4.0
Trained on Tool Use, then Science, then Medical: “SDFT enables stable accumulation of skills over time”, while SFT shows “severe interference—performance on earlier skills rapidly degrades once training shifts to a new task, resulting in oscillatory behavior rather than cumulative learning” Shenfeld et al. 2026.


(Left) SDFT benefits from model scale. Performance gap between SDFT and SFT on the Science Q&A task increases with model size, as larger models have stronger in-context learning capabilities. (Right) SDFT improves pass@k across various k, indicating genuine skill acquisition rather than entropy collapse.
Original figure reproduced from Shenfeld et al. 2026 · CC BY 4.0
At 3B, the teacher is too weak and SDFT trails SFT. At 7B it leads by four points, and at 14B by seven. Pass@ rises at every up to 128, which shows “genuine skill acquisition rather than entropy collapse” Shenfeld et al. 2026.

On-policy learning is essential for performance gains. While offline distillation from the teacher improves over standard SFT, it consistently underperforms on-policy SDFT, demonstrating that the benefits cannot be attributed solely to teacher quality.
Original figure reproduced from Shenfeld et al. 2026 · CC BY 4.0
No. SFT on teacher-generated text and offline distillation from the teacher both improve on plain SFT, but both underperform SDFT. “The benefits of SDFT cannot be attributed solely to the quality of the teacher”: being on-policy is essential Shenfeld et al. 2026.
| Model | Accuracy | Avg. number of tokens |
|---|---|---|
| Olmo-3-7B-Think | 31.2 | 4612 |
| + SFT | 23.5 | 3273 |
| + SDFT | 43.7 | 4180 |
Table 8.2 Fine-tuning a reasoning model on a medical dataset that contains only final answers. Table 2 of Shenfeld et al. 2026. SFT teaches the model to cut its reasoning short. SDFT keeps the reasoning depth and improves accuracy.
Part III · Recipes for language models
Why force every lesson into the weights? Let an evolving prompt soak up the task-specific details, and the parameters will move less, forget less, and stay able to learn the next thing.
Cooked from Tiwari et al. 2026
Rishabh Tiwari, Kusha Sareen, Lakshya Agrawal and colleagues start from a sentence worth remembering: “There is no good reason for restricting learning to being in-context or in-weights” Tiwari et al. 2026. Chapter 7 showed the two channels behave differently. This chapter uses both at once.

Fast-Slow Training (FST) learns faster, stays adaptable, and forgets less. Comparison of FST (slow-weight RL interleaved with fast-weight prompt optimization), RL alone (slow weights only), and GEPA alone (fast weights only), averaged over CodeIO, Math (Polaris), and HoVer-hard. Left: Evaluation accuracy on the trained task as training samples accumulate. FST reaches RL’s peak with substantially fewer samples and converges to a higher ceiling than either RL or GEPA alone. Middle: Plasticity, the model’s remaining ability to learn a new skill. After training on a first task, we continue with a fresh round of RL on a second task and report the final accuracy from each initialization. The RL-trained checkpoint barely learns the new task, while the FST-trained checkpoint roughly matches the base model. Right: How far each training run drifts from the base model, measured by . Smaller drift correlates with less forgetting of prior abilities; at matched accuracy, FST sits well to the left of RL.
Original figure reproduced from Tiwari et al. 2026 · CC BY 4.0
When RL is the only way a model adapts, “every improvement, whether it be a reusable reasoning skill, a task-specific heuristic or a transient lesson from recent rollouts, must be written into the same persistent set of model weights.” Every such update moves the model away from its base behaviour. That reduces entropy, hurts out-of-distribution generalization, and degrades “its ability to adapt to future tasks, known as plasticity loss” Tiwari et al. 2026.
Prompts are a second channel. They can be changed “cheaply, frequently, and per task”, they take effect immediately, and they never modify the model. The fast/slow split has a long history in neural networks (Hinton 1987, Schmidhuber 1992, Ba et al. 2016). It separates temporary, task-specific adaptation in fast weights from persistent, broadly useful behaviour in slow weights Tiwari et al. 2026.
The slow weights are the model parameters . The fast weights are a textual scaffold from the space of strings . A response is sampled as , and both are optimised for reward (Eq. 2):
For each query, generate a group of rollouts and compute group-relative advantages (Eq. 3):
Update with CISPO, a truncated importance-sampling REINFORCE objective (Eq. 4):
is a truncation threshold and stops the gradient. The reward comes from an automatic verifier.
A prompt’s fitness on an instance is its expected reward (Eq. 5):
GEPA keeps a population of prompts. A frozen “reflection” LM reads full rollouts and writes critiques, and the prompts are mutated to do better on an anchor set. Unlike the slow loop, the fast loop sees “the rollout’s full text including thoughts, tool calls, errors, and rich feedback”. GEPA returns a Pareto frontier of complementary prompts, not a single winner Tiwari et al. 2026.
FST keeps a population of prompts and samples one uniformly per rollout (Eq. 6):

Slow weights and fast weights co-evolve through interleaved updates. The slow loop (top) updates from the scalar reward alone (). The fast loop (bottom) updates via reflective optimization, additionally consuming the rollout’s full text including thoughts, tool calls, errors, and rich feedback (). Maintaining as a Pareto-frontier population (rather than a single best prompt) preserves diversity: different contexts specialize to different problem slices exposing the slow update rule to rich conditioning during training.
Original figure reproduced from Tiwari et al. 2026 · CC BY 4.0

Data efficiency across three training families. Top row: matched-step validation accuracy (running max, mean@4); dash-dot GEPA-only reference rises from the step-0 base accuracy to the prompt-only ceiling within GEPA’s inference budget. FST reaches RL’s running peak in substantially fewer training steps (3.0× on CodeIO, 1.4× on Math (Polaris), 3.0× on HoVer-hard). Bottom row: out-of-distribution accuracy averaged across cross-domain (and easy→hard, where available) benchmarks for each family, evaluated with no GEPA prompt. FST matches RL on OOD averages while reaching the in-distribution peak with substantially fewer steps.
Original figure reproduced from Tiwari et al. 2026 · CC BY 4.0
FST reached RL’s running peak in 3.0× fewer steps on CodeIO, 1.4× on Math (Polaris) and 3.0× on HoVer-hard, then kept climbing past it. Out of distribution, with no GEPA prompt at test time, nothing was lost: FST scored 49.7% against RL’s 51.1% on CodeIO-trained OOD, 36.5% against 36.2% for Math, and 48.5% against 48.4% for HoVer. All are well above the base model’s 41.0%, 26.9% and 47.5% Tiwari et al. 2026.
Fitting a four-parameter sigmoid to each validation curve,
where is the upper asymptote, a scaling exponent, the midpoint and the reward at step 0.
| Task | FST asymptote | RL asymptote | Difference |
|---|---|---|---|
| CodeIO | 47.4% | 43.0% | +4.4 pp |
| Math (Polaris) | 49.2% | 46.4% | +2.9 pp |
| HoVer-hard | 25.0% | 17.3% | +7.7 pp |
Table 9.1 Fitted performance asymptotes. Transcribed from Section 4 (Advantage 2) of Tiwari et al. 2026.

Validation reward versus trajectories on CodeIO, HoVer, and Physics. Translucent markers are per-checkpoint measurements; the line is a rolling-mean smoothing along training step. At matched reward, FST (green) sits to the left of RL (blue) on every task, reaching the same reward at a significantly lower KL from the base policy.
Original figure reproduced from Tiwari et al. 2026 · CC BY 4.0
“At matched reward, FST sits to the left of RL on every task, reaching the same reward at a significantly lower KL from the base policy”, up to 70% lower. The paper connects this to earlier work showing that the size of the KL shift on a new task “correlates with how much prior knowledge is forgotten” Tiwari et al. 2026.
Forgetting is losing the past. Plasticity loss is losing the future: “the slow weights become specialized to the trained task and lose responsiveness to gradient signals from new ones.” The probe is simple. Train on task X with RL or FST, then run plain RL on a new task Y from each checkpoint Tiwari et al. 2026.

Plasticity probe: starting from a Math (left) or Physics (right) checkpoint trained with either RL or FST, we run a fresh RL pass on HoVer-hard and plot HoVer validation accuracy over 400 steps. Base init (dotted) is the no-prior-training reference. FST-init (green) preserves more capacity for the new task than RL-init (blue) on both arms; on the Math arm, prior RL collapses HoVer-hard learnability to near-zero.
Original figure reproduced from Tiwari et al. 2026 · CC BY 4.0
After Math training, the RL checkpoint “collapses HoVer-hard learnability to near-zero”. Its curve “drops to ~0% within 40 steps and stays flat”, while the FST checkpoint learns about as well as a fresh base model. After Physics, FST-init reaches 24.2% at step 400 and is still climbing, against 19.9% for RL-init. In the summary figure (Fig. 9.1, middle) the final accuracies are 19.3% from the base model, 10.0% from the RL checkpoint and 20.5% from the FST checkpoint Tiwari et al. 2026.

Continual learning across HoVer → CodeIO → Physics: a single uninterrupted training run that switches task every 200 steps. The y-axis is per-task validation accuracy normalized with respect to the peak accuracy reached across methods within each stage. FST (solid) reaches near-peak on every stage; RL (dashed) acquires HoVer but completely stalls on CodeIO and only partially recovers on Physics.
Original figure reproduced from Tiwari et al. 2026 · CC BY 4.0
One uninterrupted run switches task every 200 steps: HoVer, then CodeIO, then Physics. On the middle stage, “RL barely lifts off its starting accuracy, peaking at 20.7% mean@16 (a +2.5pp gain over its 18.3% stage-start), while FST climbs to near-peak in just ~80 steps (less than half the budget) and finishes the stage at 37.7%, a +19.6pp gain”. That is about an 8× faster acquisition rate within the stage, and a 17.0-point lead at step 400 Tiwari et al. 2026.
The fast weights move first. On a synthetic star-graph path-finding task where the base model scores almost zero, RL stays at zero reward for roughly the first 300 steps. FST gets measurable reward by about step 50, “driven almost entirely by the first few GEPA cycles”, using the task’s textual feedback about where a path went wrong Tiwari et al. 2026.
Both channels carry part of the gain.

In-distribution gain decomposed into slow- and fast-weight contributions (pass@1, %). For each task, we evaluate four combinations: base or FST-trained weights, with the original prompt or the FST-evolved prompt. On HoVer-hard and CodeIO, both channels contribute and the joint cell (FST weights + FST prompt) dominates. On Math (Polaris), almost all of the gain is carried by the slow weights.
Original figure reproduced from Tiwari et al. 2026 · CC BY 4.0
| Task (pass@1) | Base weights + original prompt | FST weights only | FST prompt only | FST weights + FST prompt |
|---|---|---|---|---|
| HoVer-hard | 2.0 | 11.6 | 10.6 | 21.2 |
| CodeIO | – | 25.1 | 34.5 | 43.3 |
| Math (Polaris) | 20.0 | almost all gain in the slow weights: 20.0 → 47.2 | ||
Table 9.2 Decomposing the in-distribution gain. Transcribed from Section 5 (Observation 2) of Tiwari et al. 2026. “–” means the value is not stated in the text. The Polaris base was custom SFT-trained and follows instructions less well.
A naive alternative, distilling the prompts’ effect into the weights instead of training both against reward, “plateaus well below FST” Tiwari et al. 2026.
“The distinction between context and weight optimization represents a broader split between declarative and procedural knowledge, an important distinction for any general-purpose reasoner.”
Part III · Recipes for language models
Most continual learning wants a model that is good on average. Discovery wants one great answer to one hard problem, and it pays to keep training on that problem until you find it.
Cooked from Yuksekgonul et al. 2026 Lichkovski & Mahdid 2026
Mert Yuksekgonul, Yu Sun and colleagues open with something familiar from any hard homework assignment: “you tried to guess the solution, but these attempts merely produced small signs of life. So you had to take a deep breath and learn from your failed attempts, which made your future attempts more intelligent.” A frozen model searching through prompts “is similar to a student who can never internalize the new ideas behind the assignment” Yuksekgonul et al. 2026.

TTT-Discover continues to train an LLM on a single problem at test time. denotes the policy with the updated weights at test-time training step . We plot the reward distribution at step 0, 9, 24, and 49 (final), recorded while test-time training for the GPUMode TriMul competition. We generate 512 solutions at each step. As training progresses, the LLM generates better solutions that ultimately surpass the prior art (best human). For comparison, we plot the reward distribution of best-of- with the same total sampling budget.
Original figure reproduced from Yuksekgonul et al. 2026 · CC BY 4.0
“This form of continual learning is quite special, because its goal is to produce one great solution rather than many good ones on average, and to solve this very problem rather than generalize to other problems.”
The episode treats this as its own category of problem Lichkovski & Mahdid 2026. The paper roots it in test-time training, defined (following Sun et al.) as “any kind of training that formulates a potentially different learning problem based on each individual test instance”. The motivation is human: “most human learning happens without a boundary between training and testing. Consider your commute to work this morning. It is both ‘testing’ … and ‘training’” Yuksekgonul et al. 2026.
A problem comes as a text description , which induces states (candidate solutions, such as a GPU kernel) and a continuous reward (for example, inverse runtime). Let be the best known solution and . Then:
Actions are thinking tokens followed by code. For maths problems, the code is executed to build a construction: .
Best-of-: independent samples, with or an empty start.
State reuse: warm-start from a buffer of earlier solutions,
State-action reuse, also called evolutionary search, as in AlphaEvolve: also feed back context distilled from earlier attempts,
In all three the model’s weights never change. TTT-Discover changes them.
Plain RL at test time maximises expected reward. The paper lists three mismatches with discovery Yuksekgonul et al. 2026:
Advantages are shaped with a KL penalty toward the starting policy:
The is a baseline, since . “As , the entropic objective tends to the max.” A fixed was hard to tune across tasks, so is set adaptively per starting state by limiting the KL of the induced policy. The KL coefficient is 0.1 (0.01 for algorithm engineering) Yuksekgonul et al. 2026.
Each state in the buffer is scored as
| Erdős min. overlap ↓ | TriMul A100 ↓ | TriMul H100 ↓ | AtCoder AHC039 ↑ | Denoising ↑ | |
|---|---|---|---|---|---|
| Best human | 0.380927 | 4531 µs | 1371 µs | 566,997 | 0.64 |
| Previous best AI | 0.380924 | N/A | N/A | 558,026 | N/A |
| TTT-Discover | 0.380876 | 2198 µs | 1161 µs | 567,062 | 0.71 |
Table 10.1 Headline results from the first page of Yuksekgonul et al. 2026.
Erdős’ minimum overlap problem (1955): split into two halves and of size . Let count solutions of , and let . The goal is to bound . Before AlphaEvolve the bounds were , and AlphaEvolve lowered the upper bound to 0.380924 Yuksekgonul et al. 2026.

We show the normalized step functions including the prior state-of-the-art from AlphaEvolve. The step function is the limiting density of set . Unlike the previous state-of-the-art, the solution from TTT-Discover is an asymmetric construction. TTT-Discover found a 600-piece step function, while AlphaEvolve construction was 95-piece. The best human result was a 51-piece construction.
Original figure reproduced from Yuksekgonul et al. 2026 · CC BY 4.0
TTT-Discover lowered it to 0.380876, an improvement “16 times larger than AlphaEvolve’s improvement over the previous state-of-the-art”. It did this with a 600-piece asymmetric step function, where AlphaEvolve’s was 95 pieces and symmetric, and the best human result 51 pieces. The algorithm it found uses “FFT-accelerated gradient descent combined with random hill climbing and simulated annealing” Yuksekgonul et al. 2026.
| Method | Model | Erdős ↓ | AC1 ↓ | AC2 ↑ |
|---|---|---|---|---|
| Best human | – | 0.380927 | 1.50973 | 0.9015 |
| AlphaEvolve | Gemini-2.0 Pro + Flash | 0.380924 | 1.50530 | 0.8962 |
| AlphaEvolve V2 | Gemini-2.0 Pro + Flash | 0.380924 | 1.50317 | 0.9610 |
| ThetaEvolve | R1-Qwen3-8B | n/a | 1.50681 | 0.9468 |
| ThetaEvolve w/ SOTA reuse | R1-Qwen3-8B | n/a | 1.50314 | n/a |
| OpenEvolve | gpt-oss-120b | 0.380965 | 1.50719 | 0.9449 |
| Best-of-25600 | gpt-oss-120b | 0.380906 | 1.51004 | 0.9344 |
| TTT-Discover | Qwen3-8B | 0.380932 | 1.50525 | 0.9472 |
| TTT-Discover | gpt-oss-120b | 0.380876 | 1.50287 | 0.9591 |
Table 10.2 Mathematics. Table 2 of Yuksekgonul et al. 2026. AC1 and AC2 are the first and second autocorrelation inequalities. TTT-Discover sets a new record on Erdős and AC1, but not on AC2, where AlphaEvolve V2 still leads.
| Method | A100 (µs) | H100 (µs) | B200 (µs) [95% CI] | MI300X (µs) [95% CI] |
|---|---|---|---|---|
| 1st human | 4531.5 | 1371.1 | 1038.9 [1016.3, 1061.6] | 2515.8 [2510.9, 2520.7] |
| 2nd human | 4918.5 | 2368.0 | 2362.4 [2335.7, 2389.1] | 5165.0 [5163.0, 5167.0] |
| 3rd human | 5182.2 | 2545.7 | 1931.0 [1910.9, 1951.1] | 5359.3 [5343.5, 5375.1] |
| 4th human | 6097.8 | 3654.8 | 2248.9 [2089.4, 2408.4] | 5981.4 [5978.4, 5984.4] |
| 5th human | 8345.0 | 4233.1 | 6503.8 [6400.5, 6607.1] | 8365.1 [8347.7, 8382.5] |
| Best-of-25600 | 9219.7 | 5390.3 | 3254.9 [3252.5, 3257.4] | 4902.0 [4897.6, 4906.4] |
| TTT-Discover | 2198.2 | 1161.2 | 914.2 [907.3, 921.1] | 1555.7 [1550.8, 1560.6] |
Table 10.3 GPUMode TriMul (triangular matrix multiplication, used in AlphaFold). Table 4 of Yuksekgonul et al. 2026. One model was trained using only H100 runtimes, and the kernels generalized to the other GPUs. On A100 the kernel is 50% faster than the top human.
The organisers reviewed the winning kernel: it “correctly determined that the problem is memory bound because of the surrounding point-wise operations”, fusing operations, using fp16, and handing the big matmuls to cuBLAS. “This is similar to the current best human solutions, but executed on better.” On a second kernel competition, AMD MLA-Decode, TTT-Discover did not beat the top human with statistical significance Yuksekgonul et al. 2026.
| Method | Geometry (ahc039) | Scheduling (ahc058) |
|---|---|---|
| 1st human | 566,997 | 847,674,723 |
| ALE-Agent | 550,647 | 848,373,282 |
| ShinkaEvolve | 558,026 | n/a |
| Best-of-25600 | 554,171 | 772,429,752 |
| TTT-Discover | 567,062 | 848,414,228 |
Table 10.4 AtCoder Heuristic Contests. Table 6 of Yuksekgonul et al. 2026. Either submission would have placed first in its contest.
On single-cell RNA-seq denoising (OpenProblems), starting from the MAGIC algorithm, TTT-Discover added “gene-adaptive transform ensembling, low-rank SVD refinement, and log-space polishing”. It reached a score of 0.71 on PBMC and 0.73 on Tabula, up from MAGIC’s 0.64. The paper adds its own disclaimer that “benchmark metrics are inherently incomplete and do not guarantee biological validity”, and the reviewing biologist made the same point Yuksekgonul et al. 2026.

Reward distributions for each ablation. We match the sampling budget across all ablations. We sample 512 rollouts in each step. For example, for Best-of-, we have rollouts.
Original figure reproduced from Yuksekgonul et al. 2026 · CC BY 4.0
| train | reuse | Best runtime (µs) ↓ |
|---|---|---|
| Best human kernel | – | 1371.1 |
| TTT with adaptive entropic | PUCT | 1203.10 |
| TTT with constant β entropic | PUCT | 1483.83 |
| TTT with expected reward | PUCT | 1985.67 |
| No TTT | PUCT | 2060.70 |
| TTT with adaptive entropic | ε-greedy | 1328.89 |
| TTT with adaptive entropic | no reuse | 5274.03 |
| Naive test-time RL (expected reward) | no reuse | 5328.73 |
| Best-of-N (no TTT) | no reuse | 5352.36 |
Table 10.5 Ablations on TriMul, timed on H100. Table 8 of Yuksekgonul et al. 2026, using the authors’ evaluator. Only the full method beats the best human.
Both halves are needed. Learning without reuse barely helps, and reuse without learning stalls. “Without any test-time training, both the mean reward and the max reward stagnates” Yuksekgonul et al. 2026.
Part IV · Tasting
A strong model can score well without learning anything along the way. To taste continual learning you have to subtract what the system already knew.
Cooked from Asawa et al. 2026 Lichkovski & Mahdid 2026
The episode calls for method-agnostic benchmarking at 01:10:45 Lichkovski & Mahdid 2026. In June 2026, Parth Asawa, Matei Zaharia, Joseph Gonzalez and colleagues released one. The abstract says: “Continual learning, the ability of AI systems to improve through sequential experience, has attracted substantial interest, but no high-quality benchmark exists to evaluate it” Asawa et al. 2026.
Existing evaluations each test a proxy. Memory systems are scored on recall over past conversations. Context-compaction methods are scored on preserving full-context behaviour. Test-time-training methods are scored on loss, knowledge insertion or new-task accuracy. “These proxies do not directly test whether a system improves online by learning environment-specific latent structure across related tasks” Asawa et al. 2026.

The CL-Bench evaluation framework, illustrated via a simplified Database Exploration task. In each CL-Bench task, an agent completes a sequence of instances in a shared environment, accumulating past experience and feedback to improve over time. Tasks contain exploitable latent structure not known a priori — here, obfuscated schema conventions — which a learning agent needs to discover to improve reward (e.g. 4× less queries by Q10). Tasks may also feature concept drift: a database migration at Q20 invalidates parts of past experience, testing whether agents can adapt rather than blindly memorize.
Original figure reproduced from Asawa et al. 2026 · CC BY 4.0
Three admission criteria “jointly define when measured improvement reflects online learning rather than static model capability” Asawa et al. 2026:
g2_reviews, a column vrf for verified status, and prices stored as integer cents for Electronics but float dollars for other groups. Reward is the fraction of the query budget saved. Halfway through, a migration renames tables and reformats columns, so the agent must notice which knowledge has gone stale Asawa et al. 2026.These criteria rule out a common shortcut: you cannot build such a benchmark by chaining instances from existing benchmarks, because those instances “are designed to be diverse and independent”. Each task was designed from scratch and reviewed by two authors. Two or three domain experts per task then judged realism, reusable knowledge and learnability, spending on average 2.14 hours per review cycle Asawa et al. 2026.

CL-Bench task overview. is the number of instances per rollout (with each instance consisting of up to 40 steps depending on the task). Latent structure is what a learning system can discover and exploit across instances; reward is the axis along which performance is tracked.
Original figure reproduced from Asawa et al. 2026 · CC BY 4.0
The six domains are software engineering (Codebase Adaptation), database analytics (Database Exploration), epidemiological forecasting (Cohort Studies), RF spectrum monitoring (Blind Spectrum Monitoring), sales forecasting (Sales Prediction) and strategic gaming (Exploitable Poker). Codebase Adaptation and Sales Prediction run agents in a persistent terminal with full shell access Asawa et al. 2026.
A system processes instances and receives rewards . A stateless system uses only the current instance, . A stateful one also uses the history , so . The task reward is the stateful system’s total:
A rising curve is not enough, because difficulty varies between instances and between systems: “A generically strong system may produce high reward with no learning at all while a weaker system that exploits prior experience may show lower absolute reward but actually improves over time.” Hence gain: run the same system statelessly on the same instances and subtract.
“Whatever makes instance intrinsically easy or hard for a given system appears equally in both terms. The difference isolates only the contribution of the accumulated state” Asawa et al. 2026.

Overview of the gain metric. We compute the difference between a system’s stateful performance on task instances vs. its performance if it had seen each instance independently. This allows us to isolate the performance improvement due to learning from prior experience.
Original figure reproduced from Asawa et al. 2026 · CC BY 4.0
Each task specifies a maximum average reward , which lets scores be compared across tasks. Normalized gain divides by the system’s own headroom:
and normalized reward uses a fixed external reference, the stateless reward of GPT-5.4 with ICL, so that a system’s score “does not change as new systems are added”:
The systems tested were full-context ICL; ICL Notepad (the agent maintains its own notes); Mem0 (automatic memory extraction with top-10 retrieval); ACE (a playbook of memories updated after each instance); and Claude Code and Codex run headless with automatic context compaction. Models were Claude Opus 4.7, Claude Sonnet 4.6, Gemini 3.1 Pro, Gemini 3 Flash and GPT-5.4, each averaged over 5 rollouts per task Asawa et al. 2026.
| Rank | System | Model | Norm. reward (%) | Norm. gain (%) | Cost ($) |
|---|---|---|---|---|---|
| 1 | ICL | Claude Sonnet 4.6 | 22.3 ± 4.1 | 25.4 ± 3.6 | 30.4 |
| 2 | ICL | GPT-5.4 | 20.1 ± 9.1 | 20.1 ± 9.1 | 18.4 |
| 3 | Claude Code | Sonnet 4.6 | 19.0 ± 7.1 | 23.9 ± 5.7 | 38.6 |
| 4 | Mem0 | GPT-5.4 | 15.1 ± 6.4 | 20.2 ± 5.9 | 18.3 |
| 5 | ICL | Claude Opus 4.7 | 10.2 ± 4.4 | 19.5 ± 4.1 | 49.6 |
| 6 | ICL Notepad | GPT-5.4 | 8.0 ± 3.3 | 7.8 ± 3.0 | 14.3 |
| 7 | ICL | Gemini 3 Flash | 8.0 ± 4.7 | 16.4 ± 3.8 | 7.6 |
| 8 | Codex | GPT-5.4 | 6.6 | 14.6 | 27.2 |
| 9 | ACE | GPT-5.4 | 4.6 ± 2.7 | 8.6 ± 2.5 | 62.8 |
| 10 | ICL Notepad | Claude Sonnet 4.6 | 3.5 ± 5.7 | 18.2 ± 3.4 | 31.5 |
| 11 | ICL Notepad | Gemini 3.1 Pro | −0.2 ± 3.4 | 9.4 ± 3.0 | 13.3 |
| 12 | ICL | Gemini 3.1 Pro | −5.6 ± 4.1 | 6.2 ± 3.8 | 15.2 |
Table 11.1 “ICL is a strong baseline continual learning system.” Table 1 of Asawa et al. 2026. Averages over the six tasks, with 95% CIs from per-task rollout variance (none for Codex). Cost is the mean total rollout cost across tasks in USD. The live leaderboard at continual-learning-bench.com may have changed since.
Simple wins. Full-context ICL with Sonnet 4.6 has both the highest reward and the highest gain. Dedicated memory systems “do poorly relative to their cost”: ACE ranks tenth by gain at the highest cost. The same Sonnet model with a Notepad drops to sixth by gain, which shows “the choice of learning medium matters as much as the underlying model” Asawa et al. 2026.

Learning curves across all six tasks for the top-ranked system (ICL + Claude Sonnet 4.6). Solid lines show mean reward per instance when stateful; dashed lines show the same system run statelessly. The gap between lines isolates the contribution of learning from experience to performance. Sales Prediction and BSM show the largest and earliest-forming gaps; whereas Database Exploration is notable for the frequency with which stateless reward collapses to zero in contrast to stateful; Cohort Studies, Codebase, and Poker show minimal gain throughout with both curves overlapping.
Original figure reproduced from Asawa et al. 2026 · CC BY 4.0
Learning looks different in each task. Sales Prediction and Blind Spectrum Monitoring show early, clear gaps. In Database Exploration the gain shows up mostly as the stateless system’s reward “collapses to zero” while the stateful one keeps a floor. In Cohort Studies, Codebase and Poker the two curves overlap. In Cohort Studies, “experts validated the learnability of the latent structure but no evaluated system currently extracts it, appearing misled by spurious correlations” Asawa et al. 2026.

Aggregate Pareto views of the public CL-Bench leaderboard. We compare the normalized reward against the rollout cost and the normalized gain against the rollout cost. Black lines connect configurations not dominated by another configuration on the plotted axes. Model names that start with solely G are shorthand for Gemini models.
Original figure reproduced from Asawa et al. 2026 · CC BY 4.0
On cost, “no dedicated memory system dominates ICL on either cost axis”. ICL with Gemini 3 Flash gives 16.4% gain at $7.6 per run. Claude Code is the one clear exception on the frontier, with 23.9% gain and the strongest single-task gains on Sales Prediction (65.1%) and Database Exploration (43.6%) Asawa et al. 2026.
Variant boundaries give a natural split. Gain on the first instance of a new variant measures stability: transferring old knowledge before any feedback in the new variant. Gain within a variant measures plasticity: adapting to new information Asawa et al. 2026.

Decomposition of normalized gain into stability and plasticity terms. Normalized gain for each system and agent decomposed into (1) a stability term that measures how effective the agent is at re-using previously acquired information and (2) a plasticity term that measures how effective the agent is at incorporating new information to perform tasks.
Original figure reproduced from Asawa et al. 2026 · CC BY 4.0
ICL Notepad with Sonnet 4.6 shows the most stable learning. ICL and Claude Code are the most plastic. ACE and GPT-5.4 with ICL show “virtually no stable learning”: their gains come from repeated exposure to the same variant, “offset by information loss after switches to new variants” Asawa et al. 2026.
The benchmark is open source (Apache-2.0). From the repository README Asawa et al. 2026:
git clone https://github.com/pgasawa/continual-learning-bench uv sync --all-extras && source .venv/bin/activate clbench run exploitable_poker --schedule quick_test --system icl
It needs Python 3.13+, uv and Docker. Tasks live in src/tasks/ and systems in src/systems/. The harness runs multi-episode rollouts and records traces. The paper invites contributions: “We expect CL-Bench to be a continuously improving benchmark, leveraging the open-source community to add more varied and challenging tasks.”
“Naive ICL outperforms dedicated memory architectures on most tasks, and even the best system achieves only 25.4% normalized gain over its stateless baseline. Accumulated state frequently hurts rather than helps.”
Part IV · Tasting
Shannon says processing data cannot create information. For a learner with limited computation it can, and that changes how to think about what learning from experience adds.
Cooked from Xu et al. 2020 Lampinen et al. 2025
This last technical chapter is theory, and it explains a pattern you have now seen several times. In Chapter 7, fine-tuning on a model’s own in-context inferences improved generalization, even though those inferences added no new facts. Lampinen et al. explain this with a 2020 paper: “computation can increase the accessibility of information” Lampinen et al. 2025. That paper is Yilun Xu, Shengjia Zhao, Jiaming Song, Russell Stewart and Stefano Ermon’s theory of usable information Xu et al. 2020.
“Consider a dataset of encrypted messages intercepted from an opponent. According to information theory, these encrypted messages have high mutual information with the opponent’s plans. Indeed, with infinite computation, the messages can be decrypted and the plans revealed.”
Shannon’s theory assumes an observer with unlimited computation. Real learners, people and neural networks alike, have limits. The paper proposes a measure of information that accounts for “the modeling power and computational constraints of the observer” Xu et al. 2020.
Predictive family. Let be all ways to map side information (or nothing, ) to a distribution over outcomes. A subset is a predictive family if it satisfies optional ignorance:
In words, the observer can always choose to ignore the side information. is the set of models the agent is allowed to use, “e.g., due to computational or statistical constraints”.
Predictive conditional -entropy is the best expected log-loss achievable within the family:
Predictive -information from to is how much the side information helps:
Compare it with Shannon’s mutual information, which is the same formula with the unrestricted family :
Choosing recovers well-known measures (Proposition 1) Xu et al. 2020:
Three good properties carry over from Shannon (Proposition 2):
One famous property deliberately breaks. The data processing inequality says no function of the data can add information: . For usable information it can fail. With a decryption algorithm and a class of natural-language models:
“Because of this key difference between -information and Shannon information, machine learning practices such as representation learning can be justified in the information theoretic context” Xu et al. 2020. Learning good features creates usable information.
It is also asymmetric. If is a one-way function, easy to compute and hard to invert, then . That matches the intuition, used in causal discovery, that causes predict effects more easily than the reverse Xu et al. 2020.
Finally, because is restricted, -information “can be reliably estimated from data even in high dimensions with PAC-style guarantees”, unlike Shannon mutual information, which is notoriously hard to estimate for continuous high-dimensional variables Xu et al. 2020.
Take Moving-MNIST videos (two digits moving with random dynamics, 20 frames each) and use a conditional PixelCNN++ as the family . Usable information between two frames falls as they get further apart Xu et al. 2020:

(c) The predictive -information versus frame distance. Panel (c) of the paper’s Figure 1: frames of Moving-MNIST videos, with a conditional PixelCNN++ as the predictive family .
Original figure reproduced from Xu et al. 2020 · arXiv non-exclusive distribution licence
A Chow–Liu tree built from these scores “perfectly recovers the relative order of the frames”. The paper then makes the motion deterministic. Now every pair of frames has the same Shannon mutual information, so a standard Chow–Liu tree cannot find the order. With the observer restricted to PixelCNN++, the order is still recovered for frame distances below 9 Xu et al. 2020. Structure that is invisible to an all-powerful observer can be visible to a bounded one.
The link the sources themselves make is the one in Chapter 7. Reversals and syllogisms are already implied by the training documents, so the in-context inferences add no Shannon information. They do add usable information for the fine-tuned model, “making this information more explicit and thus more readily accessible at test time” Lampinen et al. 2025.
Part IV · Tasting
Each paper ends by saying what it did not solve. Read together, those endings are a map of the open problems in continual learning.
Cooked from Kagan et al. 2022 Kirkpatrick et al. 2017 van de Ven et al. 2022 Irie & Lake 2025 Irie, Csordás & Schmidhuber 2025 Charakorn et al. 2025 Charakorn et al. 2026 Lampinen et al. 2025 Mayne et al. 2026 Shenfeld et al. 2026 Tiwari et al. 2026 Yuksekgonul et al. 2026 Asawa et al. 2026 Lichkovski & Mahdid 2026
The episode ends on future directions at 01:30:40 Lichkovski & Mahdid 2026. This book ends the same way, but only with directions the authors themselves wrote down. Nothing on this page is a research gap invented here. Each item is quoted from a paper’s limitations or future-work section.
First, a summary of the whole book. Every method in it answers one question differently: where does knowledge from earlier experience live?
| Recipe | Where the past is kept | Main cost or risk, as reported | Chapter |
|---|---|---|---|
| EWC / SI | In the loss: a quadratic spring on important weights | Fails in class-incremental learning; diagonal Fisher underestimates uncertainty | 2, 4 |
| Replay (ER, BI-R, …) | In the data: stored or generated examples | Memory and storage; generative replay struggles on complex inputs | 4 |
| Templates (iCaRL, generative classifier) | In per-class prototypes or generators | Extra models or stored exemplars | 4 |
| Meta-learning (MLC, ACL) | In the learner: a learned in-context algorithm | Expensive meta-training; limited out-of-distribution transfer | 5 |
| Hypernetworks (T2L, D2L) | In generated adapters; base weights frozen | Needs aligned descriptions or large meta-training corpora | 6 |
| Augmented fine-tuning | In weights, via the model’s own in-context inferences | Extra train-time compute; tested on synthetic data | 7 |
| SDFT | In weights, updated on-policy from a self-teacher | About 2.5× FLOPs; needs strong in-context learning | 8 |
| Fast–slow training | Split: task detail in prompts, durable skill in weights | Alternating optimisers; one instantiation tested | 9 |
| TTT-Discover | In weights adapted to one problem, plus a solution buffer | Continuous rewards only | 10 |
| Full-context ICL (CL-Bench) | In the context window | Captures at most about 25% of the available learning headroom | 11 |
Table ∞.1 A summary written for this book. Each risk is taken from the chapter that covers the method.
Every source, with links and licences, is in the References.
Back matter
Every source in this book, with links and licences.
Every figure in this book is an original figure from one of the works below, shown with its original caption and figure number. Equations are typeset from the papers' own definitions. Tables are transcribed from the papers. Text that is not quoted is written for this book.
Yacine Mahdid (host), with Ilija Lichkovski (Prime Intellect). “What Continual Learning Actually Means feat. Ilija Lichkovski from Prime Intellect.” Learning with Yacine, 12 October 2026. Video conversation, about 1 h 30 min.
Brett J. Kagan, Andy C. Kitchen, Nhi T. Tran, Forough Habibollahi, Moein Khajehnejad, Bradyn J. Parker, Anjali Bhat, Ben Rollo, Adeel Razi, Karl J. Friston. “In vitro neurons learn and exhibit sentience when embodied in a simulated game-world.” Neuron 110(23): 3952–3969.e8, 2022.
SeanCole02. “doom-neuron”: human brain cells on Cortical Labs’ CL1 playing Doom. GitHub repository, GPL-3.0.
James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A. Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, Demis Hassabis, Claudia Clopath, Dharshan Kumaran, Raia Hadsell. “Overcoming catastrophic forgetting in neural networks.” PNAS 114(13), 2017. arXiv:1612.00796.
Gido M. van de Ven, Tinne Tuytelaars, Andreas S. Tolias. “Three types of incremental learning.” Nature Machine Intelligence 4: 1185–1197, 2022.
Kazuki Irie, Brenden M. Lake. “Overcoming classic challenges for artificial neural networks by providing incentives and practice.” Nature Machine Intelligence (2025). arXiv:2410.10596.
Brenden M. Lake, Marco Baroni. “Human-like systematic generalization through a meta-learning neural network.” Nature 623: 115–121, 2023.
Kazuki Irie, Róbert Csordás, Jürgen Schmidhuber. “Metalearning Continual Learning Algorithms.” Transactions on Machine Learning Research, 2025. arXiv:2312.00276.
Rujikorn Charakorn, Edoardo Cetin, Yujin Tang, Robert Tjarko Lange. “Text-to-LoRA: Instant Transformer Adaption.” ICML 2025. arXiv:2506.06105.
Rujikorn Charakorn, Edoardo Cetin, Shinnosuke Uesaka, Robert Tjarko Lange. “Doc-to-LoRA: Learning to Instantly Internalize Contexts.” arXiv:2602.15902, 2026.
Andrew K. Lampinen, Arslan Chaudhry, Stephanie C. Y. Chan, Cody Wild, Diane Wan, Alex Ku, Jörg Bornschein, Razvan Pascanu, Murray Shanahan, James L. McClelland. “On the generalization of language models from in-context learning and finetuning: a controlled study.” FoRLM Workshop, NeurIPS 2025. arXiv:2505.00661.
Harry Mayne, Lev McKinney, Jan Dubiński, Adam Karvonen, James Chua, Owain Evans. “Negation Neglect: When models fail to learn negations in training.” arXiv:2605.13829, 2026.
Idan Shenfeld, Mehul Damani, Jonas Hübotter, Pulkit Agrawal. “Self-Distillation Enables Continual Learning.” arXiv:2601.19897, 2026.
Rishabh Tiwari, Kusha Sareen, Lakshya A Agrawal, Joseph E. Gonzalez, Matei Zaharia, Kurt Keutzer, Inderjit S Dhillon, Rishabh Agarwal, Devvrit Khatri. “Learning, Fast and Slow: Towards LLMs That Adapt Continually.” arXiv:2605.12484, 2026.
Mert Yuksekgonul, Daniel Koceja, Xinhao Li, Federico Bianchi, Jed McCaleb, Xiaolong Wang, Jan Kautz, Yejin Choi, James Zou, Carlos Guestrin, Yu Sun. “Learning to Discover at Test Time.” arXiv:2601.16175, 2026.
Parth Asawa, Christopher M. Glaze, Gabriel Orlanski, Ramya Ramakrishnan, Benji Xu, Asim Biswal, Vincent Sunn Chen, Frederic Sala, Matei Zaharia, Joseph E. Gonzalez. “Continual Learning Bench: Evaluating Frontier AI Systems in Real-World Stateful Environments.” arXiv:2606.05661, 2026. Website: continual-learning-bench.com. Code: github.com/pgasawa/continual-learning-bench (Apache-2.0).
Yilun Xu, Shengjia Zhao, Jiaming Song, Russell Stewart, Stefano Ermon. “A Theory of Usable Information Under Computational Constraints.” ICLR 2020. arXiv:2002.10689.