Paper commentary
Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networks
Meta-learning trains starting weights that adapt to new tasks in a few steps
- Problem Few-shot learners often rely on update rules or specific architectures, so they are hard to extend beyond classification. Learning a new task from only a few samples needs a method that works across problem types.
- Method MAML trains a model's starting parameters so that one or a few gradient steps on a new task give good performance. Instead of learning an update rule, it keeps ordinary gradient descent and optimizes the point where that learner starts.
- Results On 5-way 1-shot Omniglot, MAML scored 98.7± 0.4%, compared to 98.1% for matching nets.
Why few-shot adaptation is hard
Learning from a few examples is hard because the learner must combine what it already knows with a small amount of new data without overfitting to that data. Earlier meta-learning work often learns an update rule, or it requires a specific architecture such as a recurrent model or a Siamese network. Recurrent learners that ingest whole datasets, and embedding methods that match new examples at test time, work well for classification but are hard to extend to other problems such as reinforcement learning.
The authors treat the problem as meta-learning, where whole tasks serve as training examples. A new task is drawn from a task distribution and learned from K samples, and the test error on sampled tasks acts as the training signal for the meta-learner.
Training a starting point that adapts well
The key idea is to train the model's initial parameters so that one or a few gradient steps on a new task already give good performance on that task. Instead of learning an update rule, the method keeps ordinary gradient descent as the learner and optimizes the point from which that learner starts. Because the model is fine-tuned with gradient descent, the training objective is set to match that fine-tuning step.
The authors reason that some internal representations transfer across tasks better than others, so a training signal aimed at fast adaptation should favour shared features. Viewed through sensitivity, the method pushes the parameters toward a region where small changes produce large improvements in the loss of new tasks. The method adds no learned parameters for meta-learning and places no constraint on the architecture.
How one meta-update runs
For each sampled task, the method takes one gradient step from the shared parameters to get task-adapted parameters. The adapted parameters are \(\theta'_i = \theta - \alpha \nabla_\theta \mathcal{L}_{\mathcal{T}_i}(f_\theta)\), where the step size \(\alpha\) is either fixed or meta-learned. This inner step is the only thing the task loss is evaluated on during adaptation, so the learner itself is unchanged.
The meta-objective then evaluates each adapted model on the task's loss, and the losses are summed over the batch. The shared parameters move against the gradient of that sum, so \(\theta \leftarrow \theta - \beta \nabla_\theta \sum_{\mathcal{T}_i} \mathcal{L}_{\mathcal{T}_i}(f_{\theta'_i})\), with \(\beta\) as the meta step size. Because the gradient passes through the inner step, the update needs second derivatives, which are computed as Hessian-vector products.
For supervised tasks the loss is mean-squared error for regression or cross-entropy for classification, computed on K input-output pairs per task. For reinforcement learning the loss is the negative expected reward of the policy, so its gradient is estimated with policy gradients. Each extra adaptation step then needs fresh trajectories from the current policy, which is why the reinforcement learning version samples new rollouts at each step.
Sine wave regression
Each task is a sine wave whose amplitude varies within [0.1, 5.0] and whose phase varies within [0, π]. The regressor is a network with 2 hidden layers of size 40 and ReLU nonlinearities, trained with one gradient update, K = 10 examples and a fixed step size α = 0.01. Adam serves as the meta-optimizer, and the pretraining baselines are trained with Adam too.
Pretraining on all tasks, then fine-tuning, is the main comparison, and the authors evaluate both models with K = 5, 10 and 20 datapoints. With only 5 datapoints the MAML-trained model adapts, while the pretrained model cannot adapt without catastrophic overfitting.
The loss keeps falling with more gradient steps at meta-test time, even though training optimized for performance after one step.
Few-shot image classification
The authors use Omniglot, which has 1623 characters from 50 alphabets, and MiniImagenet, which has 64 training classes, 12 validation classes and 24 test classes. They follow the N-way, 1-shot or 5-shot protocol of matching networks, and for Omniglot they randomly select 1200 characters for training. The convolutional model uses 64 filters per layer on Omniglot and 32 filters per layer on MiniImagenet to limit overfitting.
On 5-way 1-shot Omniglot, MAML scored 98.7± 0.4%, compared to 98.1% for matching nets. At 5-shot it scored 99.9± 0.1%, compared to 98.9% for matching nets, so the margin over the strongest prior method is small. The Omniglot numbers may not be strictly comparable, because the prior work's train and test splits were not available to the authors.
The authors note that MAML adds no parameters beyond the classifier itself, which the matching networks and the meta-learner LSTM do not match.
Whether the second-order term is needed
The first-order approximation drops the second derivatives but still computes the meta-gradient at the post-update parameters. On MiniImagenet 5-way 1-shot it scored 48.07± 1.75%, compared to 48.70± 1.84% for full MAML. At 5-shot it scored 63.15± 0.91%, compared to 63.11± 0.92% for full MAML.
The authors conclude that most of the gain comes from gradients at the post-update parameters, not from differentiating through the update. They point to earlier work showing ReLU networks are locally almost linear as a partial explanation, since second derivatives would then be close to zero. Skipping the Hessian-vector product pass gave roughly 33% speed-up in network computation.
Reinforcement learning tasks
In 2D navigation a point agent must reach a goal chosen randomly in a unit square, with actions clipped to [−0.1, 0.1] and a horizon of 100. The authors report that MAML adapts much more quickly in a single update than pretraining or random initialization, and keeps improving with more updates.
In the locomotion tasks a planar cheetah and a 3D ant must run at a goal velocity or in a goal direction, with a horizon of 200. The method uses 20 rollouts per gradient step for most problems and 40 for the ant forward/backward task. MAML reached good returns in two or three gradient steps, and pretraining was in some cases worse than random initialization.
The gradient updates use vanilla policy gradient (REINFORCE), and TRPO serves as the meta-optimizer with a two-hidden-layer policy of 100 units. To avoid third derivatives, the authors compute the Hessian-vector products for TRPO by finite differences.
Limitations
The meta-gradient requires an extra backward pass through the model for Hessian-vector products, which adds computation to each meta-update. The first-order variant was compared only on MiniImagenet, so its equivalence to full MAML is shown on that benchmark alone.
The experiments cover one sine family, two few-shot image benchmarks and two simulated locomotion tasks, plus 2D navigation. The networks used are fully connected and convolutional, and the reinforcement learning policies are small fully connected networks. The method also requires the loss to be smooth enough in the parameters for gradient-based learning to apply.
Paper info
- Authors
- Chelsea Finn, Pieter Abbeel, Sergey Levine
- Venue
- arXiv · Preprint
- First published
- 2017-3-9
- Added
- 2026-11-6
- Updated
- 2017-7-18
- Version
- v3
- arXiv
- 1703.03400
- Category
- cs.LG · cs.AI · cs.CV · cs.NE
- Original paper terms
- arXiv non-exclusive 1.0
- What we show
- Paper info and commentary
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Quote from the paper
Chelsea Finn, Pieter Abbeel, Sergey Levine (2017). Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networks. arXiv:1703.03400v3. https://arxiv.org/abs/1703.03400v3
BibTeX
@misc{finn2017model,
title = {{Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networks}},
author = {Chelsea Finn and Pieter Abbeel and Sergey Levine},
year = {2017},
eprint = {1703.03400},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1703.03400v3}
}