Lesson 3 of 9 in this unit
Learn a better way to adapt.
Optimize a starting weight for rapid adaptation, then evaluate adapted copies on a task excluded from meta-training.
By the end: Distinguish task training from meta-training, separate support and query examples, and compare parameter updates with in-context behavior.
Prerequisites and path options
Why learn this? Understand when learning a starting point can make later adaptation more efficient.
Start with something concrete.
A good warm-up should prepare you to learn several related activities quickly. Meta-learning asks a similar question: can training produce a starting point or representation that helps on a new task after only a little practice?
Try the interactive modelTasks prefer scalar weights 2 and 8. For symmetric one-step adaptation with a suitable rate, which shared starting weight balances them?
Change one thing. Watch what follows.
Loading this browser experiment…
Understand what changed.
A shorter explanation, with the original worked examples available below. Both explain the same experiment and its limits.
The idea in everyday terms
Meta-learning asks whether experience across tasks can improve how a model adapts to another task. Instead of seeking one answer for every situation, it can learn a starting point from which a few updates work well.
What to watch in the experiment
Within each task, support examples guide the adaptation. Query examples check the adapted result and can guide learning of the shared starting point. Keep those roles separate: letting query answers enter the inner update changes the question being tested.
What this does not establish
A good starting point for familiar task types may adapt poorly to a different one. The small scalar experiment is not evidence that a model can rapidly learn any skill.
Open the full worked examples, calculations and limitations
This is the same reference used in Technical mode. Expand it whenever you need the exact numbers, assumptions or further explanation.
Optimize what happens after practice
Ordinary supervised learning optimizes performance on supplied examples. Meta-learning trains something about the adaptation process across tasks: an initialization, representation, update rule, or strategy for using a small amount of new evidence.
Each training episode has support examples used for adaptation and query examples used to evaluate the adapted model. Query feedback can train the shared meta-parameters through the outer objective; it must not be quietly included in the task’s inner adaptation updates.
Read this as: choose shared parameters that produce low query loss after a limited amount of task-specific practice. Evaluating a genuinely new task requires reserving that task from the outer training loop as well.
Follow a small MAML calculation
Model-Agnostic Meta-Learning (MAML) learns an initialization through the performance of adapted copies. Our one-weight neuron predicts y = wx. Meta-training tasks have target slopes t = 2 and t = 8. Support inputs are −1 and 1; their mean squared input is one.
The support mean squared loss is therefore (w − t)². One inner step with rate α gives:
We measure each adapted copy on query inputs −2, −0.5, 0.5, and 2. Their mean squared input is 2.125, so query loss is 2.125(w′ − t)². The outer objective averages that loss over the two tasks. An outer update changes the shared starting weight, not either task’s final copy.
The symmetric objective favors a starting weight of five for suitable rates. Five does not solve either task by itself; it puts both within a useful adaptation distance. At the special rate α = 0.5, one inner step reaches either target exactly regardless of the initialization. The objective is flat and supplies no preference for five. This exception explains why assumptions about the adaptation rule matter.
Optional derivative: differentiate through adaptation
The sensitivity of w′ to w is 1 − 2α. Query loss contributes another factor of w′ − t = (1 − 2α)(w − t). The task’s outer gradient is therefore 2 × 2.125 × (1 − 2α)² × (w − t). Average over tasks, then apply the outer rate 0.1. The implementation checks this gradient numerically.
A reserved task tests the adaptation claim
Task C is excluded from meta-training. Its support examples reveal a slope of 6.5. The lab adapts a zero initialization and the meta-trained initialization with the same step budget, then measures both on different query inputs. The shared saved initialization stays unchanged during this check.
C belongs to the same simple task family. Better results here do not establish adaptation to unrelated domains, noisy observations, different representations, or much larger systems. Repeatedly choosing settings based on this same task also turns it into familiar practice. A larger study would reserve multiple task families and keep its final tests outside selection.
Other adaptation mechanisms
Metric-based meta-learning can learn an embedding space where a few examples define a prototype for a new class. Classification compares a new item with those prototypes. That differs from taking gradient steps on the new task, even if both use a small support set.
In-context learning changes behavior by conditioning on examples in the current input context. Ordinary inference does not update the model’s stored weights. Removing the context removes that particular source of evidence unless some separate memory or learning process retains it.
The source exercise contrasts adding three demonstrations to a prompt with changing model weights. A saved parameter update persists in the saved model; temporary demonstrations do not automatically become weights. A system can combine context, external memory, and parameter learning, so identify what is actually retained.
Learning how to spend learning effort
A meta-learning controller could choose which specialist to adapt, which examples to request, or when retrieval is enough. Such a strategy must be trained and evaluated across relevant tasks. Overfitting the meta-training suite can produce a clever-looking adaptation rule that transfers poorly. The objective is reusable learning behavior, not merely repeated training on one familiar problem.
Which change normally persists after a single inference context is discarded?
Take this idea with you.
Meta-learning optimizes adaptation across a task family. Evaluate a new task after a fixed small budget, and name what changed: shared parameters, task-specific parameters, or temporary context.
Explore related topics and the topic map
How this topic connects
Explore this topic on the interactive mapUse these connections to review a foundation or choose where to go next. You can open any topic without completing the others.
What it builds on
- Weight updates
Recognize when training is improving or overshooting, so you can choose a useful step size instead of guessing.
- Separate evaluation
Avoid choosing a model that memorizes examples but fails on new ones.
- Learning over time
Protect an existing skill while teaching a model a new one, using explicit checks for regressions.
Optimize a starting weight for rapid adaptation, then evaluate adapted copies on a task excluded from meta-training.
What it enables
- Find out whether improvement generalizes
Spot improvements caused by repeated test selection rather than better performance on new situations.
- Change context or change parameters
Tell apart a changed observation or retrieved context from a changed parameter so you can diagnose where adaptation actually happens.
- Measure adaptation cost
Account for fitting examples and adaptation work when comparing shared initialization with a task-specific fit.