Gradient Surgery for Multi-Task Optimization

This direction is merged into another direction: orthogonal gradient projection (gradient conflict resolution). Its last version stays readable and citable here.

Version 1 of 1194 papers249 conceptsfrozen 2026-10-04

In deep learning, we often want a single model to do many things at once: a robot that walks and balances, a vision model that detects objects across different lighting conditions, or a language model that learns new instructions without forgetting old ones. However, training on multiple objectives simultaneously often leads to a "tug-of-war" where the gradient updates for one task actively sabotage the performance of another.

This phenomenon, known as gradient interference or negative transfer, occurs when the optimization directions for different tasks point away from each other. Researchers have developed a suite of techniques collectively known as gradient surgery to resolve these conflicts by geometrically manipulating update vectors before they are applied to the model's parameters.

The Geometry of Conflict

When we train a model on two tasks, $A$ and $B$, we calculate two gradient vectors, $g_A$ and $g_B$. In standard multi-task learning, we simply average them. But as Jun Yu and colleagues explain in their comprehensive survey, if these vectors form an obtuse angle (negative cosine similarity), an update that improves Task A will necessarily increase the loss for Task B.

The core intuition of gradient surgery is to identify these "conflicting" components and remove them. If $g_A$ and $g_B$ conflict, we project $g_A$ onto the normal plane of $g_B$. This geometric transformation effectively subtracts the component of $g_A$ that opposes $g_B$, resulting in a new vector that is at least orthogonal to the other task's needs. By ensuring that no update direction has a negative projection onto another, the model can converge toward a Pareto-optimal solution where no task is sacrificed for the sake of another.

Harmonizing Diverse Objectives

This mechanism has proven essential in fields where objectives are inherently at odds. For example, in Physics-Based Flow Matching, Giacomo Baldan and Nils Thuerey use conflict-free gradient updates to balance the need to match data distributions with the need to obey rigid physical laws (PDEs). Without surgery, the model's attempt to look "realistic" often violates the laws of physics, and vice versa.

Similarly, in robotics, David Howard and his team developed GCR-PPO (Scalable Multi-Objective Robot Reinforcement Learning through Gradient Conflict Resolution) to prevent a robot's speed objective from "washing out" its energy-saving objective. By calculating individual gradients for every reward term and resolving their directional conflicts, they achieve stable optimization even as the number of tasks scales.

Beyond Simple Projection

While basic projection (often called PCGrad) is effective, recent work has introduced more sophisticated ways to align task gradients:

Applications in Modern AI

The reach of gradient surgery extends into nearly every corner of modern machine learning:

  • Generative Models: AnhDung Dinh and Chang Xu applied these principles to diffusion sampling in PixelAsParams (PixelAsParam: A Gradient View on Diffusion Sampling with Guidance), resolving conflicts between image quality and conditional guidance to prevent the "diversity collapse" often seen at high guidance scales.
  • Domain Generalization: Lucas Mansilla and colleagues demonstrated in Domain Generalization via Gradient Surgery that by neutralizing conflicting gradients between different training domains, models can be forced to ignore domain-specific noise and focus on features that generalize to unseen environments.
  • Large Language Models: To prevent "catastrophic forgetting" during instruction tuning, researchers like Lingyong Yan use gradient projection in frameworks like Joint Flashback Adaptation (Joint Flashback Adaptation for Forgetting-Resistant Instruction Tuning) to ensure that learning new skills doesn't overwrite the model's existing internal knowledge.

By treating the training process as a geometric negotiation between competing goals, gradient surgery allows us to move past simple weighted averages of losses toward a more robust, multi-faceted intelligence.

Papers in this version

Showing 60 of 194 papers.

History & citationVersion 1 · 2026-10-04

Merged into another direction · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_gradient_surgery_for_multi_task_optimiza_f791ad3c,
  title = {Gradient Surgery for Multi-Task Optimization},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/gradient-surgery-for-multi-task-optimization/rdr_f791ad3c8f95433988ab9b6654f9e71a},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-26},
}

This exact version (version 1, frozen text):

@misc{lacuna_gradient_surgery_for_multi_task_optimiza_f791ad3c_v1,
  title = {Gradient Surgery for Multi-Task Optimization},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/gradient-surgery-for-multi-task-optimization/rdr_f791ad3c8f95433988ab9b6654f9e71a/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-26},
}