Abstract
Multi-task networks rely on effective parameter sharing to achieve robust generalization across tasks. In this paper, we present a novel parameter sharing method for multi-task learning that conditions parameter sharing on both the task and the intermediate feature representations at inference time. In contrast to traditional parameter sharing approaches, which fix or learn a deterministic sharing pattern during training and apply the same pattern to all examples during inference, we propose to dynamically decide which parts of the network to activate based on both the task and the input instance. Our approach learns a hierarchical gating policy consisting of a task-specific policy for coarse layer selection and gating units for individual input instances, which work together to determine the execution path at inference time. Experiments on the NYU v2, Cityscapes and MIMIC-III datasets demonstrate the potential of the proposed approach and its applicability across problem domains.
Introduction
Multi-Task Learning (MTL) seeks to improve the generalization of neural networks by training a single model to perform several related tasks simultaneously. The central challenge in MTL is effective parameter sharing: finding the optimal balance between sharing knowledge to improve performance and maintaining task-specific features to avoid "negative transfer," where learning one task degrades the performance of another.
Traditional MTL architectures typically employ "hard" sharing (fixed shared layers) or "soft" sharing (separate models linked by regularization). Recent developments, such as AdaShare, introduced task-specific gating to decide which layers a specific task should utilize. However, these methods remain static at inference time; once the model is trained, every input instance for a given task follows the same computational path. DynaShare addresses this limitation by introducing a dynamic framework where the network path is determined by both the task and the specific characteristics of the input instance.
Methodology: Hierarchical Gating Policy
DynaShare introduces a Hierarchical Gating Policy that operates in two distinct stages to determine the execution path of the network at inference time.
1. Task-Specific Policy (Coarse Selection)
This stage involves a static binary vector for each task. It determines which layers are potentially "available" for a specific task. While this policy is learned during the training phase, it remains fixed during inference, providing a task-level blueprint for parameter sharing.
2. Instance-Gating Units (Fine-Grained Selection)
To allow for instance-specific flexibility, DynaShare utilizes lightweight "relevance estimators." These units analyze intermediate feature representations to decide if a specific input requires the execution of a particular layer. For example, in computer vision, a foggy image may require different processing layers than a clear, sunny image.
Logical AND Fusion and Optimization
The core innovation lies in the combination of these two policies. A specific block in the network is executed only if both the task-specific policy and the instance-gating unit return a positive signal. If either signal is negative, the block is bypassed via a residual connection. To optimize this discrete "on/off" behavior using standard gradient descent, the authors employ the Gumbel-Softmax trick. This allows the model to learn categorical decisions in a fully differentiable manner. Additionally, loss functions are designed to encourage both sparsity (minimizing unnecessary computation) and sharing (maximizing knowledge transfer between tasks).
Experimental Results
The authors evaluated DynaShare across diverse domains, including computer vision and healthcare time-series data, to demonstrate its versatility.
Computer Vision: NYU v2 and Cityscapes
On the NYU v2 dataset (semantic segmentation and surface normal prediction), DynaShare outperformed all baselines across all seven metrics. It achieved a performance lift (ΔT) of +14.4, representing a 2.4x relative improvement over previous state-of-the-art methods. Furthermore, DynaShare reduced computational complexity (FLOPs) by 41.8% compared to AdaShare while maintaining superior accuracy. On the Cityscapes dataset, the model achieved a 78% relative improvement in performance lift over existing methods.
Healthcare: MIMIC-III
To test the model's applicability beyond visual data, the authors utilized the MIMIC-III dataset, which involves predicting clinical outcomes from ICU stays (e.g., mortality, length-of-stay). DynaShare achieved the highest average improvement (+15.50%) relative to single-task models, confirming that hierarchical gating is a robust strategy for non-visual, sparse time-series data.
Discussion and Conclusion
DynaShare shifts the MTL paradigm from asking "which layers should tasks share?" to "how should the task dynamically use the layers allocated to it?" By prioritizing generalization through dynamic path selection, the framework achieves significant gains in both accuracy and efficiency. While the reduction in FLOPs is substantial, the authors note that actual hardware speedups on GPUs can be limited by the overhead of dynamic branching. Future work may focus on optimizing these dynamic structures for specific hardware accelerators and expanding the scope to multi-modal and continual learning environments.
Summary updated