Making a pretrained image model robust to adversarial examples usually has three costs. Adversarial examples are small, deliberately crafted input changes that flip a prediction. The first cost is that retraining against them is expensive, because every weight update requires several extra forward and backward passes to build the attack. The second is that clean accuracy drops. The third is that cheap defenses often look robust only until an attacker who knows how the defense works optimizes against it directly. This proposal targets all three with one construction. We attach small low-rank adapters to a frozen, clean-trained vision transformer and train them adversarially. Each adapter is constrained to read only from activation directions that clean data never occupies. For clean inputs, the adapted network then computes the same function as the original model, so clean accuracy is preserved by construction rather than by tuning. The adapters respond only to the off-distribution components that adversarial perturbations inject.
The construction also creates an obvious weak point. An attacker who confines the perturbation to the clean activation subspace sees no defense at all. The central scientific question is therefore how much attack power survives inside that subspace. We treat this as the main experiment, not a footnote. The subspace dimension and the adapter rank form an explicit dial on the model's degrees of freedom. This gives a controlled test of the older claim that fewer degrees of freedom mean less exploitable fragility, measured under attacks designed against the dial itself.
Core Claim
Let $h$ be the input activation to a frozen linear layer $W_0$. Let $U_c$ be an orthonormal basis for the subspace holding a fraction $\tau$ of the energy of clean activations at that layer, estimated from a sample of clean training images. Define the adapter as
$$\Delta W = B A (I - U_c U_c^\top),$$
where $A$ and $B$ are trainable low-rank matrices of rank $r$. For any clean activation that lies in the span of $U_c$, $\Delta W h = 0$. If this holds at every adapted layer, induction over depth shows that the clean forward pass matches the original model up to the residual energy $1-\tau$.
We train $A$ and $B$ with the usual min-max adversarial objective. The claim is that this gives a better clean-versus-robust accuracy trade-off than unconstrained low-rank adversarial fine-tuning at the same rank and the same compute. We further claim the advantage holds under an adaptive attack that explicitly tries to hide the perturbation inside the clean subspace. If that attack drives robust accuracy back toward the undefended level, the idea fails, and we will report that clearly.
Relation to Prior Work
The projection comes from two papers on catastrophic forgetting. LoRA-Null initializes adapters orthogonal to the low-effective-rank subspace of clean input activations so that task tuning does not erase pretrained knowledge. Null-LoRA projects updates onto the null space of the pretrained weights. Neither paper studies attacks. We reuse the activation-subspace idea but apply it to a different job: separating the robustness update from the clean function.
Three existing low-cost defenses motivate the gap. Robustness Tokens trains ten prefix tokens on a frozen vision transformer and keeps clean accuracy nearly intact, but its security rests on the tokens staying secret. FullLoRA-AT adds layer-normalization-plus-LoRA modules and reaches within 1–2% of full adversarial fine-tuning. It is evaluated with AutoAttack, but not with attacks built around its own module structure. AdvLoRA reports that adversarial adaptation has a low-rank structure, but it has no adaptive-attack evaluation. None of the three gives clean-accuracy preservation as a structural guarantee, and none asks whether the adapter's small subspace is itself an attack surface.
The evaluation stance comes from two papers that constrain what can be claimed. AutoAttack showed robust accuracy dropping for 13 of roughly 50 published defenses by more than 10 points. Adaptive Auto Attack lowers those bounds further at about 10x lower cost. Because our construction makes the attacker's escape route explicit, standard suites are necessary but not sufficient.
The degrees-of-freedom question has a long history in shallow models. Biggio et al. on SVMs and the pattern-classifier security evaluation link flexible decision boundaries to fragility. Lin et al. warn that the relationship is not monotonic. We test that relationship with rank $r$ and subspace fraction $\tau$ as the controlled variables.
Research Program
We start from pretrained vision transformers: DINOv2 with a linear classification head, and a DeiT-III or OpenCLIP backbone, following the Robustness Tokens setup. Each backbone is first fine-tuned normally on the target dataset, and that model is frozen.
For each adapted layer we record clean activations on a few thousand training images, compute $U_c$ by singular value decomposition at several energy thresholds $\tau$, and insert the projected adapters. They go into the attention and MLP projections, and optionally the classification head, which is also a linear layer on clean features.
Training uses projected gradient descent (PGD) inside the min-max loop. The step budget is matched across all methods, and we test both a cheap 2-step setting and a 10-step setting, so that the overhead story is measured rather than assumed.
The first piece of analysis is geometric. We measure the effective rank of clean activations per layer, to check whether the premise from LoRA-Null holds in deep vision layers. We also measure what fraction of standard adversarial perturbations' activation change falls outside $U_c$. The second piece maps the full Pareto front of clean versus robust accuracy across the grid of $r$ and $\tau$, both for our method and for unconstrained LoRA adversarial training. This isolates what the projection contributes beyond simply having fewer degrees of freedom.
The third piece is the attack we will build against our own defense, the subspace-confined attack. It is PGD that maximizes classification loss while penalizing the norm of the adapters' outputs, $\sum_\ell \|\Delta W_\ell h_\ell(x+\delta)\|^2$, with a swept penalty weight. We add a version that projects each gradient step so the induced first-layer activation change stays in $U_c$. Both versions are also run with the Adaptive Auto Attack initialization. The attack-failure debugging suite IndicatorsOfAttackFailure will be used to confirm that no attack is silently failing because of gradient masking.
Baselines
The naive reference points are two models. The first is the frozen clean model with no defense, which fixes the upper bound on clean accuracy and the floor on robust accuracy. The second is full-parameter adversarial fine-tuning of the same backbone, which fixes the robustness ceiling and the compute cost that parameter-efficient methods claim to avoid.
The main competitor on the adapter axis is vanilla LoRA with an adversarial loss, sweeping the same ranks, trained with the same data, the same PGD step count, the same number of optimizer steps, and the same hyperparameter-search budget measured in trials. This baseline is decisive for the key ingredient. We run it at the same rank as our method, with and without the projection. We also run an ablation that replaces $I - U_cU_c^\top$ with a projection onto a random subspace of the same dimension, which separates the effect of avoiding clean directions from the effect of merely shrinking the adapter's input space.
FullLoRA-AT is the strongest published adapter-based adversarial fine-tuning method in the file. We reimplement it at matched GPU-hours. It reports a 4.29% clean-accuracy gain on CIFAR-10 and robustness within 1–2% of full fine-tuning, but no absolute CIFAR-10 robust number is available in the file. Our comparison will therefore be against our own run.
Robustness Tokens is the strongest reported result on ImageNet. On DINOv2-G it reports 85.2% clean accuracy versus 85.6% undefended, and white-box robust accuracy recovering from 0.3% to 63.1%. We will run it on the same backbone and evaluate it under two threat models: the secret-token setting it assumes, and a setting where the attacker knows the tokens.
We count the proposal as beating these baselines only if two conditions hold together. At matched compute, its clean accuracy must stay within 0.5 points of the frozen clean model. Its AutoAttack robust accuracy, under the attacker-knows-everything threat model, must match or exceed the best competitor at equal clean accuracy on the Pareto front.
Why not just…?
Why not just use vanilla LoRA adversarial training at a small rank, since fewer degrees of freedom already limit clean-accuracy drift? This is the most serious threat, because it tests pure variance control without the projection. FullLoRA-AT and AdvLoRA both report that plain LoRA underperforms their modified versions, with AdvLoRA reporting a 12.17% gap on MSCOCO retrieval. That evidence concerns robustness, however, not clean-accuracy preservation. The matched-rank Pareto comparison and the random-subspace ablation settle the question directly. If low-rank LoRA reaches the same front, the projection adds nothing, and we will say so.
Why not just use Robustness Tokens, which already keeps clean accuracy within 0.4 points on ImageNet? Its 63.1% robust figure assumes the tokens are secret. Our defense has no secret: the clean subspace can be estimated by anyone holding clean data. Running Robustness Tokens under a known-token attack in our harness shows what that secrecy is actually worth.
Why not just reweight the clean and adversarial loss terms, as helper-based adversarial training (HAT) does to reduce excess margin? Loss reweighting moves a model along the existing trade-off curve. Our claim is that the projection moves the curve itself. We will apply the HAT loss to the unconstrained LoRA baseline, so that loss weighting and projection are compared on equal terms and can also be combined.
Why not just use a parameter-free representation fix such as PURE? PURE removes the top principal component per instance and costs only about 1.2x training time. It has not been tested against attackers who differentiate through the removal step, and it was built for text models. We include a vision analogue, dominant-component removal on the clean features, and attack it with full gradients through that removal step.
Proposed Experiments
We run CIFAR-10 and CIFAR-100 at an ℓ∞ budget of 8/255 and ImageNet-1k at 4/255. Standard evaluation uses AutoAttack through RobustBench, Adaptive Auto Attack, and Square Attack as a gradient-free check. ADE20K segmentation mIoU under attack serves as a transfer test, since Robustness Tokens reports a rise from 4.7 to 23.3 there. We report wall-clock training time and parameter count alongside every accuracy number.
Three results would decide the proposal. First, clean-subspace effective rank must be low enough in deep vision layers to leave the adapters room to act. If it is not, the premise fails before training begins. Second, on the matched-compute Pareto front, the projected adapter must dominate both same-rank vanilla LoRA and the random-subspace ablation. Third, under the subspace-confined adaptive attack, robust accuracy must stay well above the undefended level across the full sweep of penalty weights.
The third check doubles as the variance study. Plotting worst-case robust accuracy against $r$ and $\tau$ shows directly whether shrinking the adapter's degrees of freedom hardens the model, or instead hands the attacker a smaller, easier-to-avoid defense.
References
- LoRA-Null: Low-Rank Adaptation via Null Space for Large Language Models
- Null-LoRA: Low-Rank Adaptation on Null Space
- Robustness Tokens: Towards Adversarial Robustness of Transformers
- FullLoRA-AT: Efficiently Boosting the Robustness of Pretrained Vision Transformers
- AdvLoRA: Adversarial Low-Rank Adaptation of Vision-Language Models
- Reliable evaluation of adversarial robustness with an ensemble of diverse parameter-free attacks
- Practical Evaluation of Adversarial Robustness via Adaptive Auto Attack
- Support vector machines under adversarial label contamination
- Security Evaluation of Pattern Classifiers under Attack
- Query-Efficient Adversarial Attack Based On Latin Hypercube Sampling
- Adversarial Defense without Adversarial Defense : Enhancing Language Model Robustness via Instance-level Principal Component Removal