Recycled Perturbations as Margin Sensors for Cheap, Accurate Adversarial Training

Adversarial training makes image classifiers resistant to small, deliberately crafted input perturbations. It does this by training on worst-case perturbed inputs. Two costs come with it. Finding each perturbation normally takes ten or more extra gradient steps per example, which makes training several times slower. And clean accuracy, the accuracy on unperturbed images, drops noticeably. The two problems have mostly been attacked separately. "Fast" methods replace the multi-step search with one gradient step started from a perturbation remembered from earlier training, so the attack is warm-started rather than begun from random noise. "Trade-off" methods recover clean accuracy with extra machinery, such as a clean teacher network, but they keep the expensive multi-step search.

This proposal argues that the warm-start state already measures what the trade-off methods need. When the remembered perturbation from the last epoch no longer fools the model, and the model classifies it correctly with a wide logit margin, that example has been pushed into excessive margin: its decision boundary has moved much farther away than the threat model requires. That excess is the mechanism blamed for lost clean accuracy. This signal is free, because the forward pass at the warm-start point is computed anyway to take the single gradient step. We propose to use it to decide, per example and per step, how strongly to pull the boundary back toward a clean teacher's. The result should be a single-step training method with the clean accuracy of the best multi-step trade-off methods.

Core Claim

Helper-based training corrects excessive margin by labeling points at twice the attack distance with a frozen standard teacher (Reducing Excessive Margin, which we call HAT). We claim this correction can be driven entirely by perturbations from a warm-started one-step attack (Prior-Guided Adversarial Initialization). We further claim it works better when gated by the model's margin at the recycled starting point. The target is clean accuracy and AutoAttack robustness matching HAT, at a per-iteration cost close to single-step fast training rather than ten-step training.

The training objective for an example $x$ with label $y$ is

$$ \mathcal{L} = \mathrm{CE}(f(x+\delta), y) + \beta\,\mathrm{KL}\big(f(x+\delta)\,\|\,f(x)\big) + \gamma\, w(x)\,\mathrm{CE}\big(f(x+2\delta), \hat{y}_T(x+2\delta)\big). $$

The terms are defined as follows:

  • $f$ is the robust model being trained.
  • $\delta$ is the perturbation from one gradient-sign step started at the recycled perturbation $\delta_0$ and projected into the allowed ball.
  • $\hat{y}_T$ is the label predicted by a frozen, normally trained teacher.
  • $\beta$ and $\gamma$ are loss weights.
  • $w(x)=\sigma\big((m(x+\delta_0)-\tau)/s\big)$ is the gate. Here $m(x+\delta_0)$ is the model's logit margin (true-class logit minus the largest other logit) at the warm-start point, $\tau$ is a threshold, $s$ is a temperature, and $\sigma$ is the logistic function.

The gate is large exactly where the old attack is "overly defended". It is small for borderline points, where helper anchoring would only weaken robustness.

Why This Is Not Already Done

The three fast-training papers stop short of clean accuracy:

- Prior-Guided Adversarial Initialization recycles batch, epoch, or momentum perturbations.

All three use their initializations only to prevent catastrophic overfitting, the sudden collapse of single-step training into a model that resists one-step attacks but not multi-step ones. None examines how the start point shapes decision margins.

The trade-off papers all run cold-started multi-step search in the inner loop:

The closest per-example idea is GAIRAT, which weights examples by how many search steps are needed to flip them. That proxy requires full multi-step search, so it constrains our design. GAIRAT's reported drop to roughly 40% under Carlini-Wagner attacks warns that margin-based reweighting can overfit to one attack. Our gate must therefore be validated against several attack families, not only gradient-sign search.

The idea is also distinct from the black-box warm-starting literature. Hybrid Batch Attacks and Prior-OPT seed query attacks from surrogate models at test time. Hybrid Batch Attacks also supplies a tension we test directly: a normally trained surrogate fails to warm-start attacks on robust models because their vulnerable directions barely overlap. HAT, by contrast, finds that a normally trained teacher is useful for labeling helpers. If warm-started perturbations drift toward robust-model-specific directions, the teacher's labels at $x+2\delta$ might simply equal $y$ almost everywhere, and the helper term would become vacuous. We measure this rather than assume it away.

Research Program

The first stage is diagnostic. We train PGD-AT, single-step training with random start, and recycled-perturbation single-step training on CIFAR-10. At fixed epochs we measure each training example's distance to the decision boundary along the attack direction and along random directions, following HAT's margin analysis with its released code (imrahulr/hat). This answers the open question of whether warm-started one-step training produces more or less excessive margin than multi-step training. We then check whether $m(x+\delta_0)$ predicts the measured excess margin. A rank correlation near zero would kill the gating idea early.

The second stage builds the method. We plug the one-step $\delta$ into HAT's helper construction, add the gate, and test two sources of recycled perturbations. The first is an epoch-level per-example buffer: about 600 MB in 32-bit floats for CIFAR-10, and we also test an 8-bit stored version. The second is a batch-level prior that needs no per-example memory. This directly addresses the memory problem that the prior-guided paper leaves open for ImageNet-scale data. The gate needs only the margin at whatever start point is used, so it works with either source.

The third stage analyzes the teacher tension. For each helper we log whether the teacher's label differs from $y$, and how cosine-aligned $\delta$ is with the teacher's own input gradient. We compare these statistics between warm-started and cold multi-step perturbations.

Baselines

The naive reference is single-step training from a random start (FGSM-RS). Learnable Adversarial Initialization reports 42.31% PGD-10 robustness for it on CIFAR-10. It anchors the cost floor and shows what happens without warm-starting.

The strongest fast competitor is FGSM-MEP. Prior-Guided Adversarial Initialization reports 55.18% PGD-10 robust accuracy on CIFAR-10 with ResNet-18, against 53.76% for PGD-AT. No reported clean accuracy for FGSM-MEP was found on Lacuna, so we will measure it ourselves.

The strongest trade-off competitors are HAT and AR-AT. HAT reports about 49% AutoAttack robustness on PreAct ResNet-18 with a roughly 2.17-point clean-accuracy gain over TRADES. AR-AT reports 90.89% clean and 50.77% AutoAttack accuracy on WideResNet-34-10, at about 1.15 times the cost of standard adversarial training, where standard adversarial training already includes multi-step search (AR-AT).

Every method will be retrained by us in a shared codebase on the same data augmentation, epochs, learning-rate schedule, and GPU type, with equal hyperparameter search budgets. We report both wall-clock time and counts of forward and backward passes.

Two ablations isolate the key ingredient. The first is HAT driven by recycled one-step perturbations with a constant gate ($w=1$). The second is the same with a random gate matched in mean.

Beating the field means two things on CIFAR-10 and CIFAR-100. First, AutoAttack robustness within one point of HAT, together with clean accuracy at least equal to HAT's. Second, total training compute at most about a third of HAT's. Clean accuracy must also strictly exceed FGSM-MEP at matched robustness.

Why not just…?

Why not just feed recycled one-step perturbations into HAT, with no gate? This is the most serious threat, and it is our first ablation. If the ungated version matches the gated one, the honest conclusion is that warm-started HAT suffices and the margin sensor adds nothing. The stage-one correlation study predicts the outcome in advance. If $m(x+\delta_0)$ does not track measured excess margin, we expect no gain from gating. The gate's specific purpose is to avoid weakening borderline examples. This matters more for single-step training than for multi-step training, because single-step training is already close to catastrophic overfitting. So we also compare collapse frequency across seeds between the two variants.

Why not just move along the curve by lowering the perturbation budget or tuning the trade-off weight in fast training? Shrinking the threat model or adding a TRADES-style term buys clean accuracy by giving up robustness. To beat this, a method must improve the whole curve, not just one point on it. We therefore sweep $\beta$ and the training budget for FGSM-MEP and for our method, and compare clean accuracy at matched AutoAttack robustness. If tuned FGSM-MEP reaches the same curve, the proposal fails on CIFAR.

Why not just run AR-AT or LBGAT with a fast inner loop? These methods' overhead is dominated by multi-step search, so swapping in FGSM-MEP is a natural competitor. We include AR-AT with FGSM-MEP perturbations as a baseline. Its reliance on split batch normalization is untested with single-step perturbations, and it says nothing about LayerNorm models. Our method has no normalization dependence, but we would concede if fast AR-AT wins on WideResNets.

Why not just reweight examples like GAIRAT? GAIRAT's step-count proxy needs a full multi-step search, which removes the cost advantage. It also degrades to about 40% under Carlini-Wagner attacks (GAIRAT). Our gate costs nothing extra, and we evaluate it under Carlini-Wagner and black-box Square attacks to show it does not specialize to one attack.

Proposed Experiments

The main grid trains PreAct ResNet-18 on CIFAR-10, CIFAR-100, and Tiny ImageNet, and WideResNet-34-10 on CIFAR-10. Perturbations are $\ell_\infty$ with $\epsilon=8/255$. We evaluate with AutoAttack under the RobustBench protocol, plus PGD-50, Carlini-Wagner, and the corruption benchmark CIFAR-10-C. Because single-step methods invite gradient masking, every fast model also goes through the attack-failure diagnostics in pralab/IndicatorsOfAttackFailure.

Three checks are decisive:

  • Excess-margin correlation: does the margin at the warm-start point rank examples by measured excess margin, with Spearman correlation above roughly 0.4?
  • The Pareto comparison at matched AutoAttack robustness, with tuned FGSM-MEP and ungated warm-started HAT as the bars to clear.
  • The teacher-disagreement rate on helpers. If the teacher almost never disagrees with $y$ on warm-started helpers, the Hybrid-Batch mismatch has won, and the helper term must be redesigned, for example by taking helper directions from the teacher's own gradient.

A final scaling run on Tiny ImageNet uses only the batch-level prior. It tests whether the method keeps its advantage without per-example memory, the regime where Learnable Adversarial Initialization reports 66.8 versus 211.2 GPU-hours against PGD-AT on ImageNet.