Skip to main content
QUICK REVIEW

[Paper Review] MAML is a Noisy Contrastive Learner in Classification

Chia-Hsiang Kao, Wei-Chen Chiu|arXiv (Cornell University)|Jun 29, 2021
Domain Adaptation and Few-Shot LearningComputer Science5 citations
TL;DR

This paper reveals that Model-Agnostic Meta-Learning (MAML) functions as a noisy contrastive learner in few-shot classification, where support and query features are pulled together or pushed apart based on class labels. By introducing the zeroing trick—zeroing the final linear layer before testing—the method reduces interference from random initialization and improves generalization, achieving consistent accuracy gains on mini-ImageNet and Omniglot datasets.

ABSTRACT

Model-agnostic meta-learning (MAML) is one of the most popular and widely adopted meta-learning algorithms, achieving remarkable success in various learning problems. Yet, with the unique design of nested inner-loop and outer-loop updates, which govern the task-specific and meta-model-centric learning, respectively, the underlying learning objective of MAML remains implicit and thus impedes a more straightforward understanding of it. In this paper, we provide a new perspective of the working mechanism of MAML. We discover that MAML is analogous to a meta-learner using a supervised contrastive objective. The query features are pulled towards the support features of the same class and against those of different classes. Such contrastiveness is experimentally verified via an analysis based on the cosine similarity. Moreover, we reveal that vanilla MAML has an undesirable interference term originating from the random initialization and the cross-task interaction. We thus propose a simple but effective technique, zeroing trick, to alleviate the interference. Extensive experiments are conducted on both mini-ImageNet and Omniglot datasets to demonstrate the consistent improvement brought by our proposed method, validating its effectiveness.

Motivation & Objective

  • To uncover the implicit learning objective of MAML in few-shot classification.
  • To analyze how inner and outer loop updates collaboratively shape model representations.
  • To identify and mitigate interference from random initialization and cross-task interactions in MAML.
  • To validate the effectiveness of the zeroing trick in reducing channel memorization and improving generalization.
  • To demonstrate that MAML's behavior aligns with supervised contrastive learning under specific conditions.

Proposed method

  • The paper frames MAML as a supervised contrastive learner by analyzing the inner and outer loop dynamics using cosine similarity and feature-level analysis.
  • It introduces the zeroing trick: setting the final linear layer weights to zero before testing to reduce interference from random initialization.
  • The method evaluates performance on 5-way 1-shot and 5-way 5-shot few-shot classification tasks using mini-ImageNet and Omniglot datasets.
  • The authors use first-order MAML (FOMAML) and second-order MAML (SOMAML) with standard hyperparameters and training protocols.
  • They compare models trained with random initialization versus zero-initialized weights and apply the zeroing trick at inference time.
  • Experiments include ablation studies on non-mutually exclusive tasks to evaluate channel memorization and interference.

Experimental results

Research questions

  • RQ1How does MAML’s bi-level optimization mechanism implicitly implement a contrastive objective?
  • RQ2What role do support and query features play in shaping the model’s representation during meta-training?
  • RQ3How does random initialization contribute to interference in MAML, and can it be mitigated?
  • RQ4Does the zeroing trick effectively reduce interference and improve few-shot generalization?
  • RQ5To what extent does MAML’s behavior resemble supervised contrastive learning?

Key findings

  • MAML’s outer loop loss implicitly implements a supervised contrastive objective by pulling query features toward same-class support features and pushing them away from different-class features.
  • The zeroing trick—zeroing the final linear layer before testing—significantly improves few-shot classification accuracy on both mini-ImageNet and Omniglot.
  • On mini-ImageNet, the zeroing trick improves 5-way 1-shot accuracy by up to 2.5% and 5-way 5-shot by up to 1.8% compared to random initialization.
  • On Omniglot, the zeroing trick yields consistent improvements, with performance gains more pronounced in the 5-way 5-shot setting.
  • The method effectively mitigates channel memorization in non-mutually exclusive task settings, reducing interference from cross-task interactions.
  • Empirical results show that models with zero-initialized linear layers perform similarly to those with the zeroing trick at inference, confirming its effectiveness in reducing bias from initialization.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.