Towards Task Sampler Learning for Meta-Learning

Jingyao Wang, Wenwen Qiang, Xingzhe Su, Changwen Zheng, Fuchun Sun, Hui Xiong

This paper challenges a long-held dogma in meta-learning: the idea that more training task diversity always leads to better generalization. By introducing the Adaptive Sampler (ASr), the authors demonstrate that optimal performance requires a nuanced balance of task diversity, entropy, and difficulty, dynamically adjusted throughout the learning process.

TL;DR

The researchers debunk the "diversity is always better" assumption in meta-learning, showing it can lead to overfitting. They propose ASr, a plug-and-play module that dynamically weights training tasks based on three key metrics—diversity, entropy, and difficulty—achieving state-of-the-art results across a vast array of few-shot learning benchmarks.

What Problem Does This Paper Address?

Meta-learning, or "learning to learn," relies on episodic training where a model is exposed to a variety of small tasks to learn generalizable priors. The standard approach is Uniform Sampling, where tasks are chosen randomly. A common belief in the field is that increasing the diversity of these tasks is the key to better generalization.

However, the authors found that this isn't always true. Through empirical analysis, they observed that over-constraining task diversity can lead to under-fitting, while excessive diversity can actually trigger over-fitting, as seen in the training curves below.

Training curves showing how different sampling strategies lead to under-fitting or over-fitting across various scenarios.

The core challenge is that there is no "one-size-fits-all" sampling strategy. Different models and datasets require different task distributions to reach their peak performance.

Methods

The authors propose the Adaptive Sampler (ASr), a lightweight multilayer perceptron (MLP) designed to be integrated into any meta-learning framework. Instead of just picking tasks, ASr assigns an "importance weight" to each sampled task based on three novel measurements:

  1. Task Diversity ($t_{dg}$): Measures feature space enrichment—how much of the overall feature space a task covers.
  2. Task Entropy ($t_{et}$): Quantifies intra-class compaction and inter-class separability—essentially, how "clean" and well-separated the classes are within a task.
  3. Task Difficulty ($t_{df}$): Calculated as the gradient inconsistency between a task's support set and query set, representing how hard it is for the model to generalize within that specific task.

ASr is optimized using a bi-level optimization process. In each episode, the meta-learning model is updated using tasks weighted by ASr. Then, ASr itself is updated based on the model's performance feedback, learning to favor "high-quality" tasks that improve the model's generalization.

Overview of the twelve different task samplers compared in the study, including the proposed Adaptive Sampler (ASr).

Datasets

The researchers conducted an exceptionally thorough evaluation across diverse domains:

  • Image Classification: miniImagenet, Omniglot, tieredImagenet, and CIFAR-FS.
  • Regression: Sinusoid and Harmonic synthetic datasets.
  • Specialized Tasks: Drug activity prediction and pose prediction.
  • Computer Vision: Object detection (Pascal VOC 2007) and semantic segmentation (PASCAL-5i).
  • Domain Shifts: Cross-domain (miniImagenet $\rightarrow$ CUB/Places) and multi-domain (Meta-Dataset).

Key Insights and Ideas

  • The Diversity Myth: Increasing task diversity does not linearly improve performance. High-diversity samplers often cause models to overfit to the training distribution, creating an "inflection point" where performance drops after an initial rise.
  • Three Pillars of Task Quality: Diversity alone is insufficient. High-quality tasks must also have low entropy (tight, separable classes) and manageable difficulty (consistent gradients).
  • No Universal Strategy: Different meta-learning backbones (like MAML vs. ProtoNet) have different "preferences" for task distributions. ASr's strength lies in its ability to adapt to these specific needs automatically.
  • Robustness to Domain Shift: ASr significantly improves performance in cross-domain and multi-domain scenarios, suggesting that proper task weighting helps the model learn more robust, domain-invariant features.

Key Results

ASr consistently outperformed standard uniform sampling and other specialized samplers (like OHTM or GCP) across almost all tested scenarios.

  • Standard Few-Shot: On miniImagenet, ASr improved MAML's accuracy from 48.51% to 51.91% and ProtoNet's from 47.29% to 49.37%.
  • Multi-Domain: In the challenging Meta-Dataset benchmark, ASr achieved a ~1.2% average improvement over state-of-the-art samplers, with a nearly 3% boost for out-of-domain tasks.
  • Efficiency: Despite the extra optimization step, ASr introduces minimal computational overhead, performing similarly to uniform sampling in terms of training time while achieving much higher accuracy.
Comparison of average accuracy across different models and samplers on the miniImagenet dataset.

Limitations and Future Work

The authors do not explicitly detail major limitations in the paper. However, the reliance on gradient-based difficulty measures implies that ASr is most naturally suited for optimization-based meta-learners, though they successfully adapted it for metric-based and Bayesian models as well. Future work could explore even more complex task quality metrics or investigate how ASr behaves in extremely large-scale meta-learning regimes.

Summary updated

BibTeX
@article{wang2024towards,
  author = {Jingyao Wang and Wenwen Qiang and Xingzhe Su and Changwen Zheng and Fuchun Sun and Hui Xiong},
  title = {{Towards Task Sampler Learning for Meta-Learning}},
  journal = {Int. J. Comput. Vis.},
  year = {2024},
  url = {https://openreview.net/forum?id=VcJrySO71d},
}
Figure