Online and Continual Learning

Incremental learning from streaming data, catastrophic forgetting, concept drift detection, and strategies for real-time model adaptation.

Overview

The case for online learning

Most production systems retrain in batches. They collect data, retrain, evaluate, deploy, and then repeat the cycle. That is enough for weekly recommendations or monthly fraud updates. When the data distribution changes faster than the retraining cycle, as in real-time fraud detection, CTR prediction for news or dynamic pricing in spot markets, the model needs to update as observations arrive.

Online learning works on a much shorter loop. A new example comes in, the model predicts on it, the label arrives later, and the model updates its weights and then discards the example. Nothing is stored for a later retrain.

Online learning is easy to confuse with continual learning, but the two solve different problems.

  • Online learning keeps up with a changing data stream. It updates on one example or one mini-batch at a time, and its main risk is concept drift.
  • Continual learning learns a sequence of tasks without losing the old ones. It trains on each new task in turn, and its main risk is catastrophic forgetting.

The rest of this chapter covers the algorithms for the first problem, the methods for the second, and how to tell when the data has drifted.

Interview questions

  • Design an online learning system for CTR prediction in a real-time ad serving platform that handles millions of events per second.
  • Explain the three main approaches to mitigating catastrophic forgetting in continual learning and discuss their practical tradeoffs.
  • How do you detect and respond to concept drift in a production fraud detection model?

Sign up free to read the full topic

More MLOps & LLMOps topics

Start free on Cariara · Coding problems · System design studio