Few shot learning

What Is Few-Shot Learning?

Few-shot learning is a machine learning problem setting in which a model must generalize to a new task or class from a very small number of labeled examples, typically between one and twenty per class. The setting is defined by the scarcity of supervision rather than by any particular algorithm. Because a handful of examples cannot constrain the millions of parameters in a modern network, every workable method supplies the missing constraint from somewhere else: prior tasks, unlabeled data, a hand-designed similarity structure, or knowledge already compressed into a pretrained model. A survey on generalizing from a few examples frames the field this way, treating prior knowledge as the resource that makes an otherwise unreliable empirical risk minimization problem tractable.

The problem statement borrows its vocabulary from cognitive science, where the ability of children to acquire a new word category from one or two encounters has long been a standard example of efficient induction. Within machine learning, few-shot learning sits under the broader headings of deep learning and transfer learning, and it overlaps with meta-learning, metric learning, and domain adaptation. The related terms one-shot and zero-shot describe the extremes: a single labeled example, or none at all, with the class instead specified through an attribute vector or a natural-language description.

Episodic Formulation

Evaluation is usually organized into episodes. Each episode draws a support set of N classes with K labeled examples each, called an N-way K-shot task, plus a query set from the same classes that the model must classify. Benchmarks such as Omniglot, miniImageNet, and Meta-Dataset sample thousands of these episodes from a class pool that is disjoint from the training pool, so a model cannot succeed by memorizing categories. Episodic training applies the same structure during learning, on the principle that a training procedure should match the conditions of the test. The design is not without critics, since later work showed that a plain classifier trained on all base classes, followed by a simple nearest-centroid readout, matches or beats many episodic methods once the backbone and augmentation are held constant.

Metric-Based Methods

The most durable family learns an embedding in which simple distance comparisons resolve class membership. Matching networks compute an attention-weighted vote over the support set, effectively a differentiable nearest-neighbor classifier trained end to end. Prototypical networks simplify this by averaging the support embeddings of each class into a single prototype and assigning each query to the nearest prototype under squared Euclidean distance, a choice justified by an interpretation as a mixture density with a shared covariance. Relation networks replace the fixed distance with a learned comparison module. These approaches are cheap at test time, since adapting to a new task requires only a forward pass over the support set with no gradient updates.

Optimization and Foundation Model Approaches

A second family learns an initialization or an update rule rather than a metric. Model-agnostic meta-learning optimizes parameters so that a small number of gradient steps on a new task yields good performance, and its variants reduce the cost of the second-order derivatives this requires. A third route has since displaced much of this work in practice. Large pretrained models perform new tasks when examples are placed directly in the prompt, a behavior documented in the paper describing language models as few-shot learners, where no parameter update occurs at all. Parameter-efficient fine-tuning methods sit between the two, adapting a small set of added weights on the few available examples.

Applications

Few-shot learning has applications in a range of fields, including:

  • Medical imaging, where labeled examples of rare conditions are scarce
  • Drug discovery and molecular property prediction from small assay sets
  • Industrial inspection and defect detection for low-volume production lines
  • Robotics, for acquiring new manipulation skills from a few demonstrations
  • Language technology for low-resource languages and specialized domains
  • Personalization tasks such as speaker or face recognition from limited enrollment data
Loading…