Spending the Attack Budget Where It Matters in Fast Adversarial Training

Adversarial training makes image classifiers resistant to small worst-case input perturbations. It does this by training on attacked versions of each example, and each attack costs extra forward and backward passes. The standard multi-step version, PGD-10, runs ten gradient steps per example and is roughly ten times slower than ordinary training. Single-step methods are cheap but lose robustness at large perturbation sizes. Both spend that compute uniformly, and a uniform split is wasteful. Many examples are already misclassified after the first step, so further steps only push them deeper past the decision boundary. Other examples sit just on the correct side of the boundary and one step does not flip them, yet they never get a second step. We propose to treat the total number of attack gradient steps in a minibatch as one shared budget. After a cheap first step, we read each example's margin and give the extra steps only to examples that are still correctly classified and close to flipping. We also stop pushing any example once it has crossed the boundary.

The idea comes from a line of work on "confidence-weighted gradient bias": when an attack budget is shared across samples, cross-entropy pours effort into samples that are already lost. Fixing this improved graph attacks and distributional attacks. We argue that standard pixel-space adversarial training has exactly one shared budget, the attacker's compute, and that this is where the fix belongs. The target is to close most of the robustness gap between single-step training and PGD-10 at large perturbation radii, at two to three gradient evaluations per example instead of eleven. A second target is better clean accuracy than PGD-10, because fewer training examples are driven far past the boundary.

Core Claim

The obvious combination of these directions would be to plug a confidence debiasing weight into single-step adversarial training. For a sign-based ℓ∞ attack this does nothing. Towards Reasonable Budget Allocation in Untargeted Graph Structure Attacks via Gradient Debias shows that negative cross-entropy gradients scale like $1/P$, where $P$ is the model's probability on the true class. It cancels this by reweighting with $\lambda = P$. That helps in graphs because a single global edge-flip budget is split across all nodes, so per-node gradient scale decides where flips go. In FGSM and PGD, the sign operation and the per-example ε-ball normalize each example separately, so multiplying one example's loss by a positive scalar leaves its perturbation unchanged.

Wasserstein distributional robustness of neural networks has the same structure. Its rectified loss (ReDLR) zeroes gradients on already-misclassified points because a distribution-level transport budget is shared. The lesson from both papers is therefore conditional: debiasing matters when a resource is shared across samples. Gap 1 in our source material, debiasing the N-FGSM step, misses this condition. We will confirm the null result in a short check rather than build on it.

Our claim is that the shared resource in vision adversarial training is the attacker's gradient evaluations. The confidence-bias argument applies directly to how those evaluations are split across examples. Concretely, we fix an average of $\rho$ extra gradient steps per example on top of an N-FGSM first step. We give those steps to the examples with the largest predicted gain in capped loss, counting already-misclassified examples as having zero gain. This should recover a large part of the PGD-10 robustness that single-step training gives up, at matched or lower compute than uniform two- or three-step PGD.

Research Program

The method starts every example with the N-FGSM step from Towards fast and effective single-step adversarial training. That step adds large random noise (magnitude $2\epsilon$, not clipped back to the clean point) and then takes one FGSM step. The paper reports that this avoids catastrophic overfitting, the failure in which a single-step-trained model looks robust to its own attack but collapses under multi-step attacks. N-FGSM therefore supplies the cheap, stable base we reuse.

After that step we compute, for each example $i$ in a batch of size $n$, the logit margin $m_i$. This is the true-class logit minus the largest other logit at the perturbed point. We also compute the margin drop $g_i$ produced by the first step. We then choose a subset $S$ of examples to receive further attack steps by solving

$$\max_{S,\ |S| \le \rho n} \sum_{i \in S} \min\big(\max(m_i,0),\, g_i\big).$$

The summand is a first-order guess of how much margin one more step will remove before the example flips. It is zero for examples already misclassified, which is the ReDLR rectification, and it is small for examples far from the boundary. The selected examples take further PGD steps on a rectified objective that stops at misclassification. This allocation is a greedy top-$\rho n$ selection with negligible cost. The model update then uses the resulting adversarial batch as usual.

The research has three parts. First, we test whether the allocation rule beats uniform and random allocation at matched gradient evaluations across perturbation radii, especially $\epsilon = 16/255$ on CIFAR-10, where the single-step gap is largest. Second, we test the clean-accuracy mechanism. TART: Boosting Clean Accuracy Through Tangent Direction Guided Adversarial Training argues that perturbations pushed off the data manifold distort decision boundaries and cost clean accuracy. We test the cheaper hypothesis that much of this harm comes from overkilled, already-misclassified examples. We measure how far each training example travels past the boundary under each scheme and correlate that with clean accuracy. We use no autoencoder or precomputed tangent spaces, so the method stays compatible with online augmentation, a limitation TART acknowledges.

Third, we use transferability as an audit, not as the goal. A training scheme that decides attack effort from the model's own confidence could learn to hide gradients. We therefore evaluate every trained model with AutoAttack from RobustBench: a standardized adversarial robustness benchmark, which warns that published robustness is often overestimated by more than 10%. We also evaluate with transfer attacks from an independently trained PGD-10 model. If black-box transfer attacks succeed where white-box attacks fail, the robustness is masked.

As a secondary measurement, we record how well each trained model works as a surrogate for attacking standard models. Why Does Little Robustness Help? Understanding Adversarial Transferability From Surrogate Training and Early Stop And Adversarial Training Yield Better surrogate Model: Very Non-Robust Features Harm Adversarial Transferability show that surrogate quality depends on smoothness and gradient similarity. Allocated training perturbs fewer examples heavily, so it may land in the "little robustness" regime those papers favor. We report this but make no claim about it.

Baselines

The naive reference point is N-FGSM alone, with one attack gradient step per example. It is the cheapest method that does not collapse. The file gives its ImageNet result at $\epsilon=6/255$: 17.12% robust accuracy under PGD-50-10, against 16.49% for RS-FGSM and 0.08% for plain FGSM (Towards fast and effective single-step adversarial training). For CIFAR-10 at $\epsilon=16/255$, no reported result was found on Lacuna for N-FGSM robust accuracy, so we will rerun it with its published hyperparameters. Beating this baseline means higher AutoAttack accuracy at no more than about 2.5 gradient evaluations per example, with clean accuracy no lower.

The strongest competitor at matched compute is uniform PGD with the same average number of steps: N-FGSM initialization followed by $\rho$ uniform PGD steps for every example. This is the direct test of whether allocation adds anything beyond simply spending more compute. We tune step sizes for it with the same grid and seed count as our method.

The strongest accuracy-oriented reference is PGD-10 adversarial training. It sets the robustness ceiling that our method approaches at roughly a quarter of the cost. It is also the clean-accuracy point we aim to exceed.

Among methods that use sample confidence during training, the strongest is MWPB/SDWPB from Improving Adversarial Training using Vulnerability-Aware Perturbation Budget. It scales each example's ε by its logit margin rather than its step count. It reports 54.16% AutoAttack accuracy on CIFAR-10 with WideResNet-34-10, against 51.92% for standard adversarial training, while keeping a full multi-step inner loop. We run MWPB both on its own and on top of our allocation. The two methods change different things, radius versus effort, so we expect them to combine. If MWPB on N-FGSM alone matches our method, our method adds nothing.

Two ablations isolate the key ingredient. The random-allocation ablation gives the same $\rho n$ extra steps to randomly chosen examples. The stop-only ablation applies rectification, stopping misclassified examples, but does not reassign the saved steps. If random allocation matches confidence allocation, the confidence signal is not doing the work. If stop-only matches the full method, reallocation is not doing the work.

All methods use the same architectures (PreActResNet-18 and WideResNet-34-10 on CIFAR), data augmentation, epoch count and learning-rate schedule. We report compute both as forward-backward passes and as wall-clock time on the same hardware.

Why not just…?

Why not just debias the N-FGSM gradient with GraD's $\lambda = P$ weight? For sign-based ℓ∞ steps with a per-example ball, a positive per-example loss weight cannot change the perturbation. We will demonstrate this in a one-run check showing identical adversarial batches. GraD's gains came from a shared global budget (Towards Reasonable Budget Allocation in Untargeted Graph Structure Attacks via Gradient Debias), and that is precisely the structure we recreate by sharing compute.

Why not just run uniform PGD-2 or PGD-3? This is the real threat. If most examples need about the same effort, uniform steps will do as well as allocation. Our bet rests on the margin distribution after one step being heavy at both ends: many examples already flipped, many far from flipping. The matched-compute comparison settles it. We also report the fraction of examples misclassified after step one, so that a negative result can be explained.

Why not just change per-example ε, as MWPB does, instead of per-example steps? MWPB reshapes what each example's worst case is, but still pays a full multi-step loop for every example. Its reported gain is at PGD-level cost (Improving Adversarial Training using Vulnerability-Aware Perturbation Budget). Our method reduces the loop itself. The MWPB-on-N-FGSM run tells us whether budget reshaping alone, with no extra steps, already closes the gap.

Why not just spend the extra compute on more N-FGSM epochs? Longer single-step training at the same total compute is a fair alternative. We include it. N-FGSM's own report that a gap to PGD remains at large radii suggests more epochs of the same weak attack will not close it. If it does, allocation is unnecessary.

Why not use second-order smoothing such as GradAlign? The N-FGSM paper reports GradAlign at roughly three times the cost of N-FGSM with no better results. Second-order regularizers are therefore dominated on the compute axis we care about.

Proposed Experiments

We train on CIFAR-10, CIFAR-100 and SVHN at $\epsilon \in \{8, 12, 16\}/255$ with $\rho \in \{0.5, 1, 2\}$, using three seeds each. We also train on ImageNet at $\epsilon = 6/255$ to compare against N-FGSM's published 17.12%. Metrics are clean accuracy, AutoAttack accuracy, PGD-50-10 accuracy, gradient evaluations per example, wall-clock time, and black-box transfer-attack accuracy from an independent PGD-10 surrogate.

Four checks decide whether the claim holds. First, at $\epsilon=16/255$ on CIFAR-10, confidence allocation must beat both uniform PGD at matched steps and the random-allocation ablation on AutoAttack, by more than the seed-to-seed spread. Second, its clean accuracy must exceed PGD-10's, and this must coincide with smaller past-boundary travel of training examples. Third, white-box and transfer evaluations must agree, with no sign of catastrophic overfitting or gradient masking. Fourth, the gain must persist at ImageNet scale relative to 17.12%.

If the first check fails, the shared-compute view of confidence bias is wrong for vision adversarial training, and we will report that. If only the second fails, the result is a speedup without the clean-accuracy benefit.