Source-linked AI summary

Generalized Inner Loop Meta-Learning

Edward Grefenstette, Brandon Amos, Denis Yarats, Phu Mon Htut, Artem Molchanov, Franziska Meier, Douwe Kiela, Kyunghyun Cho, Soumith Chintala

arXiv:1910.01727v2cs.LGstat.ML

TL;DR

Meta-learning approaches often share a nested optimization structure, but this common pattern lacks a general formal treatment. The paper formalizes it as GIMLI, proves its requirements, derives an implementation algorithm, and provides the higher library; it then demonstrates applications through experiments and ablations.

  • Problem

    Many approaches called meta-learning follow a shared nested optimization pattern, but the term and underlying process have been used with some underspecification.

  • Method

    The paper formalizes Generalized Inner Loop Meta-Learning (GIMLI), characterizes its requirements, derives an update algorithm, and implements the framework in the higher PyTorch library.

  • Results

    The paper shows that meta-gradients can be obtained by composing gradient paths through the inner loop, with Requirement II directly proved for SGD and ADAGRAD and supported for wider common optimizers in the library.

  • Takeaways & Limitations

    GIMLI and higher provide theoretical and practical tools for implementing and exploring a broad class of meta-learning approaches.

  • Takeaways & Limitations

    Existing stateful modules and in-place optimizer updates are not automatically tracked by framework gradient graphs, requiring stateless or differentiable replacements for higher-order optimization.

Abstract

from arXiv · show

Many (but not all) approaches self-qualifying as "meta-learning" in deep learning and reinforcement learning fit a common pattern of approximating the solution to a nested optimization problem. In this paper, we give a formalization of this shared pattern, which we call GIMLI, prove its general requirements, and derive a general-purpose algorithm for implementing similar approaches. Based on this analysis and algorithm, we describe a library of our design, higher, which we share with the community to assist and enable future research into these kinds of meta-learning approaches. We end the paper by showcasing the practical applications of this framework and library through illustrative experiments and ablation studies which they facilitate.

1 INTRODUCTION

The paper addresses underspecified meta-learning terminology by formalizing a shared nested-optimization pattern as GIMLI. It also derives implementation tools and presents higher as practical support for further research.

  • The framework targets meta-learning methods that can improve performance beyond a single task, static dataset, or limited data regime.
  • GIMLI formalizes a general process shared by several recent meta-learning approaches and provides tools for analyzing its requirements.The authors explicitly frame this as a unifying formulation rather than a claim of ownership or precedence.
  • The paper derives a general algorithm for implementing meta-learning approaches that fit within the GIMLI framework.
  • The higher library enables straightforward implementation in canonical PyTorch with minimal changes to existing codebases.It supports third-party modules and a variety of optimizers.

2 GENERALIZED INNER LOOP META-LEARNING

GIMLI formalizes meta-learning as nested optimization: an outer loop adjusts meta-variables so an inner training process produces model parameters optimized for validation performance. The paper specifies differentiability requirements and an algorithm for computing meta-gradients through the inner loop.

  • Definitions: GIMLI represents meta-learning as an outer optimization over meta-variables that control an inner optimization of model parameters.The inner loop produces parameters θ∗, which are evaluated using a validation objective.
  • Definitions: Meta-parameters can include optimization settings, loss-related variables, task-loss weights, regularization terms, or model initialization.The paper partitions them into ϕopt and ϕloss.
  • Meta-training: The outer loop evaluates θ∗ with Lval, backpropagates ∇ϕLval(θ∗) through the inner loop, and updates the meta-variables.The inner process need not run to convergence; intermediate parameters may be selected by a validation criterion or training budget.
  • Training: The inner loop computes step-specific losses and gradients, then applies an optimizer repeatedly to obtain θ∗, potentially depending on parameter history and meta-parameters.An SGD instance uses θt+1 = θt − ϕopt · Gt.
  • Key requirements: Gradient-based GIMLI requires differentiable validation loss, a differentiable optimizer in θ and G, and differentiable dependence on optimization or loss meta-parameters.These are requirements I–III, with the third satisfied through differentiable optimization hyperparameters or loss gradients depending on ϕloss.
  • Requirements and algorithm: The paper shows that meta-gradients can be composed across all inner-loop gradient paths and proves requirement II for SGD and ADAGRAD.Algorithm 1 uses stop-gradient to separate paths and supports exact, efficient updates through the nested process.

3 EXAMPLES AND RELATED WORK

The paper situates GIMLI across diverse meta-learning problems, including hyperparameter and optimizer learning, few-shot initialization learning, and parametric loss learning. It distinguishes its formal and implementation focus from related frameworks and libraries.

  • Scope: The related-work discussion uses GIMLI to identify shared structure across diverse meta-learning approaches rather than provide a comprehensive literature review.The examples are selected to show which approaches fit the framework and why.
  • Examples: Gradient-based hyperparameter learning meta-optimizes continuous hyperparameters against a meta-objective as an alternative to grid search, random search, or Bayesian optimization.
  • Examples: Learning an optimizer wholesale treats the optimizer’s parameters as ϕopt, with differentiability requirements met when the optimizer model has differentiable parameters and outputs.
  • Examples: MAML-style methods fit GIMLI by treating the initial model parameters θ0 as loss-related meta-variables updated through the unrolled inner optimization.
  • Examples: ML3 fits GIMLI by learning a parametric model of the inner loss through second-order gradients of a meta-loss.
  • Related approaches: Franceschi et al. formalize related meta-learning and hyperparameter optimization methods as bilevel optimization, while learn2learn mainly provides extensible implementations of existing algorithms and training loops.The paper positions its own library as closer to the underlying implementation requirements of GIMLI.

4 THE higher LIBRARY

higher is a PyTorch library for implementing GIMLI by addressing stateful model parameters and non-differentiable optimizer updates. It tracks parameter states and supports differentiable optimizer unrolling while reducing the need to rewrite models or optimizers.

  • Library design: higher targets GIMLI implementations in PyTorch with minimal reliance on non-vanilla PyTorch.The library is designed to support implementations of GIMLI while preserving familiar PyTorch usage.
  • Obstacles: Stateful model implementations prevent direct tracking and backpropagation through successive inner-loop parameter values.Their parameters are encapsulated in the model and cannot be trivially overridden at call time.
  • Obstacles: Frameworks commonly fail to track gradient dependencies through in-place optimizer updates, preventing practical satisfaction of GIMLI’s differentiability requirement.This behavior is memory-efficient but discards historical parameter and intermediate-state dependencies after updates.
  • Making stateful modules stateless: Rewriting models as stateless functions enables parameter-state tracking but makes experimentation with third-party, complex, or pretrained models onerous.The approach requires reimplementation whenever researchers explore new model codebases.
  • Making stateful modules stateless: higher.monkeypatch() modifies a module’s runtime parent class so existing stateful modules can operate effectively as functions.The method accepts a torch.nn.Module instance and its nested sub-module structure.
  • Making optimizers differentiable: higher.get_diff_optim() replaces in-place optimizer logic with gradient-tracking updates and preserves optimizer state for safe inner-loop unrolling.Most torch.optim optimizers are covered by this method.

5 EXPERIMENTS

The experiments use higher to simplify meta-learning learning-rate optimization and MAML++ ablations across architectures and inner optimizers. They illustrate how the library supports changing experimental components without repeatedly reimplementing functional models or differentiable optimization steps.

  • Experimental applications: higher supports ablation studies and searches over model architectures, optimizers, and other experimental choices.Without the library, changing these components requires reimplementing the model functionally or the optimization step differentiably.
  • Meta-learning learning rates: Meta-learning replaces DenseNet-BC(k=12)’s hand-designed learning-rate schedule with automatically adjusted per-parameter-group learning rates.The setup uses 299 parameter-group learning rates for meta-optimization.
  • Meta-learning learning rates: Meta-learned learning rates converge near state-of-the-art with better sample complexity than a hand-designed annealing schedule on CIFAR10.Figure 1 compares meta-learned rates with fixed and multi-step annealed rates for DenseNet-BC(k=12).
  • MAML++ ablations: The library enables exploration of new MAML-like models and inner-loop optimizers without repeatedly implementing fast weights for both components.Such ablations can support architecture and optimizer comparisons on established tasks.
  • MAML++ ablations: MAML++ ablations compare VGG, ResNet, and DenseNet models with SGD and Adam inner optimizers on Omniglot and Mini-Imagenet.The study retains most MAML++ features and reports a substantial base VGG+SGD improvement from using batch normalization in training mode.

6 CONCLUSION

The paper presents GIMLI as a general formulation and algorithmic framework for a broad class of meta-learning approaches, alongside higher as a lightweight PyTorch library. Experiments demonstrate potential applications of these mathematical and software tools.

  • Conclusion: GIMLI formulates a wide class of existing and potential meta-learning approaches and specifies their requirements and general algorithm.The paper also presents higher as a lightweight PyTorch extension for implementing these approaches at scale.

A.1 SGD

For SGD, the paper expresses the parameter update as a differentiable function involving the current parameters, gradients, and learning rate. The resulting derivative includes a Hessian-dependent term.

  • SGD: The SGD update is θt+1 = θt − αGt, with its derivative containing the term 1 − α∇².The displayed derivation differentiates the update with respect to θt.

A.2 ADAGRAD

The passage states when the meta-gradient of the global learning rate η is defined, depending on whether η is included among the meta-parameters ϕ.

  • ∇ϕη is defined if and only if η is included in ϕ; otherwise, the displayed gradient expression uses G_t and the accumulated squared gradients.

B MAML++ EXPERIMENTS: ADDITIONAL INFORMATION

The experiments compare reduced architectures and inner optimizers, while reporting learned learning-rate and momentum behavior; the sweep omits runs that did not complete within the stated resource limit.

  • Table 2 reports the architectures and optimizers included in the MAML++ ablation sweep.
  • The experiments omit some sweep rows because only configurations completing three seeds within three days were reported.
  • The evaluated model set includes smaller VGG, ResNet, and DenseNet variants adapted for few-shot classification.
  • For the 20-way 1-shot Omniglot experiment with ResNet-4, most learned SGD learning rates approach zero except for a few parameters, while Adam additionally separates β2 values into low and high regions.
Loading 1910.01727v2…