NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Conflict-Averse Alternation: Gradient Surgery When Only One Task Is Seen Per Step

Multi-task learning trains one shared network on several objectives at once. Two families of training recipes pull in opposite directions. Methods that resolve "gradient conflict" produce the best accuracy. Gradient conflict is the situation where one task's update direction points against another's. These methods compute every task's gradient at every step and combine them carefully, which costs one backward pass and one stored gradient per task. Alternation methods are cheaper: they update on one task per step, so only one task's computation graph is ever held in memory. The price is that they never check whether this step's update undoes the progress from the last one.

We propose to get the conflict-aware update while computing only one task gradient per step. The optimizer keeps a running average of each task's gradient and refreshes only the active task's average at each step. It then solves a small conflict-averse weighting problem over these averages to decide two things: the direction to move now, and which task to sample next. In two sentences: alternation already gives you a fresh gradient for one task and stale-but-informative memories of the others. Treat those memories as stand-ins for the missing gradients, and gradient surgery becomes available at close to the cost of plain alternation.

Core Claim

Stochastic task sampling with probabilities $p$ is, in expectation, joint training with weights $p$ and extra noise. It is Random Loss Weighting restricted to one-hot weights. So plain alternation should inherit the conflict problems of equal-weight joint training. The file's numbers show how large that gap is on NYUv2, a three-task indoor scene benchmark covering segmentation, depth and surface normals. Joint training loses 6.76% on average relative to single-task models (Proactive Gradient Conflict Mitigation). CAGrad loses 0.20% and MoCo loses 0.16% (MoCo).

Our claim is that most of this gap can be closed without concurrent task graphs. The method maintains per-task gradient estimates $y_i$ and refreshes only the sampled task $k$ at step $t$:

$$y_k \leftarrow (1-\beta)\,y_k + \beta\,\nabla L_k(\theta_t), \qquad y_j \text{ unchanged for } j\neq k.$$

It then applies MoCo's $\ell_2$-regularized weight subproblem to $\{y_i\}$ to obtain weights $w$. The update direction is $d_t = \sum_i w_i y_i$. The next task is sampled with probability tied to $w$, so tasks the solver leans on most get refreshed most often. Here $\beta$ is the tracking rate. Each non-sampled $y_j$ is stale by roughly $1/p_j$ steps, where $p_j$ is task $j$'s sampling probability.

The open question, and the scientific content of the project, is whether that staleness is benign for moderate task counts and when it breaks. We expect it to break most readily on CelebA, which has 40 binary attribute tasks.

Relation to Prior Work

Three alternation papers supply the regime, and none mitigates conflict across steps. ALRIGHT/MAXRIGHT alternates between supervised fine-tuning and preference optimization, either with Bernoulli sampling or by favoring whichever objective lags further behind its optimum. It shows alternation avoids the more than 35% GPU increase of loss mixing, but it handles only two objectives and projects nothing. AGD/IMP alternates dataset-objective pairs per step in a multimodal Transformer. It depends on mixture-of-experts routing to limit interference and never measures conflict. TurboTrain interleaves $n$ unconstrained steps with $m$ conflict-suppressing steps. During the $m$ steps it pays the full per-task gradient cost, and $(n,m)$ must be tuned. Our method has no separate phases: every step is both cheap and conflict-aware.

Two papers supply the method. MoCo proves that feeding noisy mini-batch gradients into nonlinear weighting rules biases the result, and it fixes this with running-average tracking. MoCo refreshes all trackers every step, though. We keep its tracker and subproblem but replace simultaneous refresh with sampled refresh. That turns its variance-reduction device into a substitute for the gradients we never computed. CAGrad supplies the worst-case-improvement objective we use as a solver variant. Gradient Surgery (PCGrad) defines the conflict diagnostics we measure: negative cosine between task gradients, magnitude imbalance and curvature.

Two papers constrain the design. Random Weighting shows that random loss weights beat several dynamic schemes and regularize toward flatter minima. Stochastic sampling noise is therefore partly beneficial, and our method must not remove it entirely. The same paper reports that random gradient weighting degrades on CelebA, which warns that many-task regimes punish naive stochasticity. Gradient Projection Memory shows that stored summaries of past tasks can protect them cheaply in continual learning. Its hard orthogonality would prevent the useful sharing that multi-task learning depends on, so we use soft, conflict-only weighting instead.

Research Program

We will build the optimizer as a wrapper around any single-task training loop. Trackers are kept only for shared backbone parameters and stored in bf16. On NYUv2 and Cityscapes, the second benchmark with two urban-scene tasks (segmentation and depth), this adds $T$ parameter-sized buffers but no extra activation memory. We will measure both costs separately, because activations dominate for dense decoders. We will also test a reduced-memory variant that tracks only the last $L$ shared blocks and applies plain updates below them.

The analysis has two parts. The empirical part asks whether plain alternation actually suffers step-to-step undoing. We will log, at every step, the change in each inactive task's loss on a fixed probe batch, and the cosine between the fresh gradient and the other trackers. This tests directly whether the problem we target exists, or whether the momentum inside Adam already averages it away. The theoretical part extends MoCo's convergence argument to sampled refresh. We expect a bound whose staleness term grows with $\max_j 1/p_j$ and shrinks with $\beta$. That form comes from treating the stale tracker as a delayed gradient, and it predicts that degradation should grow with task count at fixed $\beta$.

Baselines

The naive reference is equal-weight joint training on the same backbone. The file reports a 6.76% average drop on NYUv2 (Proactive Gradient Conflict Mitigation); MTAN, a multi-task attention architecture, is reported at 5.59% (CAGrad).

The strongest accuracy competitor is MoCo, at 0.16% on NYUv2 and 86% success combined with CAGrad on Meta-World MT10, a benchmark of 10 simulated robot-arm manipulation tasks (MoCo). CAGrad alone reaches 0.20%. MoCo sees every task gradient every step, so we treat it as a ceiling rather than something we must beat. Success means matching it within noise at a fraction of the per-step cost.

The strongest cost-matched competitor is plain alternation. We run it with uniform sampling (an $N$-task ALRIGHT) and with lag-driven sampling (an $N$-task MAXRIGHT, ALRIGHT/MAXRIGHT). We also run Random Loss Weighting (Random Weighting), reported as a 1.04% relative improvement over equal weighting on NYUv2.

A further baseline is "accumulate-then-surgery". It runs $T$ single-task backward passes in sequence, stores the $T$ gradients, and applies one CAGrad update. Its activation memory matches ours, but it makes $T$ times fewer updates.

On CelebA, the reported references are 0.772 for the baseline and 0.788 for REMA, a rated exponential-moving-average loss weighting (EMA weighting). On Cityscapes: no reported result found on Lacuna for Cityscapes scalar metrics of these methods, so we will rerun all of them.

Fairness rules apply to every method: the same backbone, data and total number of forward-backward passes, and an equal hyperparameter search budget. For our method that budget covers $\beta$ and the regularizer; for the baselines it covers their own knobs. We will report results at matched per-task gradient evaluations and also at matched wall-clock time.

The key ablations isolate each ingredient. The first uses trackers with equal weights and no surgery; this is pure variance reduction. The second applies surgery against the last raw gradient seen for each task, with no averaging. The third uses conflict-averse directions with uniform rather than solver-driven sampling.

Why not just…?

Why not just alternate with Adam and trust its momentum to average tasks? Adam's momentum is an equal-weight blend of recent task gradients, so at best it reproduces joint training, and joint training is the method with the 6.76% drop. It also never downweights a conflicting direction. The probe-batch undoing measurements and the "trackers, no surgery" ablation settle this directly. If plain alternation shows no measurable undoing and matches our method, the proposal's premise is wrong, and we will report that.

Why not just use Random Loss Weighting? It is strong and free of tuning, but it computes every task's loss graph every step, so it forfeits the memory argument. The file also places it behind CAGrad and MoCo on NYUv2. If our method does not beat it at equal compute, the conflict machinery is not earning its keep.

Why not just accumulate one gradient per task and then apply CAGrad? This is the most serious threat, because it gives exact rather than stale gradients at the same activation memory. For small $T$, such as NYUv2's three tasks, it may well match us. Our bet is that updating every step with stale estimates outperforms updating every $T$ steps with fresh ones as $T$ grows. The CelebA runs with 40 tasks and the matched-update comparison decide this. If accumulation wins everywhere, we will narrow the contribution to the staleness analysis.

Why not just sparsify updates as in proactive sparse training? Sparse training reduces how often conflict occurs, bringing joint training from 6.76% down to only 5.31% (Proactive Gradient Conflict Mitigation), far from the conflict-aware methods. It is complementary to our method, and we will test the combination rather than treat it as a competitor.

Proposed Experiments

The first stage uses NYUv2 and Cityscapes with the standard shared-encoder setups used by CAGrad and MoCo. We report the average task drop $\Delta m\%$ against single-task models, peak GPU memory and throughput. This stage is decisive in a specific sense: our method must close most of the distance between plain alternation and MoCo on NYUv2 while keeping memory close to alternation's.

The second stage uses CelebA's 40 tasks. It tests the staleness prediction by sweeping $\beta$ and comparing against accumulate-then-surgery and REMA's 0.788.

The third stage uses Meta-World MT10 with a multi-task soft actor-critic agent, a standard reinforcement-learning method. Here per-task data arrive naturally one environment at a time, and the reference is MoCo+CAGrad's 86%.

The fourth stage is a scale check on two-objective language-model post-training with Pythia-1b. It asks whether conflict-averse alternation improves on MAXRIGHT for supervised fine-tuning versus preference optimization, at the same memory profile.

Across all stages, the result that would falsify the idea is uniform alternation matching our method once the budget is matched. The result that would confirm it is a gap that widens with task count until staleness finally erodes it at the point the bound predicts.