Gradient-Based Meta-Learning Using Uncertainty to Weigh Loss for Few-Shot Learning

Lin Ding, Peng Liu, Wenfeng Shen, Weijia Lu, Shengbo ChenarXiv 2022 · DOI

Introduction

Few-shot learning (FSL) aims to enable models to adapt to novel tasks using only a handful of labeled examples. Model-Agnostic Meta-Learning (MAML) has emerged as a powerful framework for FSL by learning a global parameter initialization that facilitates rapid adaptation. However, vanilla MAML often struggles with two critical issues: task-specific uncertainty and the assumption of uniform task importance. Small support sets can lead to overfitting or imprecise task models, while treating all tasks in a batch equally ignores the inherent noise and varying difficulty levels across tasks, leading to unstable gradients.

Methodology

To address these challenges, this work proposes a refined meta-learning pipeline that incorporates adaptive initialization and sophisticated task weighting.

Consolidated Task-Specific Initialization

Instead of a single global initialization $\theta$, the proposed method maintains a pool of parameters $\{\theta_0\}$ from previous iterations. For each new task, the learner adaptively selects the most suitable initialization from this collection—specifically, the one that minimizes the initial task loss. This approach allows the model to leverage task-related subspaces, making it more sensitive to diverse task distributions.

Loss Weighting Mechanisms

The core contribution lies in how tasks are weighted during the meta-update. The authors explore two primary methods:

  1. Contrast Meta-Loss Weighting: A heuristic approach that compares performance on the support set ($lossk$) against the query set ($losskt$). If a task shows low training loss but high test loss, it is assigned a higher weight $m_i$ to prioritize its optimization and improve generalization.
  2. Homoscedastic Uncertainty Weighting: Drawing from multi-task learning, this method treats task-specific noise as homoscedastic uncertainty. By introducing a learnable noise scalar $\sigma$ for each task, the model automatically balances multiple losses, effectively down-weighting tasks with high inherent noise.
Figure 2: The overall architecture of the proposed meta-learning framework, illustrating the task-specific initialization selection and the weight generation process for meta-updates.

The Weight Generator, detailed in the framework, dynamically calculates the importance $m_i$ for each task $i$ before weight normalization and the final parameter update.

Figure 1: Detailed flowchart of the Weight Generator implementing the Contrast Meta-Loss Weighting logic.

Experimental Evaluation

The proposed methods were evaluated on standard benchmarks:

  • 1D Sine Wave Regression: Testing the ability to recover a function from 10 data points.
  • miniImageNet & tieredImageNet: Challenging few-shot classification tasks involving 100 and 608 semantic classes, respectively.

Results and Discussion

The "Homoscedastic Uncertainty" weighting method consistently outperformed vanilla MAML and other state-of-the-art baselines. On miniImageNet (5-way, 5-shot), the model achieved 71.62% accuracy (vs. MAML's 63.11%), and on tieredImageNet (5-way, 5-shot), it reached 74.08% (vs. MAML's 70.30%).

Beyond raw accuracy, the proposed approach demonstrated significant robustness. While vanilla MAML is highly sensitive to hyperparameters like learning rate and query set size, the uncertainty-weighted model remained stable across varying conditions. This suggests that accounting for task uncertainty effectively regularizes the meta-learning process.

Conclusion

By moving away from uniform task weighting and single-point initialization, this research provides a more nuanced approach to meta-learning. The integration of homoscedastic uncertainty allows the model to discern which tasks are most informative for the global update, leading to improved generalization and robustness in few-shot scenarios. Future work will explore handling "negative migration" between tasks and applying these techniques to more complex neural architectures.

Summary updated

BibTeX
@misc{ding2022gradient,
  author = {Lin Ding and Peng Liu and Wenfeng Shen and Weijia Lu and Shengbo Chen},
  title = {{Gradient-Based Meta-Learning Using Uncertainty to Weigh Loss for Few-Shot Learning}},
  year = {2022},
  eprint = {2208.08135},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2208.08135},
}
Figure