Just Pick a Sign: Optimizing Deep Multitask Models with Gradient Sign Dropout

Zhao Chen, Jiquan Ngiam, Yanping Huang, Thang Luong, Henrik Kretzschmar, Yuning Chai, Dragomir Anguelov

In deep learning, we often ask a single model to perform multiple tasks simultaneously. An object detector, for instance, must predict a bounding box's location, its dimensions, and the object's class. While standard practice involves summing these different "losses" together, this often leads to a "gradient tug-of-war" where different tasks pull the model's weights in conflicting directions.

A team from Waymo and Google Research presented a clever solution to this problem: Gradient Sign Dropout (GradDrop). It is a simple, probabilistic method ensuring that when tasks disagree, the model doesn't stall—it picks a direction and moves forward.

TL;DR

GradDrop is a probabilistic masking layer that resolves conflicts between multiple gradient signals by filtering them based on sign consistency. By ensuring that gradient updates are "pure" in sign, it forces the model toward joint minima where all tasks perform well, outperforming state-of-the-art multitask optimization methods with significantly less computational overhead.

The Problem of Gradient Conflict

Most deep learning models are inherently "multitask." Even a simple classifier can be viewed as a collection of binary classifiers. During training, we typically sum the gradients from various loss functions.

However, this leads to gradient conflict. Imagine Task A wants a specific weight to increase (positive gradient), while Task B wants it to decrease (negative gradient). A naive sum might result in a near-zero update, leaving the model stuck in a mediocre local minimum where neither task is optimized. Existing solutions like PCGrad or MGDA attempt to project gradients onto one another to find a compromise, but these are computationally expensive ($O(T^2)$ complexity for $T$ tasks) and can still get trapped in sub-optimal "sum-loss" minima.

Methods: Introducing GradDrop

The authors introduce GradDrop as a modular layer, typically placed just before the prediction heads of a network.

GradDrop handles conflicting gradients by probabilistically masking them based on sign consistency.
  1. Calculate Purity ($P$): For a given activation, the layer examines all incoming gradients from different tasks and calculates a "Positive Sign Purity" score. If all gradients are positive, $P=1$; if all are negative, $P=0$. If they are evenly split, $P=0.5$.
  2. Probabilistic Masking: The layer stochastically chooses a "winning" sign (positive or negative) based on this purity. If the purity is high (most tasks agree), it is highly likely to keep the majority sign.
  3. The Dropout Step: Any gradient that possesses the "losing" sign is masked out (set to zero) for that specific update.
  4. Leaky GradDrop: A "leak" parameter ($\ell$) is also introduced, allowing a small amount of the conflicting gradient through. This is particularly useful in transfer learning where a target task is prioritized over a source task.

Crucially, GradDrop operates with $O(T)$ complexity, making it significantly faster than projection-based methods as the number of tasks scales.

Key Insights and Ideas

  • Joint Minima vs. Sum Minima: The most powerful theoretical insight is that GradDrop's only stable points are joint minima—points where the gradient for every individual task is zero. Standard SGD only guarantees a minimum for the sum of losses, which might leave individual tasks performing poorly.
  • Gradient Noise as a Feature: Similar to standard Dropout or stochastic gradient noise, the randomness inherent in GradDrop helps the model escape narrow, low-quality local minima to find broader, more robust solutions.
GradDrop successfully navigates complex loss landscapes to reach the global minimum, outperforming other methods like SGD and PCGrad.
  • Efficiency is King: Because GradDrop relies on a simple sign-check and mask, it adds almost zero computational overhead compared to the complex matrix projections required by competing methods.
  • Synergy: GradDrop primarily modifies the direction of gradients, whereas methods like GradNorm modify the magnitude. The authors demonstrate that combining both yields superior results.

Experimental Validation and Results

The authors validated GradDrop across three distinct scenarios:

  • CelebA (Multitask Learning): On this large-scale face attributes dataset with 40 binary classification tasks, GradDrop achieved the lowest error rate (8.52%) and highest F1 score compared to baselines, MGDA, and PCGrad, while being more than twice as fast as PCGrad.
  • Waymo Open Dataset (3D Detection): In this complex real-world benchmark involving multiple loss terms for box coordinates, heading, and classification, GradDrop significantly improved the Average Precision with Heading (APH) metric. This is vital for self-driving cars, where knowing which way a vehicle is facing is just as important as knowing where it is.
  • ImageNet to CIFAR-100 (Transfer Learning): GradDrop (combined with GradNorm) achieved a Top-1 error of 28.9%, outperforming the mixed-batch baseline of 29.8%.

Limitations and Future Work

  • Hyperparameter Sensitivity: While the default slope of the purity function ($k=1$) works well, highly complex tasks might require tuning this sensitivity.
  • Activation Placement: The paper focuses on placing GradDrop at the final shared layer. The optimal placement for different architectures (like Transformers vs. CNNs) remains an area for future exploration.
  • Extreme Conflict: In scenarios where tasks are diametrically opposed, the stochastic nature of GradDrop might lead to high variance in training, though this variance can be instrumental in finding a better optimization path.

GradDrop offers a refreshing take on multitask optimization: instead of trying to find a perfect compromise between conflicting tasks, it simply picks a sign, adds a little randomness, and keeps moving toward a solution that satisfies all tasks.

Summary updated

BibTeX
@inproceedings{chen2020just,
  author = {Zhao Chen and Jiquan Ngiam and Yanping Huang and Thang Luong and Henrik Kretzschmar and Yuning Chai and Dragomir Anguelov},
  title = {{Just Pick a Sign: Optimizing Deep Multitask Models with Gradient Sign Dropout}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2020},
  url = {https://openreview.net/forum?id=hxPKlw4d3k8},
}
Figure