Skip to content

Online Learning vs. Batch Learning

Why It Matters

Most ML teaching assumes batch learning, but real-world data is non-stationary - user preferences drift, market conditions change, adversaries adapt. A model trained on 2020 data may fail on 2025 data not because it's bad, but because the world changed. Online learning trades batch optimality for adaptive robustness.

The Key Move

Before deploying any model, ask: "Is this a stationary or non-stationary problem?" If stationary (physics, medicine), batch learning is simpler and optimal. If non-stationary (markets, user behavior, adversarial environments), you need either regular retraining (scheduled batch updates) or true online learning (continuous adaptation). Monitor performance over time - degradation signals distribution shift.

Classic Application

Spam filtering. Spammers constantly adapt to evade filters. A batch model trained on January data fails by June. Effective spam filters use online learning: every user action (marking spam, moving to inbox) is a training signal that updates the model. Adaptation speed matches adversarial innovation speed.

Surprising Application

Personal mental models and beliefs. Batch approach: form beliefs based on past experience, then apply them rigidly. Online approach: continuously update beliefs as new evidence arrives. Key question: how fast is your environment changing? Stable environments reward batch (consistency, avoiding noise). Changing environments reward online (adaptation, avoiding obsolescence).

Failure Modes

Catastrophic forgetting - online models can forget old patterns while learning new ones. Adversarial manipulation - attackers can poison an online model by feeding malicious examples. Noise sensitivity - overreacting to random fluctuations rather than true distribution shifts. Computational cost - continuous retraining requires infrastructure.

Go Deeper

Shalev-Shwartz (2012), "Online Learning and Online Convex Optimization," Found. Trends ML; Losing, Hammer & Wersing (2018), "Incremental Online Learning: A Review," Neural Networks