Naive SumPCGrad Surgery
⚠ Couldn't load the engineSomething went wrong. Reload the page.

Gradient Surgery: Resolving Conflicting Task Gradients (PCGrad) — 2D

In multi-task learning, a single shared parameter vector must satisfy every task's loss at once, and when two tasks' gradients point in opposing directions the naive sum of their gradients can partially cancel — or even move backward on one task. This 2D canvas renders two toy quadratic task losses as contour rings around independent optima, lets you dial a conflict angle between them, and runs a naive-sum panel side by side with a PCGrad "gradient surgery" panel on the identical landscape: projecting out the conflicting component of one task's gradient onto the other's normal plane before summing. Run the optimizer and watch each panel's trajectory trail and live loss/step telemetry to see exactly when and why gradient surgery helps.