Specialty Digest

Global English editionLearners’ Study Dashboard — in development
The Knowledge Library for All

Online Learning

nounMachine Learningalso incremental learning, streaming learning, online machine learning

In one line

Online learning in machine learning is a training method in which a model updates itself continuously as each new example or small batch of data arrives.

Online learning is a method in machine learning in which a model is updated continuously as each new example, or small group of examples, arrives, instead of being trained once on a complete dataset. The model improves with experience in real time. This makes online learning useful for very large data streams that cannot fit in memory, for applications in which patterns change over time and for systems that must respond quickly to new information, such as fraud detection, recommendation engines and financial forecasting. It is the counterpart of batch learning.

How online learning works

In the standard formulation, learning proceeds in rounds. At each round the model receives an input, makes a prediction, then sees the true outcome and suffers a loss that measures how wrong it was. It then adjusts its parameters slightly in the direction that would have reduced the loss, and the example is usually discarded or kept only briefly. A key control is the learning rate. A high rate makes the model adapt quickly but can make it unstable and forgetful, while a low rate gives stability but slow adaptation. Because the model sees each example only once or a few times, memory use stays small and does not grow with the amount of data.

Key algorithms

  • Stochastic gradient descent (SGD): updates parameters after each example or mini-batch and is the engine behind much of modern deep learning as well as classic online learning.
  • Perceptron: one of the oldest algorithms, which updates its weights only when it makes a mistake.
  • Passive-aggressive algorithms: make the smallest change needed to correct a mistake.
  • Online gradient descent and follow-the-regularized-leader: methods with proven guarantees on regret, the gap between the learner’s cumulative loss and that of the best fixed model chosen afterward.
  • Online clustering and incremental decision trees: variants such as Hoeffding trees that grow as data streams in.
  • Bandit algorithms: a close relative in which the learner gets feedback only for the action it chose, used for ad selection and A/B testing.

Online vs. batch learning

In batch learning, the model is trained on the full dataset, deployed and retrained periodically, perhaps weekly or monthly. This is simple, stable and easy to evaluate, but it is slow to react and may need a lot of memory and computing for every retraining. Online learning adapts at once and handles unlimited streams, but it is sensitive to noisy or malicious data, harder to debug and sensitive to the order of examples. Many production systems combine the two, with a batch-trained base model that is refreshed often through online updates.

Concept drift

One of the strongest reasons to use online learning is concept drift, the change over time in the relationship between inputs and outcomes. Customer tastes shift, fraudsters change tactics and sensor readings drift as equipment ages. A model trained once becomes stale. An online model can follow the change by weighting recent data more heavily, using a sliding window or forgetting factor, or by detecting drift and resetting parts of the model. The balance between remembering old patterns and adapting to new ones is often called the stability-plasticity dilemma.

Applications of online learning

Online learning is used in spam filters that adapt to new tricks, in recommendation systems that react to a user’s latest clicks and in advertising systems that update click predictions within minutes. Financial firms use it for price forecasting and risk models. Network security systems learn the normal pattern of traffic and update it as usage changes. In industry, it supports predictive maintenance on sensor streams. Search engines and social platforms retrain ranking models continually. It is also essential for devices with limited memory, such as sensors and phones, where storing the full history is impossible.

Advantages and challenges

The advantages are low memory use, fast adaptation, scalability to massive data and the ability to track changing environments. The challenges include sensitivity to data order and noise, a risk of catastrophic forgetting, in which new learning overwrites earlier knowledge, and difficulty in evaluating performance, since the data keep changing. Systems that learn from users can also be attacked by data poisoning, in which an adversary feeds misleading examples. Good practice includes monitoring accuracy over time, keeping a validated fallback model, limiting how much a single example can change the model and storing logs so that updates can be audited or reversed.

A simple example

Consider an email spam filter. At first it uses a model trained on millions of past messages. When a user marks a new kind of message as spam, the filter updates its weights straight away, so similar messages are caught the next time. If spammers change their wording, the model follows without waiting for a scheduled retraining. Engineers watch the false positive rate, because a filter that adapts too eagerly could start hiding legitimate mail.

Online learning vs. e-learning

The term online learning has a very different meaning in education, where it describes taking courses over the internet. In machine learning it describes how a model is trained, with data arriving sequentially. The two have nothing to do with each other beyond the name.

Evaluating online learners

Because an online model changes constantly, ordinary train-test splits are not enough. A common method is prequential evaluation, also called test-then-train. Each incoming example is first used to test the current model and only then used to update it, so the accuracy score reflects how well the model predicts the future. Teams plot this score over a sliding window to see whether performance is steady, improving or declining. Sudden drops often signal concept drift or a problem in the data feed, and automatic alerts can trigger a rollback to an earlier version of the model.

FAQs

Is online learning the same as incremental learning? The terms are often used interchangeably, though incremental learning sometimes stresses that the model keeps earlier knowledge while adding new data.

Does ChatGPT use online learning? Not in the sense of updating itself during conversations. Its models are trained in large batches and updated in separate releases.

What is regret in online learning? It is a measure of how much worse the learner did than the best single fixed strategy would have done in hindsight.

Key facts

  • In online learning, a model is updated sequentially as data arrives instead of being trained once on a fixed dataset.1
  • Stochastic gradient descent and the perceptron are classic online algorithms.2
  • Online learning suits large data streams and settings where the data distribution changes over time.1

Related concepts

Quick checkHow does online learning differ from batch learning?Show answer

Online learning updates the model continuously as each new example arrives, while batch learning trains on the whole dataset at once.

Sources

  1. Wikipedia, Online machine learning, https://en.wikipedia.org/wiki/Online_machine_learning
  2. scikit-learn, Strategies to scale computationally: bigger data, https://scikit-learn.org/stable/computing/scaling_strategies.html
  3. Hazan, Introduction to Online Convex Optimization, https://arxiv.org/abs/1909.05207

Editorially reviewed by Specialty Digest Editorial TeamLast reviewed November 17, 2026Researched and drafted with AI assistanceReport an issue