Abstract
Multi-Task Learning (MTL) is a widely-used and powerful learning paradigm for training deep neural networks that allows learning more than one objective by a single backbone. Compared to training tasks separately, MTL significantly reduces computational costs, improves data efficiency, and potentially enhances model performance by leveraging knowledge across tasks. However, standard training that minimizes the empirical loss can easily suffer from overfitting to low-resource tasks or be spoiled by noisy-labeled ones, causing negative transfer and performance drops. To alleviate such problems, we propose to leverage Sharpness-aware Minimization (SAM) to enhance model generalization. We present a novel MTL training methodology that encourages the model to find task-based flat minima for coherently improving its generalization capability on all tasks. Finally, we conduct comprehensive experiments on a variety of applications to demonstrate the merit of our proposed approach over existing gradient-based MTL methods.
Introduction: The Challenge of Multi-Task Landscapes
In Multi-Task Learning, a shared encoder typically serves multiple task-specific heads. While efficient, this setup introduces two primary hurdles:
- Gradient Conflict: Different tasks may demand weight updates in opposing directions, leading to interference and sub-optimal convergence.
- Sharp Minima: Standard empirical risk minimization often converges to "sharp" valleys in the loss landscape. These regions exhibit low training error but poor generalization, as small perturbations in data or weights can lead to significant performance drops.
Previous research has focused on reweighting task losses or manipulating gradients to find a compromise. However, these methods often overlook the underlying geometry of the loss surface itself, leaving models vulnerable to poor generalization.
Methodology: Seeking Flatness through Gradient Decomposition
Our framework shifts the focus from simple loss balancing to optimizing the geometry of the loss landscape. We leverage Sharpness-Aware Minimization (SAM) to minimize the worst-case loss within a neighborhood of the current weights, effectively seeking "flat" regions where the loss remains stable.
To prevent the flatness-seeking process from exacerbating task conflicts, we introduce a Gradient Decomposition strategy. For each task $i$, we compute two distinct components:
- $g_{loss}^i$ (The "Where" component): The standard gradient pointing toward lower empirical error.
- $g_{flat}^i$ (The "How" component): A component derived from weight perturbations that steers the model toward flatter regions.
These components are aggregated independently using existing MTL optimizers (e.g., PCGrad, CAGrad). The final update direction, $g_{sh}^{SAM} = g_{sh}^{loss} + g_{sh}^{flat}$, ensures the model moves toward a region that is both low-loss and flat for all tasks simultaneously.
Key Insights: Flatness as a Peacemaker
A critical discovery of this work is the relationship between landscape flatness and task harmony. As the model converges toward flatter regions, the inherent conflict between task gradients significantly diminishes.
As shown in the figure above, our method reduces gradient conflict to nearly 0%, whereas standard training (ERM) maintains high conflict levels (often exceeding 50%). This suggests that "flatness" provides a common ground where diverse tasks can coexist without interference. Furthermore, we provide a theoretical PAC-Bayesian bound demonstrating that controlling the gradient norm via weight perturbation directly limits the generalization error for each task.
Experimental Results
We evaluated our framework on several major benchmarks, including Multi-MNIST, CelebA, NYUv2, and CityScapes.
- Generalization: On Multi-MNIST, our flat-based methods outperformed Single-Task Learning (STL) by approximately 1.2%, overcoming the common "multi-task penalty."
- Performance: On the NYUv2 indoor scene dataset, our method (F-IMTL) achieved the highest relative improvement across segmentation and depth tasks, surpassing state-of-the-art methods like NashMTL.
- Robustness and Calibration: Models trained with our approach are more robust to weight noise and exhibit better calibration (lower Expected Calibration Error), making them more reliable for safety-critical applications like autonomous driving.
Limitations and Future Work
The primary trade-off for improved generalization is computational cost. Seeking flat regions requires calculating gradients for both original and perturbed weights, effectively doubling the number of forward and backward passes. Future research will focus on developing more efficient update strategies, such as periodic flatness penalties, and extending this geometric perspective to other domains like Natural Language Processing and Reinforcement Learning.
Summary updated