Gumbel-Matrix Routing for Flexible Multi-task Learning

Krzysztof Maziarz, Efi Kokiopoulou, Andrea Gesmundo, Luciano Sbaiz, Gábor Bartók, Jesse BerentarXiv 2019

Abstract

This paper proposes a novel learning method for multi-task applications. Multi-task neural networks can learn to transfer knowledge across different tasks by using parameter sharing. However, sharing parameters between unrelated tasks can hurt performance. To address this issue, we propose a framework to learn fine-grained patterns of parameter sharing. Assuming that the network is composed of several components across layers, our framework uses learned binary variables to allocate components to tasks in order to encourage more parameter sharing between related tasks, and discourage parameter sharing otherwise. The binary allocation variables are learned jointly with the model parameters by standard back-propagation thanks to the Gumbel-Softmax reparametrization method. When applied to the Omniglot benchmark, the proposed method achieves a 17% relative reduction of the error rate compared to state-of-the-art.

Introduction

Multi-task learning (MTL) aims to improve generalization by training a single model on multiple tasks simultaneously. The standard approach is the "shared bottom" architecture, where all tasks share the first few layers before branching into task-specific heads. While effective when tasks are related (positive transfer), this approach often backfires when tasks are unrelated, a phenomenon known as negative transfer. In such cases, forcing a model to use the same parameters for different problems causes them to compete for capacity, leading to worse performance than separate single-task models.

Loss curves demonstrating that shared-bottom architectures (red) outperform no-sharing (blue) for related tasks but underperform for unrelated tasks.

As illustrated above, the performance of shared-bottom models is highly sensitive to task relatedness. Manually designing which layers to share is a difficult and non-scalable process. This paper introduces a way for the model to autonomously decide which components to share and which to keep separate.

Methods: Gumbel-Matrix Routing

The authors propose a modular network where each layer contains several parallel components, such as different convolution sizes, pooling operations, or identity mappings.

The Gumbel-Matrix architecture: tasks are routed through modular layers using learned binary allocation variables.

Binary Allocation and Gumbel-Softmax

For every task and every component in the network, the model maintains a binary variable. If the variable is 1, the task uses that component; if 0, it skips it. Because discrete "use or skip" decisions are non-differentiable, the authors use the Straight-Through Gumbel-Softmax estimator to relax these choices into differentiable ones during training. This allows the sharing pattern to be optimized jointly with the model's weights.

Budgeting and Task Fingerprints

To prevent the model from simply using every component for every task, an optional budget penalty encourages sparsity. By concatenating these binary allocation choices across all layers, the model creates a unique "fingerprint" for each task. These sparse embeddings can be used to visualize how the model perceives task similarity and relationship.

Key Results and Insights

The Gumbel-Matrix method was evaluated across several benchmarks, showing significant improvements in both accuracy and efficiency.

  • Omniglot Benchmark: The method achieved a 6.48% test error, representing a 17% relative reduction compared to the previous state-of-the-art Mixture-of-Experts (MoE) approach (7.81%) and outperforming the shared-bottom baseline (6.75%).
  • Automatic Task Clustering: In a complex 40-task setup, the model discovered task relationships without supervision. For example, it assigned identical allocation patterns to all MNIST variants, effectively clustering them together in the modular space.
  • Layer-Specific Specialization: The model learned that diversity is most critical in early layers (acting as task-specific feature extractors), while later layers tended to align and share more components for general processing.
  • Efficiency: On the 4-MNISTs task, the model achieved peak accuracy while utilizing only 75% of possible connections, proving that selective parameter sharing can reduce interference and improve performance.

Conclusion

Gumbel-Matrix routing offers a flexible and automated alternative to fixed multi-task architectures. By learning to navigate the trade-off between positive and negative transfer, it achieves state-of-the-art results on benchmarks like Omniglot. Future work may extend this by conditioning routing on specific input images (per-example routing) or integrating richer task metadata to further refine parameter allocation.

Summary updated

BibTeX
@misc{maziarz2019gumbel,
  author = {Krzysztof Maziarz and Efi Kokiopoulou and Andrea Gesmundo and Luciano Sbaiz and Gábor Bartók and Jesse Berent},
  title = {{Gumbel-Matrix Routing for Flexible Multi-task Learning}},
  year = {2019},
  eprint = {1910.04915},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1910.04915},
}
Figure