Gradient Surgery: Resolving Conflicting Task Gradients (PCGrad)
Interactive 3D loss-landscape simulator: watch a shared parameter vector descend two or three quadratic task losses, compare a naive gradient sum against PCGrad's conflict-projecting gradient surgery, and read live cosine-similarity and loss telemetry.
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 simulator renders each task's quadratic loss as a bowl on a shared 3D landscape, lets you dial a conflict angle between task optima, and compares plain gradient summation against PCGrad's "gradient surgery": projecting out the conflicting component of one task's gradient onto the other's normal plane before summing. Run the optimizer, watch the instanced trail of past positions, and read live cosine-similarity and combined-loss telemetry to see exactly when and why gradient surgery helps.
Watch a shared parameter vector descend two or three quadratic task-loss bowls on a live 3D terrain, and compare a naive gradient sum against PCGrad's gradient-surgery projection when task gradients conflict.
3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install