Random Loss Weights as Free Experiments: Tuning Multi-Task Balance Inside One Training Run

Multi-task learning trains one shared network on several objectives at once. Its most stubborn hyperparameter is the set of task weights, the numbers that decide how much each task's loss counts when the shared backbone is updated. A surprising recent result is that you do not have to choose these weights carefully. A Closer Look at Loss Weighting in Multi-Task Learning samples a fresh random weight vector at every training step, a method it calls Random Loss Weighting (RLW). This matches or beats elaborate balancing methods on NYUv2 at no extra cost. The hyperparameter-sensitivity literature gives reason to doubt that this settles the matter. Untuned baselines routinely hide true performance (Quantifying the Hyperparameter Sensitivity of Neural Networks for Character-level Sequence-to-Sequence Tasks, MolRep), and RLW still has a free knob: the distribution its weights are drawn from. Tuning that distribution for $T$ tasks in the usual way, with an outer search over many full training runs, becomes expensive when $T$ reaches 40 tasks on CelebA or 159 labels on Bibtex.

This proposal rests on one observation. An RLW training run is already a randomized experiment. Every step applies a different, known weight vector, and the network then responds in ways we can measure. If we record which weight vectors preceded improvements on held-out data for each task, a cheap regression model can learn which tasks benefit from more weight. The sampling distribution can then be shifted toward those weights while it stays random. The result is hyperparameter optimization for a $T$-dimensional weight distribution carried out inside a single training run. The added cost is one held-out minibatch evaluation every few hundred steps, compared with the many full runs an outer-loop search would need.

Core Claim

We claim that RLW's random weights can serve as exploration data. A Bayesian linear surrogate fitted to this data can steer the mean of the weight distribution online. Doing so should recover most of the gain from an expensive outer-loop search over RLW's distribution, at roughly the cost of one run, and the advantage should grow with the number of tasks. We also claim that the randomness itself still matters: steering the mean while keeping the noise should beat collapsing to a deterministic weight schedule at the learned mean. The second claim separates our method from the existing family of adaptive deterministic weighting methods.

This differs from prior work as follows. RLW keeps a fixed, hand-chosen distribution. Multi-task Bayesian optimization (Multi-Task Bayesian Optimization) and its scalable successors (Scalable Hyperparameter Transfer Learning, Hyperparameter Transfer Learning with Adaptive Complexity) treat each training run as one costly evaluation. They tune hyperparameters of fixed single-task models across runs. We instead treat each window of steps as an evaluation, and we tune the internal balance of a multi-task network within a single run. Gradient-based balancers such as GradNorm and RotoGrad (RotoGrad) adapt weights from gradient statistics on the training data. Our controller adapts from held-out loss changes, so it targets generalization directly.

Research Program

Training is split into windows of $K$ steps. In window $m$, each step draws weights $w \sim \mathrm{Dirichlet}(c\,\mu_m)$. Here $\mu_m$ is the current mean weight vector, a point on the simplex of $T$ entries. The scalar $c$ is the concentration, which controls how far each draw strays from $\mu_m$. At the end of the window we record two things: $\bar w_m$, the average weight vector actually applied in the window, and $\Delta_m \in \mathbb{R}^T$, the change in each task's loss on a fixed held-out minibatch. The surrogate is a per-task linear model,

$$\Delta_{m,j} \approx \beta_j^\top (\bar w_m - \mu_m) + b_{m,j},$$

where $\beta_j \in \mathbb{R}^T$ says how extra weight on each task moves held-out task $j$. The term $b_{m,j}$ is a drift term shared within the window, which absorbs the general progress of training that has nothing to do with the weights. Regressing on deviations from the mean is what makes the problem identifiable. The draws are random and independent of the network state, so the deviations act like a randomized treatment.

We fit $\beta$ by Bayesian linear regression over a sliding window of recent $m$. The reasons differ by method. From Scalable Hyperparameter Transfer Learning we take the idea that Bayesian linear models scale linearly in observations and give closed-form uncertainty. From Hyperparameter Transfer Learning with Adaptive Complexity we take automatic relevance determination, a prior that shrinks most coefficients toward zero until the data justify them. This keeps the $T \times T$ coefficient matrix sparse in early windows.

The mean $\mu$ is then updated by Thompson sampling. We draw $\beta$ from the posterior, compute the direction that most reduces a target aggregate (the average held-out loss, normalized per task by its single-task loss scale), and take a mirror-ascent step on the simplex. We also keep $c$ bounded, so the weights never stop being random.

We will analyze three things. First, whether averaging over a window lets the effect of weight deviations rise above minibatch noise; the window length $K$ trades bias from drift against variance. Second, how the cost scales with $T$: regression is $O(T^2)$ per window, which is negligible next to backbone compute, and the held-out evaluation is one forward pass. Third, whether the learned $\beta$ matrix reveals real task affinities, checked against pairwise co-training results.

Baselines

The naive reference point is equal weighting: the plain sum of losses with no tuning. A Closer Look at Loss Weighting reports that RLW improves over the baseline by 1.04% on NYUv2's primary benchmark comparison, and by up to 1.29% with a constrained Bernoulli distribution, at 1.0x relative training time. Default RLW with a Dirichlet distribution, and the best of its reported variants, is the strongest zero-overhead competitor. It is the method our approach must improve on without losing its cost advantage. For CelebA, CityScapes and XTREME, no reported result was found on Lacuna for RLW, so we will rerun it ourselves.

The strongest competitor in compute-heavy settings is outer-loop tuning of RLW's own distribution. This means searching the $T$ concentration parameters with CMA-ES, the search method that LassoBench found most reliable in high dimensions (MSE 0.015 on Leukemia, a 75% improvement over the best gradient-based baseline). We run it with Hyperband-style early stopping, following Hyperparameter optimization in deep multi-target prediction, which reported 2.2x speedups over random search on Bibtex. We also include random search with a doubled budget, which that paper found competitive. This baseline is the ceiling we hope to approach. We will report it at budgets of 5, 10, 20 and 40 full-run equivalents.

Two deterministic methods are also included. GradNorm is the gradient-statistics balancer. RotoGrad is the representation-rotation method; we give it its own learning-rate-ratio search, since RotoGrad is known to be brittle to that ratio. PCGrad is included on NYUv2 only, and we report its 2.0x cost explicitly.

Fairness rules are the same everywhere. Every method uses the same backbone, data splits and epoch count. Every method gets the same search over shared hyperparameters such as learning rate and weight decay. The held-out minibatch our controller uses is carved out of the training set, never the validation set, and the competitors get that same data back for training.

Two ablations isolate the key ingredient. The first, deterministic-at-mean, applies our learned $\mu_m$ with no sampling noise. It tests whether the randomness still matters once the mean is steered. The second, random drift, moves $\mu$ by the same step sizes but in random directions. It tests whether the surrogate's direction carries information.

The method counts as beating the competition if two conditions hold on CelebA and Bibtex. It must beat default RLW by more than seed variance across five seeds. It must also match outer-loop CMA-ES tuned RLW at 10 run-equivalents, while using under 1.2x the cost of one run.

Why not just…?

Why not just tune RLW's distribution with an outer search? This is the real threat. With a handful of tasks it may be cheap enough that our method is pointless. On NYUv2 ($T=3$), a five-run random search over three concentrations may well match us, and we would report that. Our claim lives at large $T$, where outer search must cover 40 to 159 dimensions using one full training run per evaluation. The budget-sweep experiment settles this. If CMA-ES at 5 run-equivalents already matches us on Bibtex, the in-run idea does not pay off.

Why not just use equal weighting, or default RLW? If RLW's distribution barely matters, any tuning is wasted effort. The 0.25-point gap between RLW's Dirichlet and constrained-Bernoulli variants on NYUv2 hints that the distribution does matter, but that gap is small. Outer-loop tuned RLW measures the headroom directly. If even the tuned ceiling barely beats default RLW, we will report that the RLW result is not a tuning artifact. That answer to the open tension is useful on its own.

Why not just use an adaptive deterministic balancer like GradNorm? These methods already change weights during training. However, they respond to training-gradient norms rather than held-out effects, and they discard the noise that RLW's authors credit for flatter minima. The deterministic-at-mean ablation compares directly against this design. If it performs as well as the full method, our claim about randomness fails, and the method reduces to a held-out-driven GradNorm variant.

Proposed Experiments

The experiments use NYUv2 (3 dense tasks), CityScapes (2 tasks) and CelebA (40 attributes) in the standard settings of A Closer Look at Loss Weighting. To stress the method at many tasks, we add Bibtex and Corel5k from the DeepMTP suite in Hyperparameter optimization in deep multi-target prediction, treating each label as a task. The metrics are the average relative improvement over single-task models (the metric RLW reports), per-task scores, wall-clock time relative to equal weighting, and the full-run-equivalents consumed by each tuning method.

The first decisive check is the scaling curve. We plot the gap between our method and default RLW, and the compute it takes outer-loop CMA-ES to close that gap, against $T$ from 2 to 159. The idea succeeds only if the outer-loop cost grows while ours stays near 1x.

The second check tests whether the surrogate is real. On CelebA we take the predicted signs of $\beta_{jk}$ and check them against short two-task co-training runs on 50 sampled task pairs. Agreement near chance would mean the controller is chasing noise.

The third check is a sensitivity sweep over window length $K$ and concentration $c$. Following the methodology of Quantifying the Hyperparameter Sensitivity, we will confirm that the method has not simply replaced $T$ hyperparameters with two fragile new ones.