TL;DR
GradNorm is a simple yet powerful algorithm that automatically balances the training of multitask neural networks by dynamically tuning gradient magnitudes. By ensuring that no single task dominates the learning process, it matches or exceeds the performance of expensive manual grid searches while significantly reducing overfitting.
What Problem Does This Paper Address?
In deep learning, "multitask" networks—where one model performs several tasks at once (like identifying objects, estimating depth, and detecting edges)—are highly desirable for their efficiency. However, they are notoriously difficult to train.
The core issue is a gradient imbalance. Different tasks often have vastly different loss scales or learning speeds. If one task produces much larger gradients than the others, it "bullies" the shared layers of the network, forcing them to optimize for that task alone. Researchers usually fix this by manually assigning weights to each task's loss, but finding the right balance is a "dark art" that requires an exhaustive, computationally expensive grid search—a process that becomes impossible as the number of tasks grows.
Methods
The authors introduce GradNorm (Gradient Normalization), an adaptive approach that treats loss balancing as a secondary optimization problem.
Instead of static weights, GradNorm uses dynamic weights $w_i(t)$ that change at every training step. The algorithm has two main goals:
- Standardize Scale: It places the gradient norms for all tasks on a common scale so they can be compared fairly.
- Balance Training Rates: It uses the "inverse training rate" (how much a task's loss has dropped relative to its starting point) to adjust weights. If a task is learning too slowly, GradNorm increases its gradient magnitude to give it more influence; if it’s learning too fast (and potentially overfitting), GradNorm dials it back.
The only "knob" for the user to turn is a single hyperparameter, $\alpha$ (the asymmetry parameter), which dictates how aggressively the algorithm tries to balance the training rates. After every update, the weights are renormalized to ensure they sum to the total number of tasks, preventing the global learning rate from exploding.
Datasets
The paper evaluates GradNorm across several scenarios:
- Toy Synthetic Datasets: Regression tasks designed with intentionally mismatched loss scales to prove the algorithm can "rescue" suppressed tasks.
- NYUv2: A popular indoor scene dataset used for depth estimation, surface normal prediction, and semantic segmentation.
- NYUv2+kpts: An augmented version of NYUv2 with 90,000 images and additional room keypoint labels.
- Facial Landmark Dataset: A 9-task dataset used to show the algorithm's scalability (detailed further in the paper's supplementary materials).
Key Insights and Ideas
- Gradients are the Root Cause: The authors argue that multitask imbalances are fundamentally a gradient problem, not just a loss problem. By modifying the gradients directly, you address the issue at its source.
- The "Restoring Force": GradNorm acts like a spring system. If one task drifts too far ahead or falls too far behind the average training rate, the algorithm applies a "restoring force" via the loss weights to bring it back into balance.
- Automating the Grid Search: One of the most surprising findings is that GradNorm often finds a better balance in a single training run than a researcher could find using 100 separate runs of exhaustive grid search.
- Overfitting Mitigation: By slowing down tasks that learn too quickly, GradNorm acts as a form of regularization, leading to better generalization on test data even if the training loss ends up slightly higher.
Key Results
- Superior Accuracy: On the NYUv2 dataset, GradNorm consistently outperformed "Equal Weighting" baselines and single-task networks. For example, it improved depth estimation error by ~5% compared to standard multitask training.
- Efficiency: GradNorm adds very little computational overhead—only about a 5% increase in training time—while saving weeks of manual hyperparameter tuning.
- Stability: Compared to other adaptive methods (like Uncertainty Weighting), GradNorm proved much more stable, as its weight renormalization prevents the "runaway" learning rate issues that plague unconstrained methods.
Limitations and Future Work
While GradNorm simplifies the tuning process, it doesn't eliminate it entirely; users still need to pick a value for the hyperparameter $\alpha$, though the authors found that values between 1.0 and 1.5 work well for most complex vision tasks.
The paper primarily focuses on computer vision and regression-heavy tasks. The authors suggest that future work should explore how GradNorm performs in other domains like Natural Language Processing (NLP) or Reinforcement Learning, and how it might be adapted for class-imbalance problems within a single task.
Summary updated