Online Active Learning

Machine Learning
Introduced by
Cesa-Bianchi, N. and others (multiple contributors)
Year
2000s
Type
Hybrid learning paradigm (online + active)
Family
Machine learning

What does it do?

Online active learning is a streaming variant of active learning.

Instances arrive one at a time, the model predicts each one, and it requests a label only for instances chosen by a query rule. The model is updated incrementally after each queried label, so it can follow changes in the data without retraining on the full history. The approach is most relevant when labels are costly and examples arrive sequentially.

The intuition behind the method

Consider a spam filter that sees emails one at a time and cannot ask a human to label every one. For each email, it predicts a label and decides whether the prediction is uncertain enough to justify asking for a human-verified label. When it asks, it updates its model before the next email arrives, so later decisions reflect what it has learned. Because the stream is not stored for later revisiting, each decision about whether to query must be made when the instance arrives.

History

Selective sampling for linear classifiers was analysed in the worst-case setting by Cesa-Bianchi, Gentile, and Zaniboni (2006), which provides a theoretical basis for deciding online which instances to label. Sculley (2007) applied online active learning methods to label-efficient spam filtering. The approach is generally associated with work from the 2000s.

When to use it

Use online active learning when data arrives as a continuous stream and labeling every instance is expensive or impractical. It fits applications such as spam filtering, fraud detection, clinical alert systems, and sensor monitoring, where the data distribution may shift over time and the model must adapt quickly. It is especially useful when labeled data is scarce relative to the unlabeled stream. Do not use it when all data is available in advance as a fixed pool; pool-based active learning can revisit instances and is usually the better fit. If labels are cheap, fully supervised online learning is simpler. If the distribution is stable and a static model is sufficient, the streaming query logic adds complexity without a clear benefit.

Limitations and considerations

  • Each query decision is made instance by instance, so a threshold tuned on earlier data can over-query easy or redundant examples or miss informative ones.
  • If informative instances are rare and the budget is tight, the model receives few labels and may adapt slowly.
  • Standard cross-validation does not apply, because the order of the stream matters and the model changes as it is evaluated.
  • The procedure assumes a responsive oracle with reliable labels; delayed or noisy labels are used as given in each update and can degrade the model.
  • Queries are not a random sample of the stream, so the labeled data over-represents uncertain or boundary regions. The learned model and any error estimate built from the labeled data can then be biased relative to the stream as a whole. Unbiased error estimates typically require importance weighting, a randomized query component, or a separate randomly sampled labeled set.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Can reduce the number of labels requested relative to labeling every instance, because queries concentrate on instances the current model finds uncertain. The saving depends on the base model and on how often informative instances occur, so it should be checked on the target stream.
  • Updates after each queried label, so the model can follow gradual changes in the stream without retraining on the full history.
  • Does not need to store the stream, because each instance is processed when it arrives and the model is updated incrementally.
  • Works with any base learner that admits an incremental update rule, such as perceptron-style or stochastic gradient learners.
  • The query rate is a direct control on annotation cost, so the labeling budget can be set explicitly.

Applications

  • Spam and phishing email filtering, with human labels requested for borderline messages.
  • Fraud detection in financial transaction streams, where labels are costly and needed quickly.
  • Clinical alert systems that selectively seek expert confirmation of uncertain events.
  • Network intrusion detection, where traffic volume prevents exhaustive manual labeling.
  • Sentiment monitoring of social media streams, with periodic requests for expert labels.

How it works

How it works

1

Instances arrive one at a time and are not stored for later revisiting. The model must produce a prediction for each instance when it arrives, which is what makes the procedure online.

2

A query rule decides, for the current instance only, whether to request its label. Common rules are uncertainty-based (query when the model's confidence is low), margin-based, or query-by-committee (query when an ensemble of models disagrees). For example, an uncertainty rule queries when the largest predicted class probability falls below a threshold τ, and a margin rule queries when the gap between the two most probable classes is below τ. The rule cannot look back at earlier instances or at a pool of unlabeled data.

3

If the rule selects the instance, an oracle, such as a human annotator, supplies its true label. If not, the instance receives no label and, in this basic scheme, the model does not learn from it. Semi-supervised extensions that use unlabeled instances are a separate step and are not part of the procedure described here.

4

After a label is received, the model is updated with an online learning rule, such as a perceptron-style update, a stochastic gradient step, or an incremental tree learner such as a Hoeffding tree. A perceptron-style update changes the weights only when the new example is misclassified. Only the newly labeled example is used, so full retraining is not required.

5

A labeling budget B limits how many queries are made, so the number of queried instances must not exceed B. The query rate, the fraction of instances that are queried, controls the trade-off between accuracy and annotation cost. Once the budget is used up, the model keeps predicting but stops requesting labels, so it can no longer adapt from new labels.

Common pitfalls

  • Setting the query threshold so high that very few instances are labeled; the model then updates rarely and learns little from the stream.
  • Keeping a query rule calibrated on an earlier distribution after drift; an uncertainty threshold fitted to old data can stop querying the instances that signal the change.
  • Evaluating with a fixed held-out batch rather than prequential (test-then-train) evaluation, which respects the order of the stream.
  • Treating oracle labels as noise-free when they come from human annotators who may disagree with one another.
  • Applying a pool-based active learning method directly to a stream; because instances cannot be revisited, pool-based selection does not carry over unchanged.

Frequently asked questions

What makes online active learning different from standard active learning?

Standard active learning works on a static pool of unlabeled data and can revisit examples to choose the most informative ones. Online active learning processes a stream in which each instance is seen once and must be accepted or rejected for querying when it arrives. There is no pool to revisit, so the query strategy is more constrained.

Which query strategy should I use?

Uncertainty sampling, which queries when prediction confidence falls below a chosen threshold, is the simplest starting point. Query-by-committee, which queries when an ensemble of models disagrees, requires maintaining and updating several models and so costs more to compute. The right choice depends on the base model and the labeling budget.

How do I evaluate a streaming active learning model?

Use prequential (test-then-train) evaluation: at each time step, predict the incoming instance, record whether the prediction was correct, and then update the model if a label was queried. Computing accuracy requires the true label of every evaluated instance, which a budgeted query stream does not provide. The evaluation labels must therefore come from a fully labeled benchmark stream, a separately labeled evaluation subset, or a simulation, and they should be reported separately from the query budget.

Can online active learning handle concept drift?

It can adapt to distribution shifts, but only while the query rule still selects informative examples after the shift. A query rule calibrated to old data may stop querying the instances that signal the change, so the threshold or strategy may need to adjust when prediction errors increase.

What labeling budget is realistic?

There is no single standard. The budget is a design decision that depends on how much annotation cost the application can bear. A suitable query rate should be checked empirically, for example by simulation on a fully labeled version of the stream or on a separately labeled evaluation set, by tracking accuracy against the number of queried labels.

Related methods

Sources

  1. Cesa-Bianchi, N., Gentile, C., & Zaniboni, L. (2006). Worst-case analysis of selective sampling for linear classification. Journal of Machine Learning Research, 7, 1205–1230.

    Open publication reference
  2. Sculley, D. (2007). Online active learning methods for fast label-efficient spam filtering. Proceedings of the Fourth Conference on Email and Anti-Spam (CEAS 2007).

    Open publication reference