arXiv:2610.30018cs.LGOct 2026

Manuscript Offprint

arXiv:2610.30018

ExGrad: Beyond Suppression - Explicit Clean-Gradient Subtraction in Adversarial Training

Zhiyuan Ye, Xiangyu Zhou, Ji Qi, Hao Zhang, Yi Zhou

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Adversarial training usually derives updates from predefined surrogate losses, but source-loss descent does not directly characterize an update's finite-step effect on current adversarial margins. We introduce ExGrad (extrapolative gradient recomposition), which constructs gradients at clean-input, adversarial-input, and adversarial-weight-perturbed (AWP) states for each mini-batch. Lightweight virtual steps measure their local margin responses, after which a globally solvable three-variable problem selects their coefficients over a bounded affine domain without nonnegativity constraints. Across different affine radii R on CIFAR-10, negative clean coefficients rapidly become predominant, and their magnitude increases with R. Cross-zero interventions show that setting this coefficient to zero is insufficient: mild subtraction further improves PGD-20, while stronger subtraction trades clean accuracy for additional PGD-20. In CIFAR-10 WRN-28-4 controls, none of the three tested candidate-removal variants matches full ExGrad, showing that subtraction requires both adversarial directions in this setting. Projection diagnostics show that a negative clean coordinate usually coexists with a positive net clean-axis projection, although both decrease as the radius grows. Norm-matched controls further indicate that update magnitude alone does not explain the moderate-radius gains. Experiments on CIFAR-10, CIFAR-100, and ImageNet-100 show radius-dependent improvements over AWP. On CIFAR-100, ExGrad with R = 0.8 improves all five reported metrics, including clean and AutoAttack accuracy by 3.84 and 1.75 percentage points, respectively. On ImageNet-100, the same radius improves all four robust metrics over both AWP and PGD-AT. These results identify explicit clean-gradient subtraction as a response-revealed update preference whose strength and clean–robust operating point are controlled by the affine radius.

Introduction

Adversarial robustness depends on the stability of a classifier's local decision geometry. For an input x with label y, define the signed classification margin

mθ(x,y)=fy(x;θ)−max⁡k≠yfk(x;θ),m_{\theta}(x,y)=f_{y}(x;\theta)-\max_{k\neq y}f_{k}(x;\theta),

where fk(x;θ)f_k(x; \theta) is the logit of class kk. A robust model must preserve a sufficient margin not only at the clean input but throughout the allowed input neighborhood (Szegedy et al. 2014; Goodfellow, Shlens, and Szegedy 2015; Madry et al. 2018). Decision-boundary distance and local loss linearity provide complementary geometric views of this neighborhood (Moosavi-Dezfooli, Fawzi, and Frossard 2016; Qin et al. 2019). Adversarial training can therefore be viewed as repeatedly reshaping this local geometry through parameter updates.

Most robust-training procedures obtain an update directly from a predefined surrogate loss. A gradient g=∇θL(θ)\mathbf{g} = \nabla_{\theta} L(\theta) is the first-order sensitivity of its source loss: moving along −g-\mathbf{g} locally reduces LL. This source-loss descent sensitivity, however, is not the same quantity as the response of a target adversarial margin. For a small step,

mθ′(x,y)−mθ(x,y)≈−η⟨∇θmθ(x,y),g⟩,θ′=θ−ηg.\begin{align*}m_{\theta^{\prime}}(x,y)-m_{\theta}(x,y)&\approx-\eta\langle\nabla_{\theta}m_{\theta}(x,y),\mathbf{g}\rangle,\\\theta^{\prime}&=\theta-\eta\mathbf{g}.\end{align*}

A direction may reduce the loss from which it was derived yet provide limited margin improvement, or even compress the margin of some adversarial examples. The locally preferred update is consequently determined by its effect on the target geometry, not by its source label alone.

This mismatch is not resolved by tuning a surrogate-loss coefficient. Such a coefficient controls how source objectives generate an update, but it does not report how that update changes the adversarial margin of the current mini-batch. Gradient norms and pairwise angles are also insufficient for this purpose: they describe the candidate directions relative to one another, rather than their effects on the target geometry. This motivates treating a gradient as a candidate parameter intervention whose consequence should be measured before it is selected.

This distinction becomes actionable when several training states already provide plausible directions. We consider gradients evaluated on clean inputs, adversarial inputs, and adversarial inputs under adversarial weight perturbation (AWP), denoted by gcleang_{clean}, gadvg_{adv}, and gawpg_{awp}. The first captures nominal fitting, the second input-neighborhood robust fitting, and the third the correction induced by a perturbed parameter neighborhood (Wu, Xia, and Wang 2020). Their effects can complement or cancel one another and can change with the mini-batch and training stage. Fixed loss weights, gradient norms, or pairwise angles do not directly measure these effects on the adversarial margin.

These candidates are not three unrelated tasks. They form a nested sequence of training states: clean input at nomi-nal weights, adversarial input at nominal weights, and adversarial input at perturbed weights. Each transition adds a robustness-relevant state change, while the adversarial margin supplies a common criterion for comparing all three candidate updates.

We introduce ExGrad, short for extrapolative gradient recomposition. For every mini-batch, ExGrad applies a lightweight virtual update along each candidate gradient from the same nominal parameters, measures the resulting finite-step adversarial-margin response, restores the parameters, and solves for a single recomposed update. The coefficients satisfy

{gβ=βcleangclean+βadvgadv+βawpgawp,1⊤β=1,∥β∥2≤R.\left\{\begin{aligned}\mathbf{g}_{\beta}&=\beta_{\mathrm{clean}}\mathbf{g}_{\mathrm{clean}}+\beta_{\mathrm{adv}}\mathbf{g}_{\mathrm{adv}}+\beta_{\mathrm{awp}}\mathbf{g}_{\mathrm{awp}},\\ \mathbf{1}^{\top}\boldsymbol{\beta}&=1,\qquad\|\boldsymbol{\beta}\|_{2}\leq R.\end{aligned}\right.

The unit-sum constraint defines an affine combination, while the radius R bounds its departure from balanced recomposition. Unlike a nonnegative loss mixture, this domain lets the measured response suppress, remove, or subtract a candidate direction. The coefficients are therefore determined from the measured responses rather than prescribed in advance.

Probing every candidate from the same nominal parameters makes the measured responses directly comparable. The virtual parameters are discarded after measurement, so only the recomposed direction is committed to the optimizer. This finite-step construction evaluates the consequence of an update in the units used by training, without requiring an analytic derivative through the adversarial-example or weight-perturbation construction.

The measured dynamics reveal a persistent negative clean coefficient. A majority of mini-batches already select βclean<0\beta_{clean} < 0 at the beginning of training, the proportion rapidly approaches one, and some early mini-batches remain positive. This behavior is stronger than simply assigning the clean direction a small weight: it crosses the zero-clean boundary into explicit subtraction within the selected affine representation. A controlled intervention confirms that setting βclean=0\beta_{clean} = 0 does not reproduce the same robustness profile as a mild negative value.

The zero point therefore marks the boundary between clean-gradient removal and explicit affine subtraction. A positive coefficient retains clean descent, zero removes it from the affine representation, and a negative coefficient explicitly subtracts it. In the intervention, the adversarial and AWP coefficients remain response-adaptive, isolating whether suppression is sufficient or crossing into subtraction helps.

The affine coordinate must nevertheless be distinguished from the complete update geometry. Because gadvg_{adv} and gawpg_{awp} can also project onto gcleang_{clean}, a negative βclean\beta_{clean} does not imply that gβg_{\beta} has a negative net component along the clean axis. We therefore analyze

pclean=⟨gβ,gclean⟩∥gclean∥22.p_{clean}=\frac{\left\langle\mathbf{g}_{\beta},\mathbf{g}_{clean}\right\rangle}{\left\|\mathbf{g}_{clean}\right\|_{2}^{2}}.

Both βclean\beta_{clean} and pcleanp_{clean} decrease as R grows, indicating that stronger negative clean coefficients progressively suppress the realized clean-axis component. Complete reversal is rarer and appears mainly at the largest radius late in training. Norm-matched controls further show that the directional effect survives after matching the recomposed update to the AWP gradient norm, although update magnitude contributes to part of the gain at larger R.

We evaluate ExGrad on CIFAR-10, CIFAR-100, and ImageNet-100 with two Wide ResNet capacities. At suitable radii, ExGrad improves the principal robustness metrics over AWP across all three datasets. The improvements include all four robustness metrics on CIFAR-10 with WRN-34-10, all five reported clean and robust metrics on CIFAR-100, and all four robustness metrics on ImageNet-100. Our contributions are:

• We separate source-loss descent sensitivity from finite-step adversarial-margin response and use the latter to select robust-training updates.

• We propose a lightweight, convex, batch-wise coefficient solver over the bounded affine span of clean, adversarial-input, and AWP gradients.

• We identify explicit clean-gradient subtraction, intervene across its zero boundary, and distinguish its affine coordinate from the net clean-axis projection.

• We use multi-seed cross-dataset evaluation and norm-matched controls to establish the performance effect and delimit scale-based explanations.

References (35)