AAAI 2024

Any-Way Meta Learning

Junhoo Lee, Yearim Kim, Hyunho Lee, Nojun Kwak

Seoul National University

Yearim Kim and Hyunho Lee contributed equally.

Any-Way Meta Learning reframes episodic supervision around label equivalence. Once semantic classes are decoupled from the temporary numeric labels assigned inside each episode, the learner no longer needs to inherit a fixed-way classifier head from training time.

Task sampling figure for Any-Way Meta Learning.

Abstract

Meta-learning is usually trained and evaluated under a fixed N-way setup, even though real few-shot tasks do not arrive with a single, immutable class cardinality.

Any-Way Meta Learning starts from the observation that episodic numeric labels are exchangeable: the same semantic class can be mapped to different numeric labels across episodes, so the classifier should not have to inherit a fixed-way bottleneck from training.

The paper turns that observation into an any-way training recipe, then adds semantic supervision and mixup-style regularization to recover class-level structure that pure label equivalence would otherwise discard.

Method Overview

The method replaces the usual fixed N-way classifier with a larger output pool of size O. For each episode, the algorithm samples a task cardinality N, draws non-overlapping numeric-label assignments from that output pool, and optimizes the same underlying task through multiple label views.

In the paper's main setup, training episodes vary across 3, 5, 7, and 9 ways while testing still includes 10-way evaluation. This lets the model learn across task cardinalities instead of specializing to only one of them.

Because pure label equivalence can wash out semantic structure, the framework also adds a semantic classifier and mixup-style supervision to re-inject class meaning when needed.

Overall method overview for Any-Way Meta Learning.
The any-way classifier reuses a larger output pool and couples it with a semantic branch to retain class-level meaning.
Semantic class to numeric class equivalence illustration.
A single semantic class can land on different numeric labels across episodes, which is the label-equivalence intuition behind any-way training.

Benchmark Highlights

Across MiniImageNet, TieredImageNet, Cars, and CUB, the paper shows that any-way MAML matches or surpasses fixed-way MAML on both in-domain and cross-domain evaluations. The gains are especially noticeable when the test-time way differs from the training episodes or when the task is fine-grained.

The central point is not only higher peak accuracy, but also broader operating range: the same learner can handle multiple task cardinalities without being retrained for each specific way.

79.30%

TieredImageNet, 3-way, 5-shot

a-MAML improves over fixed-way MAML at 73.16% while training and testing on the same benchmark.

70.42%

Cars, 5-way, 5-shot

Any-way training beats fixed-way MAML at 66.59% on a fine-grained in-domain evaluation.

57.29%

Cars to Mini, 3-way, 5-shot

Cross-domain transfer stays stronger than fixed-way MAML at 51.91%, supporting the domain-generalization claim.

No corruption

10-way, 1-shot stability

The paper reports repeated training failures for fixed-way MAML, while a-MAML with O=30 remained stable.

Analysis

The paper explains the improvement through two complementary effects. First, any-way training escapes the early optimization stall faster than fixed-way training, which shows up clearly in the validation curves. Second, every new numeric-label assignment acts like an almost-free ensemble member, so the model keeps gaining robustness as more assignments or output nodes are used.

Semantic supervision further helps when transferring across related but not identical datasets, especially once the benchmarks become more fine-grained.

Convergence plot comparing fixed-way and any-way MAML.
a-MAML moves through the start-up stall earlier and reaches higher validation accuracy than fixed-way MAML in both 1-shot and 5-shot settings.

65.00 -> 66.99

MiniImageNet ensemble gain

Increasing assignment sets in the ensemble view consistently improves 5-way MiniImageNet accuracy for a-MAML.

47.66 -> 49.82

Cars ensemble gain

The same free-ensemble effect transfers to Cars, where more assignment sets also improve performance.

63.91 / 66.71 / 66.73

MiniImageNet 5-way with O=10 / 20 / 30

Larger output pools help because they unlock more assignment diversity and stronger ensemble behavior.

65.41 -> 66.89

Fixed-way + semantic on Mini to Mini

Injecting semantic class information improves meta-learning even when the base learner is still fixed-way.

BibTeX

@misc{lee2024anywaymetalearning,
  title={Any-Way Meta Learning},
  author={Junhoo Lee and Yearim Kim and Hyunho Lee and Nojun Kwak},
  year={2024},
  eprint={2401.05097},
  archivePrefix={arXiv},
  primaryClass={cs.LG},
  url={https://arxiv.org/abs/2401.05097},
}