Single-Step Adversarial Training Along Shared Gradient Directions

Adversarial training makes image classifiers robust to small, deliberately chosen input perturbations. During training, it repeatedly attacks the model and then learns from those attacks. The attack step is expensive: a strong attack needs about 10 extra backward passes per batch. The cheap version takes a single gradient step (the Fast Gradient Sign Method, FGSM), but it is unstable. Partway through training, robustness against stronger attacks can collapse to zero, a failure called catastrophic overfitting. Robust training also tends to cost several points of accuracy on unperturbed images. This note proposes a single, cheap change to single-step training. Within each batch, we find the few input directions along which the loss gradients of many examples point together, and we perturb each example only along those shared directions. We discard the part of each example's gradient that is specific to that example.

The motivation comes from attack research. Model vulnerability concentrates in a low-dimensional "eigen-subspace", the top directions of the covariance of input gradients across examples. Those shared directions explain why a single perturbation can fool many inputs and many models at once (Origins of Low-Dimensional Adversarial Perturbations). Black-box attacks exploit this by searching only a surrogate model's low-dimensional Jacobian subspaces (GFCS, EigenBA). We turn this finding around for defense. Our bet is that the shared directions carry the transferable, boundary-relevant signal a robust model must learn to resist. We further bet that the example-specific remainder of the gradient is what drives catastrophic overfitting and over-wide decision margins. If both bets hold, training on shared directions should give stable single-step training and better clean accuracy at FGSM cost. The resulting models should also be especially resistant to transferred attacks, because those attacks live in the same shared directions.

Core Claim

Let $g_i$ be the input gradient of the loss for example $i$ in a batch of size $B$. Standard FGSM computes all $g_i$ in its single backward pass, so they come for free. We stack them into a matrix $G \in \mathbb{R}^{B \times d}$, where $d$ is the number of pixels. We then compute the top $r$ right singular vectors of $G$ with a randomized singular value decomposition (SVD), which costs almost nothing next to a backward pass when $B=128$. Let $U_r$ be the $d \times r$ matrix whose columns are those vectors. The training perturbation is

$$\delta_i = \Pi_{\epsilon}\left(\alpha \,\mathrm{sign}\left(U_r U_r^\top g_i\right)\right),$$

where $\alpha$ is the step size and $\Pi_\epsilon$ clips to the $\ell_\infty$ ball of radius $\epsilon$. The subspace is recomputed from the current model on every batch. As the model becomes robust along today's shared directions, the gradients change and the subspace moves with them.

The claim is specific and falsifiable. Compared with FGSM plus random initialization at equal cost, this projected step should do three things. It should remove catastrophic overfitting across the step sizes where plain FGSM collapses. It should match the full-space AutoAttack robustness of multi-step PGD training (projected gradient descent, the standard iterative attack) within about one point. It should raise clean accuracy. The mechanism predicts one more measurable signature: in plain FGSM, the fraction of gradient energy outside the shared subspace, $\|g_i - U_rU_r^\top g_i\|^2/\|g_i\|^2$, should jump in the epochs just before collapse.

Relation to Prior Work

The attack papers supply the geometry and the method. Origins of Low-Dimensional Adversarial Perturbations proves that gradient-covariance eigen-subspaces give near-total fooling at small budgets. Its analysis covers the "lazy" regime, where network weights stay near initialization during training, and it offers no defense. GFCS and EigenBA restrict query search to a fixed surrogate's Jacobian subspaces. LRS-Attack projects surrogate features onto low-rank and sparse components to avoid overfitting to one surrogate and so improve transfer. All four are attacks built on a fixed surrogate. We compute the subspace on the fly from the model being trained, and we use it to shape the training perturbation.

Three defenses constrain the design. Subspace Adversarial Training (Sub-AT) cures catastrophic overfitting by restricting weight updates to an ~80-dimensional subspace. That subspace is found by SVD over checkpoints from an earlier training run, and the attack itself stays in full pixel space. We leave the weights unconstrained and restrict the input perturbation instead, which needs no pre-training phase. TART shows that off-manifold perturbation components hurt clean accuracy. It measures tangency with a pre-trained autoencoder, which rules out dynamic data augmentation. Our subspace comes from the model's own gradients and is recomputed per batch, so augmentation is unaffected. HAT attributes clean-accuracy loss to excessive margins built along full adversarial directions. We test whether removing example-specific components shrinks those margins without a helper teacher model.

One paper directly challenges this proposal. Adversarial Vulnerability from Interference Between Features in Superposition shows that pressure toward low-rank structure drives features into "superposition", where more features are packed into a layer than it has dimensions. This packing produces interference patterns that models share, and in their synthetic setting it raises transfer success from 5% to 98%. So a subspace-restricted defense might leave a shared blind spot outside the subspace that attackers can reach through transfer. We treat this as a primary hypothesis to test, not a footnote.

Research Program

The work has three parts. The first is the method. We implement the projected single-step training inside the HAT codebase, which already provides standard AT, TRADES, and AutoAttack evaluation. We sweep the rank $r \in \{4, 16, 64, 256\}$ and the step size $\alpha$ up to $2\epsilon$, which is the range where FGSM collapses.

The second is the mechanism. At every epoch we log the out-of-subspace energy fraction and the input-gradient norm, whose explosion Sub-AT reports as the precursor of collapse. We also log the margin along shared versus residual directions, estimated by line search to the decision boundary. The prediction is this: if collapse is driven by example-specific components, the residual energy under plain FGSM should rise before collapse, and projection should prevent it.

The third is transfer resistance and blind spots. We attack each trained model with standard CIFAR-trained surrogates using PGD transfer, LRS-style low-rank feature attacks, and GFCS- and EigenBA-style surrogate-subspace searches. We also run a targeted attack restricted to the orthogonal complement of the model's own shared subspace, which directly probes for the blind spot the superposition paper predicts.

Baselines

The naive reference is FGSM with random initialization at the same step sizes. Its known failure is collapse to 0% robust accuracy against multi-step attacks, as documented in Subspace Adversarial Training. Beating it means no collapse at step sizes where it collapses, at essentially identical wall-clock time.

The strongest competitor on efficiency is Sub-AT. It uses the same single-step budget and has the same goal of curing collapse. Sub-AT reports "over 51% robust accuracy against PGD-50 attacks" on CIFAR-10, "matching" PGD-10 training while being "approximately seven times faster". We will rerun it with the same ResNet-18 and WideResNet backbones, the same epochs, the same augmentation, and an equal tuning budget of about 12 configurations per method. The comparison will use AutoAttack as well as PGD-50. Beating it means equal or better AutoAttack robustness and higher clean accuracy at equal or lower wall-clock time, without Sub-AT's pre-training phase. The second efficiency competitor is ATTA, which recycles perturbations across epochs and reports a 14.1× speedup over PGD-40 on CIFAR-10. We compare against it at matched GPU-hours.

For the robustness-accuracy trade-off, the reference is multi-step methods run at full cost. AR-AT reports 90.89% clean and 50.77% AutoAttack robustness on WideResNet at 1.15× standard AT cost. TRADES reaches 84.33% clean at similar robustness according to the AR-AT paper. TART reports 81.76% to 83.73% clean and 36.58% AutoAttack on WideResNet-32-10. We do not expect to match AR-AT's absolute numbers at one-tenth the attack cost. Instead, we compare clean-versus-robust curves at matched compute budgets, and we also combine projection with AR-AT to test whether the two are complementary.

The ablation that isolates the key ingredient keeps everything fixed and swaps the subspace. The first variant uses a random $r$-dimensional subspace, which tests whether any dimensionality reduction helps. The second uses the top-$r$ PCA components of the input data, the static data prior used by the PCA gradient-estimation attacks (Black-box Attacks on Deep Neural Networks via Gradient Estimation), which tests whether the benefit is simply low-pass filtering. The third uses the complement of the shared subspace, keeping only the example-specific remainder. That last variant should reproduce collapse if the mechanism is right.

Why not just…?

Why not just use FGSM with random initialization and careful tuning? It is the right starting point, but its failure is documented. In Subspace Adversarial Training, robustness collapses to 0% within a single epoch under large learning rates and step sizes. Our step-size sweep will show whether projection widens the stable range or merely matches a well-tuned FGSM. If it only matches, the method's value reduces to clean accuracy, and we will say so.

Why not just project onto the data's principal components, which is static and even cheaper? This is a real threat. If low-frequency data directions explain the benefit, the gradient subspace is unnecessary. The data-PCA ablation settles it directly. Our prediction is that data PCA removes off-manifold noise, in line with TART, but misses the model-specific shared directions that Dohmatob et al. identify, so it should give lower AutoAttack robustness. If PCA matches us, we will report the simpler method as the finding.

Why not just use Sub-AT, which already cures collapse at single-step cost? Sub-AT needs an initial training phase and an SVD over checkpoints, and it restricts how the weights can move. It reports robustness, but its clean-accuracy side and its behavior under transfer attacks are not covered in the file. The compute-matched head-to-head comparison, and the stacking of Sub-AT with projection, will show whether input-side and weight-side restriction are redundant or complementary.

Why not just recycle perturbations as ATTA does? ATTA spreads the multi-step attack over epochs but still perturbs along full example-specific directions, so it does not target clean accuracy. The two ideas are compatible: shared-subspace coefficients can be accumulated across epochs. We test ATTA alone, projection alone, and the two combined at matched GPU-hours.

Decisive Experiments

The main benchmarks are CIFAR-10 and CIFAR-100 at $\ell_\infty$ radius $\epsilon=8/255$ with ResNet-18 and WideResNet-34-10, reporting clean accuracy, AutoAttack accuracy, and wall-clock time. ImageNet with ResNet-50 serves as the scaling test, set against ATTA's reported 97 single-GPU hours. We also evaluate transfer robustness against PGD, LRS-Attack, and GFCS/EigenBA-style attacks, and robustness to attacks restricted to the complement subspace.

Three outcomes decide the proposal. First, projection must prevent collapse where FGSM collapses, and the complement-only ablation must reproduce collapse. Second, full-space AutoAttack robustness must stay within about one point of PGD-10 training while clean accuracy rises. Third, the complement-subspace attack must not find a blind spot. If it does, meaning robustness outside the shared subspace falls far below overall AutoAttack robustness, then the superposition concern is confirmed. The method would then need a small residual-perturbation component, and we would report the trade-off honestly.