Meta-Learning via Classifier(-free) Diffusion Guidance

Elvis Nava, Seijin Kobayashi, Yifei Yin, Robert K. Katzschmann, Benjamin F Grewe

Abstract: We introduce meta-learning algorithms that perform zero-shot weight-space adaptation of neural network models to unseen tasks. Our methods repurpose the popular generative image synthesis techniques of natural language guidance and diffusion models to generate neural network weights adapted for tasks. We first train an unconditional generative hypernetwork model to produce neural network weights; then we train a second "guidance" model that, given a natural language task description, traverses the hypernetwork latent space to find high-performance task-adapted weights in a zero-shot manner. We explore two alternative approaches for latent space guidance: "HyperCLIP"-based classifier guidance and a conditional Hypernetwork Latent Diffusion Model ("HyperLDM"), which we show to benefit from the classifier-free guidance technique common in image generation. Finally, we demonstrate that our approaches outperform existing multi-task and meta-learning methods in a series of zero-shot learning experiments on our Meta-VQA dataset.

Introduction

Traditional meta-learning (the "learning to learn" field) usually focuses on few-shot adaptation: given a few examples of a new task, how can a model quickly update its parameters to solve it? However, humans often don't even need examples; we can solve a task just by reading instructions (zero-shot).

While Large Language Models (LLMs) have shown impressive zero-shot capabilities through in-context learning, applying this to specialized neural network architectures remains difficult. Most meta-learning algorithms (like MAML) are grounded in optimization and require data points to compute gradients. This paper asks: Can we instead treat task adaptation as a generative problem, where we "hallucinate" the optimal weights for a task based on a text prompt?

Conceptual comparison between traditional gradient descent and the proposed guided diffusion for weight adaptation.

Methods

The authors propose a two-phase approach to generate neural network weights ($W$) for a base model ($f$):

1. Unconditional Pre-training

They first train a Hypernetwork (either a Variational Autoencoder or a MAML-based initialization) to map a low-dimensional latent space to the high-dimensional weight space of a base model. This creates a "manifold" of functional neural networks.

2. The Guidance Phase

Once the hypernetwork is trained, they introduce two ways to navigate its latent space using natural language:

  • HyperCLIP Guidance: They train a weight-encoder that maps neural network weights into the same embedding space as CLIP. To adapt to a new task, they perform gradient descent in the latent space to find weights whose HyperCLIP embedding matches the CLIP embedding of the task's text description.
  • HyperLDM (Hypernetwork Latent Diffusion Model): Inspired by Stable Diffusion, they train a diffusion model to iteratively denoise a latent vector, conditioned on a task's text embedding. They also apply classifier-free guidance, a popular trick in image generation, to push the generated weights to be more "task-aligned."
Architectural overview of (A) the VAE hypernetwork, (B) HyperCLIP guidance, and (C) the HyperLDM framework.

Datasets and Experimental Setup

To evaluate their approach, the authors introduced the Meta-VQA benchmark by modifying the VQA v2.0 (Visual Question Answering) dataset. They grouped question-image-answer triples by unique questions (e.g., "What color is the rug?"). Each unique question becomes a "task," and the goal is to classify images correctly based on that specific question. The dataset contains 1,234 unique tasks (870 for training, 373 for testing) with over 100,000 image-answer pairs.

Key Results and Insights

The authors evaluated their methods on the Meta-VQA dataset in a zero-shot setting (no image examples provided at test time, only the question text):

  • Performance Boost: Their best model (HVAE + HyperLDM) achieved 55.10% accuracy, significantly higher than the 44.99% baseline of a standard zero-shot CLIP model and traditional conditional multi-task learning (54.12%).
  • Weights as a Modality: A striking insight is treating "model parameters" as just another data modality (like images or audio) that can be aligned with text using contrastive learning (CLIP).
  • Diffusion > Optimization: Just as diffusion models have overtaken GANs in image synthesis, HyperLDM proved more powerful and stable than simple CLIP-based gradient guidance for finding task-specific weights. Increasing the classifier-free guidance scale improved performance, suggesting that "over-emphasizing" the task description helps the model find more specialized weights.
  • Robustness to Missing Labels: In a "limited descriptor" experiment where only 10% of training tasks had text descriptions, HyperLDM maintained high performance while standard multi-task models collapsed, proving the value of the unconditional pre-training phase.

Limitations and Future Work

Generating weights for massive models (like full Transformers) remains a challenge due to memory constraints and hypernetwork complexity. Furthermore, the iterative nature of diffusion makes inference slower compared to a single forward pass of a multitask network. Future directions include exploring the scaling behavior of these techniques and applying them to domains like robotics, where a robot might adapt its control weights based on verbal instructions.

Summary updated

BibTeX
@article{nava2023meta,
  author = {Elvis Nava and Seijin Kobayashi and Yifei Yin and Robert K. Katzschmann and Benjamin F Grewe},
  title = {{Meta-Learning via Classifier(-free) Diffusion Guidance}},
  journal = {Accepted by TMLR},
  year = {2023},
  url = {https://openreview.net/forum?id=1irVjE7A3w},
}
Figure