Abstract
Multi-Task Learning (MTL) has achieved success in various fields. However, training with equal weights for all tasks may cause unsatisfactory performance for part of tasks. To address this problem, there are many works to carefully design dynamical loss/gradient weighting strategies but the basic random experiments are ignored to examine their effectiveness. In this paper, we propose the Random Weighting (RW) methods, including Random Loss Weighting (RLW) and Random Gradient Weighting (RGW), where an MTL model is trained with random loss/gradient weights sampled from a distribution. To show the effectiveness and necessity of RW methods, theoretically, we analyze the convergence of RW and reveal that RW has a higher probability to escape local minima, resulting in better generalization ability. Empirically, we extensively evaluate the proposed RW methods to compare with twelve state-of-the-art methods on five image datasets and two multilingual problems from the XTREME benchmark to show that RW methods can achieve comparable performance with state-of-the-art baselines. Therefore, we think the RW methods are important baselines for MTL and should attract more attention.
Introduction
In Multi-Task Learning (MTL), a single model is tasked with learning multiple objectives simultaneously. A central challenge in this paradigm is task balancing: how to weight the individual losses of different tasks. Standard practice often defaults to Equal Weighting (EW), which can lead to suboptimal performance if one task dominates the gradients or if tasks are in conflict.
To mitigate this, the research community has developed a plethora of sophisticated, computationally intensive algorithms to dynamically adjust task weights. However, this paper argues that these methods have often been compared against an overly simplistic baseline. We introduce Random Weighting (RW) as a more robust "litmus test" for MTL weighting strategies.
Methodology: Random Weighting
The proposed Random Weighting framework consists of two primary variants:
- Random Loss Weighting (RLW): In each training iteration, task loss weights are sampled from a distribution (e.g., a Normal distribution followed by a Softmax) to compute the total loss.
- Random Gradient Weighting (RGW): Random weights are applied directly to the gradients of the shared parameters rather than the losses.
While seemingly counter-intuitive, RW is theoretically a stochastic variant of Equal Weighting. The injection of this specific noise serves as a beneficial regularizer, allowing the model to escape sharp local minima in favor of flatter, more generalizable ones.
Key Insights and Theoretical Motivation
The effectiveness of RW stems from its role as a regularizer. By varying task weights randomly, the model is forced to find solutions that are robust across a wide range of task priorities.
Empirical analysis confirms that RLW consistently results in lower gradient variance compared to Equal Weighting. This reduction in variance, alongside a smaller maximum eigenvalue of the Hessian, indicates that RW settles into "flatter" regions of the loss landscape, which is a known indicator of superior generalization on unseen data.
Empirical Evaluation
The researchers evaluated RW across diverse benchmarks, including Computer Vision (Multi-MNIST, NYUv2, CityScapes, CelebA) and Natural Language Processing (XTREME benchmark).
On the Multi-MNIST dataset, RLW demonstrates a clear ability to match or exceed the performance of the standard EW baseline across various task trade-offs. In more complex scenarios like the NYUv2 dataset, RLW achieved a 1.04% relative improvement over EW, outperforming specialized loss-balancing methods like Uncertainty Weighting (UW) and Dynamic Weight Averaging (DWA). On the XTREME multilingual benchmark, RLW and RGW achieved state-of-the-art results for Paraphrase Identification and Part-Of-Speech tagging, respectively.
Discussion and Limitations
The primary takeaway is that any new MTL weighting algorithm should be required to outperform Random Weighting to justify its complexity. RW adds virtually zero computational overhead, unlike many SOTA methods that require solving optimization problems at every step.
However, RW is not a universal solution. Its effectiveness can be task-specific; for instance, RGW performed poorly on the CelebA dataset, which involves a massive number of simple binary classification tasks. Furthermore, while RW is a powerful baseline, highly specialized methods like CAGrad may still maintain a slight performance edge in specific contexts.
Conclusion
Random Weighting serves as a surprisingly effective and efficient baseline for Multi-Task Learning. By leveraging randomness as a regularizer, it achieves performance comparable to complex state-of-the-art methods. The authors advocate for its adoption as a standard benchmark in the field to ensure that future algorithmic complexity is truly warranted by performance gains.
Summary updated