Resolving Gradient Conflicts via Orthogonal Projection

382 concepts221 papers3 proposals

When training a neural network to perform multiple tasks simultaneously—such as balancing reward and safety in reinforcement learning (Bilgehan Sel et al.), satisfying physical laws alongside data distributions (Giacomo Baldan et al.), or optimizing multiple text quality traits (Sangwon Ryu et al.)—we typically combine individual loss functions into a single scalar objective via a weighted sum.

However, this approach assumes that the objectives are cooperative. In reality, different tasks often issue contradictory instructions to the network's parameters. When the gradients of two objectives point in opposing directions (an obtuse angle where the cosine similarity is negative), standard gradient descent results in a destructive tug-of-war. As Qiang Liu et al. demonstrate in their work on physics-informed neural networks (ConFIG: Towards Conflict-free Training of Physics Informed Neural Networks), simply adjusting scalar weights cannot resolve this fundamental geometric conflict; it merely shifts which objective is sacrificed. The optimization process either oscillates wildly or gets trapped in suboptimal local minima.

The Geometry of Gradient Surgery

To prevent tasks from sabotaging each other, researchers use orthogonal gradient projection (often called "gradient surgery"). The core intuition is simple: if two gradients conflict, we alter their directions to eliminate the opposing components before updating the model parameters.

Consider two conflicting gradients, $g_1$ and $g_2$, where $g_1 \cdot g_2 < 0$. Instead of averaging them, we project $g_1$ onto the normal plane (the orthogonal subspace) of $g_2$:

$$g_1^{\text{projected}} = g_1 - \frac{g_1 \cdot g_2}{\|g_2\|^2} g_2$$

This geometric transformation removes the component of $g_1$ that directly opposes $g_2$. The resulting vector is perpendicular to $g_2$, meaning an update along $g_1^{\text{projected}}$ will minimize the loss for the first task without degrading the performance of the second. As Lucas Mansilla et al. show in the context of domain generalization (Domain Generalization via Gradient Surgery), this ensures that shared learning occurs across diverse datasets without domain-specific noise causing destructive interference.

Asymmetric vs. Symmetric Alignment

Depending on the problem framing, gradient projection can be applied symmetrically or asymmetrically:

  • Symmetric De-confliction: In general multi-task settings, every conflicting gradient is projected onto the normal plane of the others (Xiaokang Liu et al.; Li Yang et al.). This treats all tasks equally, allowing the model to find a balanced path forward.
  • Asymmetric Prioritization: In constrained optimization—such as safe reinforcement learning (Bilgehan Sel et al.) or energy-efficient robotics (Akhil Perincherry et al.)—objectives have a strict hierarchy. For instance, Akhil Perincherry et al. project a secondary energy-saving gradient onto the orthogonal subspace of the primary task gradient. This guarantees that the robot optimizes for energy efficiency only when it does not interfere with its main operational goal. Similarly, Junjiao Tian proposes projecting task-learning gradients to avoid degrading pre-trained foundation model representations, mitigating the trade-off between downstream performance and out-of-distribution robustness (Directional Gradient Projection for Robust Fine-Tuning of Foundation Models).

Scaling to Multiple Objectives

When an optimization problem involves more than two objectives, pairwise projection becomes mathematically complex and dependent on the order of operations. To scale up, researchers look for a consensus direction within the intersection of all conflict-free gradient cones.

  • Multi-Gradient Aggregation: Baijiong Lin et al. and Aochuan Chen et al. utilize quadratic programming and multi-gradient descent algorithms to compute a single, non-dominating update vector that satisfies multiple competing goals simultaneously.
  • Matrix Pseudoinverses: Qiang Liu et al. introduce a strategy using a pseudoinverse matrix operation to derive a single update vector that maintains a positive cosine similarity with every individual objective's gradient.
  • Dual-Space Projection: To completely bypass the limitations of weighted sums, the authors of Multi-Objective Large Language Model Unlearning project gradients into a dual space to calculate a shared update vector, effectively reducing the probability of objective conflict to zero.

The Optimizer Mismatch

A subtle but critical challenge arises when combining gradient surgery with modern adaptive optimizers like Adam. As noted in Gradient-Update Mismatch: Rethinking Conflict-Free Training of Physics-Informed Neural Networks, even if gradients are perfectly de-conflicted before being passed to the optimizer, the optimizer's internal momentum and adaptive learning rates distort the final update vector. Consequently, the actual parameter change can still violate the conflict-free condition.

To resolve this, the authors of that work introduce post-optimizer update projection. Instead of manipulating the raw gradients during the backward pass, this mechanism intercepts the final update vector generated by the optimizer and projects it onto a conflict-free cone defined by the original loss gradients. This ensures that the physical change applied to the model parameters strictly decreases (or maintains) all constituent loss functions.

Broad Applications

Because gradient conflict is a fundamental property of multi-objective optimization, this geometric solution has found success across diverse domains:

Key Foundational Work

Gradient Surgery for Multi-Task Learning (2020) — contributed 3 concept elements to this direction.
History & citationVersion 1 · 2026-10-04

Current · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_orthogonal_gradient_projection_gradient__1225063d,
  title = {orthogonal gradient projection (gradient conflict resolution)},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/orthogonal-gradient-projection-gradient-conflict-resolution/rdr_1225063d51974f248a22519a6f4e456d},
  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_orthogonal_gradient_projection_gradient__1225063d_v1,
  title = {orthogonal gradient projection (gradient conflict resolution)},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/orthogonal-gradient-projection-gradient-conflict-resolution/rdr_1225063d51974f248a22519a6f4e456d/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-26},
}
About

These directions overlap with this one through shared papers.

See something wrong? Report a mistake