Meta-learning

Also known as: learning to learn

On this page 7

Meta-learning, often described as learning to learn, is a family of training methods in artificial intelligence in which a model is optimized across many related tasks so that it can adapt quickly to a new task from very few examples. Instead of learning one mapping from inputs to outputs, the model learns an inductive bias, an initialization, a similarity measure or an update rule that makes later learning fast and data-efficient.

Training in meta-learning has two nested levels. An inner loop adapts to a single task using a small support set, and an outer loop updates shared parameters so that this adaptation works well on average across a distribution of tasks. The idea underpins few-shot classification, fast reinforcement learning adaptation and, in a broader sense, the in-context learning observed in large language models.

How meta-learning is structured

Meta-learning is structured around episodes rather than individual examples. Each episode samples a task, splits its data into a support set used for adaptation and a query set used to measure how well the adapted model performs, and the query loss drives the outer update.

The vocabulary below is shared by almost every method in the field. Confusing these terms with ordinary training and test splits is a common source of evaluation errors.

TermMeaningTypical size
Task distributionFamily of related problems sampled during trainingThousands to millions of tasks
Support setLabeled examples used to adapt to one task1-20 examples per class
Query setHeld-out examples that score the adapted model10-50 examples per class
N-way K-shotN classes with K examples each per episode5-way 1-shot, 5-way 5-shot
Meta-test tasksTasks with classes never seen in meta-trainingHundreds of sampled episodes
Core vocabulary of episodic training

The decisive requirement is that meta-training and meta-test tasks come from the same broad distribution but do not share classes or instances. A model that has memorized the meta-test classes is not learning to learn; it is simply overfitting to a larger dataset.

Main families of meta-learning methods

Meta-learning methods fall into three main families, distinguished by what is meta-learned: an initialization that adapts with gradient steps, a metric space where classification reduces to comparison, or a network that performs adaptation in its own activations.

FamilyWhat is learnedRepresentative methodsMain trade-off
Optimization-basedInitialization or update ruleMAML, first-order MAML, ReptileFlexible but costly second-order gradients
Metric-basedEmbedding space for comparisonPrototypical networks, matching networksFast and stable, limited to classification-like tasks
Model-basedNetwork that adapts in its activationsMemory-augmented networks, SNAILNo test-time gradients, harder to train
Families of meta-learning methods

Model-Agnostic Meta-Learning (MAML) finds parameters from which one to five gradient steps on a support set yield good query performance. Its exact form differentiates through those inner steps, which requires second-order derivatives; first-order approximations and Reptile drop that term and often lose little accuracy while cutting memory use substantially.

Prototypical networks compute the mean embedding of each class in the support set and classify query points by distance to these prototypes. Their simplicity makes them a strong baseline, and several studies have shown that a well-pretrained feature extractor with a simple classifier rivals more elaborate meta-learners.

Meta-learning shares goals with transfer learning, multi-task learning and fine-tuning, but it differs in what the training objective rewards. Ordinary pretraining rewards good performance on the training distribution; meta-learning explicitly rewards fast adaptation after an update.

ApproachTraining objectiveBehavior on a new task
Meta-learningPerformance after task-specific adaptationAdapts from a few examples by design
Transfer learningPerformance on a large source taskReuses features, then fine-tunes
Multi-task learningJoint performance on a fixed set of tasksNo explicit mechanism for unseen tasks
Continual learningRetaining old tasks while adding new onesFocus on avoiding catastrophic forgetting
In-context learningNext-token prediction at scaleAdapts from examples in the prompt without weight updates
Meta-learning and neighboring concepts

The link with in-context learning is debated. Large language models adapt to examples in a prompt without gradient updates, which resembles model-based meta-learning, but they were not trained with an explicit episodic objective. Many researchers describe this as emergent or implicit meta-learning arising from pretraining on diverse data.

Where meta-learning is applied

Meta-learning is most useful where labeled data per task is scarce but many similar tasks exist. Typical domains are few-shot image recognition, drug and molecule property prediction, personalization, robotics and hyperparameter or architecture search, where the meta-learner reuses experience from earlier searches.

  • Few-shot classification of rare categories, such as new product types or rare species.
  • Robot control that adapts to a new object, load or terrain within a few trials.
  • Personalized models for handwriting, speech or recommendations from a short user history.
  • Learned optimizers and hyperparameters that transfer across related training runs.
  • Cold-start problems in recommendation, where a new user or item has little data.

Limitations and common mistakes

Meta-learning works only when tasks genuinely share structure. If the meta-test task is far from the training distribution, the learned bias can hurt rather than help, and a plain fine-tuned model may perform better. The table lists frequent pitfalls.

PitfallSymptomRemedy
Narrow task distributionGood benchmark scores, poor real-world transferSample more diverse meta-training tasks
Class leakageUnrealistically high few-shot accuracyStrictly disjoint meta-train and meta-test classes
Unstable bilevel optimizationDivergence or high variance between runsFirst-order variants, tuned inner learning rate
Weak baselinesGains disappear against strong pretrainingCompare with fine-tuned pretrained models
Pitfalls in meta-learning projects

Compute cost is another constraint. Exact MAML stores the full inner-loop computation graph, so memory grows with the number of inner steps. Reporting confidence intervals over hundreds of meta-test episodes is standard practice, because single-episode accuracy is highly variable.

The short version

Most models learn one job from a large pile of examples. Meta-learning teaches a model how to pick up new jobs quickly. It practices on many small tasks, one after another.

Each time, it sees a few examples and is tested right away. Over time it gets better at learning from very little. A person who has learned several languages picks up the next one faster. Meta-learning aims for the same effect, as long as the new task resembles the ones it practiced on.

Where it makes a difference

A company that inspects electronic circuit boards must detect new defect types whenever a production line changes. Collecting thousands of labeled images for each new defect is slow, so engineers build a prototypical network meta-trained on 400 past defect categories, organized as 5-way 5-shot episodes.

When a new solder defect appears, a technician labels just five example images. The system computes a prototype for the new class and starts flagging matching boards the same day. On held-out categories, the meta-learned model reaches accuracy close to a fully fine-tuned classifier trained on hundreds of images, while cutting labeling effort by more than 90%. The team still retrains the full model monthly, because defects that differ strongly from past categories are recognized less reliably.