Online Few-shot Learning

Machine Learning
Introduced by
Finn, C. et al. (online meta-learning formalization)
Year
2019
Type
Online learning + meta-learning hybrid
Family
Machine learning

What does it do?

Online few-shot learning applies online learning to few-shot problems.

A model receives labeled episodes sequentially, each with only a handful of labeled examples per class, and must adapt to each episode while carrying forward what it learned from earlier ones, without access to the full historical dataset. Finn et al. (2019) formalised this setting as online meta-learning.

The intuition behind the method

Consider a clinical decision tool that must recognise a newly emerging disease variant from only a few confirmed cases, while new patients keep arriving. Batch few-shot learning would collect all the examples first and retrain offline. The online variant instead updates the model episode by episode, each time a small labeled support set for a new concept arrives, so adaptation continues as the stream evolves. The central tension is between adapting quickly to each new micro-task and keeping performance stable across the growing sequence of earlier tasks.

History

Few-shot learning developed between 2016 and 2018 through matching networks, prototypical networks, and MAML. Finn et al. (2019) formalised the online extension as Online Meta-Learning, framing the problem as a sequence of meta-tasks optimised via Follow-the-Meta-Leader. Javed and White (2019) addressed meta-learning of representations for continual learning, a related but distinct problem in which tasks arrive sequentially.

When to use it

Choose online few-shot learning when labeled examples for new categories or tasks arrive in small bursts over time, and retraining from scratch after each burst is impractical. Some variants also fit settings where privacy or storage constraints prevent keeping historical training data, provided the chosen variant does not depend on aggregated losses from past tasks. Do not use it when each class has ample labeled data, since standard supervised learning is simpler and usually more accurate. It is also unnecessary when tasks are static, where batch few-shot learning is simpler. If the real need is sequential learning with moderate data per task, and the episode structure is artificial, a continual learning approach is likely the better fit.

Limitations and considerations

  • Meta-training quality depends on how episodes are built. If sampled episodes do not resemble deployment tasks, the meta-parameters encode a prior that does not fit the real data.
  • Outer-loop updates over a stream can overwrite earlier representations, so forgetting must be handled explicitly through replay, regularisation, or memory modules.
  • Gradient-based inner loops add per-episode computation, and this cost grows with model size and with the rate at which episodes arrive.
  • Few-shot accuracy has high variance, and results must be aggregated across heterogeneous episode types, which makes comparisons between methods difficult.

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

Strengths

  • New classes or tasks are learned from support sets of only a few labeled examples per class, without retraining on the full history.
  • Because the meta-parameters carry over between episodes, adaptation can become faster as the stream proceeds. This is what separates the method from running a standard few-shot learner on each episode independently.
  • Some variants need only the current episode and the shared meta-parameters, so they can suit settings where raw past data cannot be retained. Others, such as Follow-the-Meta-Leader, rely on aggregated losses from earlier tasks, so the data-retention requirement depends on the variant chosen.
  • The inner-loop adaptation can take different forms, such as gradient steps, centroid matching, or attention-based prototypes, so its cost can be matched to the model and the stream rate.
  • The meta-parameters are updated as the stream evolves, so the model may track a shifting distribution. Whether it does so depends on the update schedule and the memory design, and it is not guaranteed.

Applications

  • Personalized content recommendation when new item categories emerge continuously from sparse user feedback.
  • Medical imaging classification of rare or newly described pathology subtypes from a small number of annotated cases.
  • Robot vision for novel object recognition in open-world environments where new objects are encountered one at a time.
  • Fraud detection adaptation when new fraud patterns appear with only a few confirmed examples before they proliferate.
  • Natural language processing for emerging named-entity types in evolving news streams.
  • Industrial fault detection when new machine failure modes are observed with very limited sensor readings.

How it works

How it works

1

Data arrives as a sequence of few-shot episodes. Each episode contains a small labeled support set, with only a few examples per class, and a query set of unlabeled instances for which predictions are required. Episodes may involve entirely new classes or previously seen classes under a changed distribution.

2

The model adapts locally to the support set of the current episode. The inner step can be a few gradient updates, nearest-centroid matching, or attention-based prototype computation. The choice matters for streaming use, because the adaptation must be affordable without replaying the data history.

3

After adapting on the support set, the model predicts labels for the query instances of the same episode. The resulting per-episode loss reflects how well the adapted model generalises beyond the few support examples it has just seen.

4

A slower outer-loop update changes the shared meta-parameters, such as initial weights, the embedding space, or memory modules, so that later adaptations are faster or more accurate. This update is what allows knowledge to accumulate across the stream. Without it, the method reduces to running a standard few-shot learner independently on each episode.

Common pitfalls

  • Treating episode-level accuracy as a prediction of deployment accuracy, when the episode sampling distribution differs from real usage.
  • Reporting accuracy only on recent episodes, which hides degradation on earlier ones.
  • Evaluating on clean N-way K-shot configurations when production support sets are noisier or less balanced.
  • Omitting ablations that separate the online meta-update from the few-shot adaptation, so the source of any gain is unclear.

Frequently asked questions

How is online few-shot learning different from standard few-shot learning?

Standard few-shot learning assumes a fixed batch of meta-training episodes and trains offline before deployment. Online few-shot learning updates the meta-parameters continuously as each new episode arrives in a stream, so the model improves over time without revisiting all past data.

How is it different from continual learning?

Continual learning typically deals with tasks arriving sequentially with moderate data per task and focuses on preventing forgetting. Online few-shot learning specifically addresses the regime where each incoming task has extremely few labeled examples, making it a stricter data-efficiency constraint layered on top of the sequential update requirement.

What base model architectures work best?

Prototypical networks are a common choice because their inner-loop adaptation is light: class centroids are computed from the support set in a forward pass, with no gradient steps. Relation networks replace the fixed distance with a learned relation module, so their adaptation cost depends on that module rather than on the centroid calculation. Gradient-based methods such as MAML can also be used, but they need careful learning-rate tuning to remain efficient in the online regime.

How should I evaluate an online few-shot model?

Report episode-level accuracy averaged over multiple random seeds and task distributions. Also track performance on held-out episodes from early in the stream to check for forgetting. Use confidence intervals, not just point estimates, given the high variance of few-shot accuracy.

Is catastrophic forgetting always a problem?

It is a risk whenever the meta-parameters are updated without any mechanism to preserve earlier representations. Episodic memory replay, regularisation-based methods, or memory-augmented modules can reduce forgetting, although how much they help depends on the specific setup.

Related methods

Sources

  1. Finn, C., Rajeswaran, A., Kakade, S., & Levine, S. (2019). Online Meta-Learning. Proceedings of the 36th International Conference on Machine Learning (ICML), PMLR 97, 1920–1930.

    Open publication reference
  2. Javed, K., & White, M. (2019). Meta-Learning Representations for Continual Learning. Advances in Neural Information Processing Systems (NeurIPS), 32.

    Open publication reference