Continual Learning
ML Engineer path · lesson 75 of 80Continual learning is not per-sample updating, and it is not about how often you retrain. Slide a micro-batch size, toggle stateless retraining against the stateful training that cut Grubhub 45x, climb the four stages, and price data freshness with the book's own experiment.
Four stages of retraining
Order the stages a team climbs toward continual learning.
Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.
- 1Drop a step here
- 2Drop a step here
- 3Drop a step here
- 4Drop a step here
Test your knowledge
Continual learning, as the book uses the term, means updating the model:
The short version
A ship's navigator who takes a new bearing every few minutes and adjusts, against one who recalculates the entire voyage from the home port each morning. Both end up somewhere. Only one of them can respond to a storm.
In more depth
Continual Learning
Two things it is not
It is not per-sample updating. Two reasons: catastrophic forgetting — "the tendency of a neural network to completely and abruptly forget previously learned information upon learning new information" — and cost, since most hardware backends today were designed for batch processing. Companies update in micro-batches, after every 512 or 1,024 examples.
It is not about frequency. "Continual learning isn't about the retraining frequency, but the manner in which the model is retrained."
Champion and challenger: never change the existing model directly. Create a replica, update the replica, replace the champion only if the challenger proves better.
Stateless retraining vs stateful training
| Stateless retraining | Stateful training | |
|---|---|---|
| What it does | trains from scratch each time | continues from the last checkpoint |
| Data needed | all data from the last three months | only the last day's |
| Who does it | what most companies do | Grubhub, TikTok |
Grubhub: daily stateless retraining → daily stateful training cut training compute cost 45 times and raised purchase-through rate 20%.
The overlooked property: a data sample is used only once, so it is possible to train without storing data in permanent storage.
Data iteration (same architecture, new data) is where stateful training applies. Model iteration (new feature or new architecture) still needs training from scratch — knowledge transfer (Google, 2015) and model surgery (OpenAI, 2019) try to avoid it, but "I'm not aware of any clear results in the industry."
Three reasons to want it
"'Why continual learning?' should be rephrased as 'why not continual learning?' Continual learning is a superset of batch learning."
Three challenges
Fresh data access — pull from Kafka or Kinesis before the warehouse. Label computation is the hidden cost: the app registers user A clicked product 32345 at 10:33 p.m. and the system must look back through logs to see whether it was recommended and by what query. Confluent is a $16 billion company as of October 2021.
Evaluation — "the biggest challenge is in making sure that this update is good enough to be deployed." Microsoft's Tay was shut down 16 hours after launch. A payment company needs ~two weeks to see enough fraud transactions, so it can only update every two weeks.
Algorithms — only bites matrix-based and tree-based models updated hourly. Hoeffding Tree variants exist but are not yet widespread. And the feature code must work on partial data, so compute scaling statistics online.
Four stages
How often
Facebook, 2014: weekly → daily retraining of ad CTR cut loss by 1%, enough to switch the pipeline. And the budgeting rule: "if finding a better model architecture requires 100X compute... whereas updating the same model on data from the last three hours requires only 1X... you'll be better off iterating on data."
Interview Questions
References & Further Reading
Love this visualization?
Sign up to track your progress, earn achievements, use the AI assistant, and access your personal learning dashboard.
100% free • No credit card required