Meta-Learning with MAML on Trees

Jezabel R. Garcia, Federica Freddi, Feng-Ting Liao, Jamie McGowan, Tim Nieradzik, Da-Shan Shiu, Ye Tian, Alberto BernacchiaarXiv 2021

Abstract

In meta-learning, the knowledge learned from previous tasks is transferred to new ones, but this transfer only works if tasks are related. Sharing information between unrelated tasks might hurt performance, and it is unclear how to transfer knowledge across tasks with a hierarchical structure. Our research extends a model agnostic meta-learning model, MAML, by exploiting hierarchical task relationships. Our algorithm, TreeMAML, adapts the model to each task with a few gradient steps, but the adaptation follows the hierarchical tree structure: in each step, gradients are pooled across tasks clusters, and subsequent steps follow down the tree. We also implement a clustering algorithm that generates the tasks tree without previous knowledge of the task structure, allowing us to make use of implicit relationships between the tasks. We show that the new algorithm, which we term TreeMAML, performs better than MAML when the task structure is hierarchical for synthetic experiments. To study the performance of the method in real-world data, we apply this method to Natural Language Understanding, we use our algorithm to finetune Language Models taking advantage of the language phylogenetic tree. We show that TreeMAML improves the state of the art results for cross-lingual Natural Language Inference. This result is useful, since most languages in the world are under-resourced and the improvement on cross-lingual transfer allows the internationalization of NLP models. This results open the window to use this algorithm in other real-world hierarchical datasets.

Introduction

Meta-learning, or "learning to learn," enables models to adapt to new tasks with minimal data. However, standard algorithms like Model-Agnostic Meta-Learning (MAML) typically treat tasks as independent, ignoring potential hierarchical relationships. This "flat" approach can lead to negative transfer, where information from unrelated tasks degrades performance, and fails to leverage structural knowledge that could reduce noise during adaptation.

TreeMAML is a novel extension designed to address these gaps by exploiting hierarchical task structures. By pooling gradients across task clusters at different levels of a tree, TreeMAML significantly improves performance in data-scarce scenarios, such as cross-lingual Natural Language Inference (NLI).

Methodology: Hierarchical Adaptation

TreeMAML modifies the MAML inner loop—the task-specific adaptation step. Instead of updating parameters for each task in isolation, the algorithm follows a tree structure.

Comparison of (a) standard MAML adaptation and (b) TreeMAML's hierarchical adaptation structure.

Gradient Pooling and Clustering

  • Hierarchical Gradient Pooling: At each inner loop step, gradients are averaged across clusters of related tasks. As adaptation progresses, the algorithm moves "down the tree," becoming increasingly task-specific.
  • Fixed vs. Learned Structures: The algorithm can use a pre-defined hierarchy (Fixed TreeMAML), such as a phylogenetic language tree, or discover one on the fly (Learned TreeMAML). The latter utilizes a modified Online Top-Down (OTD) clustering algorithm to group tasks based on gradient similarity, capturing implicit relationships like shared genres or loanwords.

Experimental Evaluation

The researchers evaluated TreeMAML using both synthetic benchmarks and real-world NLP data.

Datasets

  1. Synthetic Benchmark: A multidimensional linear regression task where tasks were sampled from four hierarchical clusters.
  2. XNLI (Cross-lingual Natural Language Inference): A dataset of 15 languages. The study focused on 12 languages fitting a phylogenetic tree (e.g., Germanic, Romance, Indo-Aryan). Tasks combined a language with a specific genre (e.g., "French + Government").

Results and Discussion

TreeMAML demonstrated superior performance, particularly when data was scarce. On the synthetic task, it nearly halved the Mean Squared Error (MSE) compared to standard MAML when only five data points were available.

MSE comparison on synthetic data across different noise levels (0.1 and 0.5) and data availability.

In real-world applications, TreeMAML achieved a state-of-the-art accuracy of 73.76% on the XNLI dataset, outperforming both XMAML (72.20%) and standard MAML (71.52%). The model proved especially effective for under-resourced languages by "borrowing" knowledge from linguistic relatives.

Key Insights

  • Noise Reduction: Averaging gradients with "sibling" tasks increases the signal-to-noise ratio for data-poor tasks.
  • Latent Relationships: Learned TreeMAML occasionally outperformed the Fixed version, suggesting that discovered clusters can capture important similarities missed by official taxonomies.

Conclusion and Future Work

While TreeMAML shows great promise, its performance is sensitive to the accuracy of the task tree. Future research may explore "soft" clustering using weighted averages based on tree distance rather than hard cluster assignments. Beyond NLP, this approach could be applied to biological taxonomies or complex image classification hierarchies.

Summary updated

BibTeX
@misc{garcia2021meta,
  author = {Jezabel R. Garcia and Federica Freddi and Feng-Ting Liao and Jamie McGowan and Tim Nieradzik and Da-Shan Shiu and Ye Tian and Alberto Bernacchia},
  title = {{Meta-Learning with MAML on Trees}},
  year = {2021},
  eprint = {2103.04691},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2103.04691},
}
Figure