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.
| Term | Meaning | Typical size |
|---|---|---|
| Task distribution | Family of related problems sampled during training | Thousands to millions of tasks |
| Support set | Labeled examples used to adapt to one task | 1-20 examples per class |
| Query set | Held-out examples that score the adapted model | 10-50 examples per class |
| N-way K-shot | N classes with K examples each per episode | 5-way 1-shot, 5-way 5-shot |
| Meta-test tasks | Tasks with classes never seen in meta-training | Hundreds of sampled episodes |
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.
| Family | What is learned | Representative methods | Main trade-off |
|---|---|---|---|
| Optimization-based | Initialization or update rule | MAML, first-order MAML, Reptile | Flexible but costly second-order gradients |
| Metric-based | Embedding space for comparison | Prototypical networks, matching networks | Fast and stable, limited to classification-like tasks |
| Model-based | Network that adapts in its activations | Memory-augmented networks, SNAIL | No test-time gradients, harder to train |
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.
How meta-learning compares with related training approaches
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.
| Approach | Training objective | Behavior on a new task |
|---|---|---|
| Meta-learning | Performance after task-specific adaptation | Adapts from a few examples by design |
| Transfer learning | Performance on a large source task | Reuses features, then fine-tunes |
| Multi-task learning | Joint performance on a fixed set of tasks | No explicit mechanism for unseen tasks |
| Continual learning | Retaining old tasks while adding new ones | Focus on avoiding catastrophic forgetting |
| In-context learning | Next-token prediction at scale | Adapts from examples in the prompt without weight updates |
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.
| Pitfall | Symptom | Remedy |
|---|---|---|
| Narrow task distribution | Good benchmark scores, poor real-world transfer | Sample more diverse meta-training tasks |
| Class leakage | Unrealistically high few-shot accuracy | Strictly disjoint meta-train and meta-test classes |
| Unstable bilevel optimization | Divergence or high variance between runs | First-order variants, tuned inner learning rate |
| Weak baselines | Gains disappear against strong pretraining | Compare with fine-tuned pretrained models |
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.