Algorithm
How the NEAT update works, from conflict detection to the parameter step (nce_spec_v2).
NEAT detects directional conflict between a gradient and an opponent proxy . When conflict is present, it applies a bounded correction, called Nash Conflict Elimination (NCE), before momentum and weight decay. The current specification is nce_spec_v2.
Update rule
The measured conflict is non-zero only when the gradient points against the opponent:
Next comes the projection of the gradient onto the opponent direction:
The correction removes the conflicting component, scaled by and the conflict:
Finally, the corrected update passes through momentum and decoupled weight decay:
Here is the learning rate and is the weight decay. If there is no conflict, and NEAT reduces to standard momentum SGD.
Math spec: nce_spec_v2
o_t = opponent_proxy(g_t, m_{t-1}) # momentum, gradient EMA, previous gradient, or blended
conflict_t = relu(-cos(g_t, o_t))
alpha_t = adaptive_alpha(alpha, rho_t, eta_t, a_t) # = alpha unless adaptive_alpha=True
proj_t = proj_{o_t}(g_t)
nce_t = -alpha_t * conflict_t * proj_t # clipped to nce_clip_ratio * ||g_t||
u_t = g_t + nce_t
m_t = beta * m_{t-1} + (1 - beta) * u_t
theta' = (1 - lr * wd) * theta_t
theta_t+1 = theta' - lr * m_tWorked example
With , , , , and learning rate :
conflict_t = 1.0
proj_t = [1.0, 0.0]
nce_t = [-0.5, 0.0]
u_t = [0.5, 0.0]
m_t = [0.5, 0.0]
theta_t+1 = [0.95, 2.0]The gradient points straight against the momentum, so half of it is removed before the step.
Optional extensions
All of these default to off.
Adaptive alpha (adaptive_alpha=True) makes the correction strength tensor-local and data-dependent. Conflict and gradient noise increase it; stable positive alignment reduces it:
where , and are running averages of conflict, gradient noise and alignment.
Adaptive preconditioning (adaptive_preconditioning=True) keeps an Adam-style second moment and divides the step by . It rescales coordinates by observed squared gradients; it is not a Hessian or curvature estimate.
Stabilizers: update_mode="lion" applies a sign update after the correction, nesterov=True uses Nesterov-style momentum, and lookahead_k syncs slow weights every steps. See Configuration.
Opponent sources
The opponent proxy is selected with opponent_source: momentum (default), gradient_ema, previous_gradient, or blended. In player-aware mode, the default opponent is the mean of the other players.
Why "Nash-inspired"
NEAT interprets directional disagreement as an interaction between two signals, the current gradient and the trajectory so far. It does not compute a Nash equilibrium or inherit the guarantees of Nash-bargaining methods such as Nash-MTL.
The closest relatives are multi-task gradient-surgery methods like PCGrad and CAGrad. Those compare gradients from separate tasks at the same step; NEAT's standard optimizer compares the gradient against its own history. The full comparison is in related work.
Spec versions
nce_spec_v2 is the frozen default. Pass spec_version="nce_spec_v3" to opt in to additive research controls: conflict granularity, an L2 trust-region correction bound, scheduled momentum/gradient-EMA opponent ensembles, correction/preconditioner ordering, and deterministic reference reductions. v3 is not used for any headline claim, and some v3 combinations are reference-engine-only; framework adapters reject them explicitly.
The executable specification lives in docs/research/math-spec.md.