A standard way to make an image classifier resist adversarial examples (inputs changed by small, carefully chosen perturbations that flip its prediction) is adversarial training: during training, attack the model and train it on the attacked inputs. This has two costs. It is expensive, because every training step runs a multi-step attack. It also lowers accuracy on ordinary, unattacked images. A different defense keeps a pool of several models and, at test time, answers each query with one model picked at random. This is called a randomized ensemble. Answering with a single model costs no more at inference than one network. Game theory also says it can do better than any fixed model, because no single deterministic classifier can be optimal against an adversary who adapts to it (Pinot et al.). The problem is building the pool. Every method that survives strong attacks trains M separate networks adversarially, one after another, so training cost grows with M.
We propose a single adversarial training run that produces a pool of M lightweight adapters on one frozen pretrained Vision Transformer. Adapters here are small low-rank weight corrections inserted into the network. Training cost stays near that of one adversarially trained model because each step computes one attack, crafted against one randomly chosen adapter. The other adapters are then trained to classify that attack correctly. This directly trains the property randomization needs, which prior work calls "differential immunity": an input that fools one member should not fool the others. At deployment, the probabilities for picking each adapter are set by a small linear program. That program turns the clean-versus-robust trade-off into a dial that can be adjusted without retraining.
Core Claim
The claim is narrow and falsifiable. Take a pool of M adapters trained jointly with a cross-member transfer loss and sampled with optimized probabilities. Under an attack designed specifically for randomized ensembles, this pool will achieve higher robust accuracy than a single adapter with the same total parameter count and the same training compute. Its training cost will be no more than about 1.3 times that of one adapter trained adversarially. The claim is worth testing because the obvious reason it might fail is concrete. Every adapter sits on the same frozen backbone, so the adapters may share failure modes, and switching between members that share failure modes buys nothing (Dbouk & Shanbhag 2023; Sengupta et al.). A clean negative result, showing that a shared backbone caps differential immunity, would also be worth reporting.
Where This Sits
Three lines of work motivate the proposal.
The first is randomized ensembles, which show both the potential and the pitfalls. Pinot et al. proposed Boosted Adversarial Training, which trains a second model on the first model's failures and samples between the two. They reported large gains under an adaptive projected-gradient attack. Dbouk & Shanbhag (2022) then showed that this attack is mis-specified: it attacks an averaged model that does not actually exist in the pool. They introduced ARC (Attacking Randomized ensembles of Classifiers), which linearizes each member's decision boundary. Under ARC, the boosted ensemble fell from 61.1% to 40.7% robust accuracy on CIFAR-10 with ResNet-20, below a single adversarially trained model at 45.7%. This result constrains our design. Every claim here is evaluated with ARC, and the single-model baseline is the bar to clear.
Dbouk & Shanbhag (2023) answered with BARRE, a boosting algorithm that trains full networks sequentially against ARC. They proved that the ensemble's adversarial risk is a piecewise-linear convex function of the sampling probabilities. BARRE is the closest existing method. We reuse its convexity result for choosing the sampling probabilities, but we replace its M sequential full trainings with one joint run over adapters. AdvMS (Wang et al. 2020) switched randomly among M independently initialized networks trained with a reduced attack budget, and kept clean accuracy loss under 3%. It paid M full trainings and was never tested with ARC. Mahmood et al. showed that switching between a ViT and a CNN defeats black-box attacks but collapses near 0% under white-box attacks. We take from this that architectural diversity without robust training is not enough.
The second line, on the cost of adversarial training, supplies the parameterization. FullLoRA-AT adversarially fine-tunes a frozen ViT through low-rank adapters that include their own LayerNorm, called LNLoRA. It gets within 1–2% of full fine-tuning's robustness using about 5% of the parameters and 75% of the time, and it improves CIFAR-10 clean accuracy by 4.29%. It deploys one fixed adapter. Robustness Tokens similarly train a single set of learned input tokens on a frozen ViT. The authors note that the tokens act like a private key: if they are recovered, the backbone is exposed. A pool of adapters sampled at random is a natural way to remove that single point of failure.
It is important to be precise about where the savings come from. The inner attack still backpropagates through the whole backbone, so adapters reduce memory and optimizer state but not the cost of computing the attack. Our training-cost savings come from reusing one attack across all members, not from the adapters themselves.
The third line concerns the clean-accuracy trade-off and weight trajectories. Conflict-Aware AT traces the clean-accuracy loss to conflicting clean and adversarial gradients within one model. It resolves the conflict with gradient projection. SEAT averages weights along the training trajectory into a single model at almost no extra cost, reaching 51.3% AutoAttack accuracy with ResNet-18. Both produce a single deterministic model. Our proposal instead spreads the trade-off across members and settles it at deployment. OSRM and R-LoRA decorrelate multiple low-rank adapters for benign multi-task language work. We borrow R-LoRA's symmetry-breaking random initialization as an optional ingredient, but diversity here is defined by adversarial transfer, not by weight similarity.
Research Program
The training procedure keeps M LNLoRA adapters on a frozen ImageNet-pretrained ViT-B. At each step, it samples one member $j$ and runs a standard 10-step projected gradient attack against $j$ alone. The attacked batch is then used for every member: $j$ takes its usual adversarial loss, and every other member $k$ takes a cross-transfer loss on the same inputs, which pushes $k$ to be immune to $j$'s attack. To place members at different points on the trade-off, member $i$ is assigned its own attack budget $\epsilon_i$, including some small budgets, following AdvMS.
The attack costs about as much as one adversarial training step. The extra cost is M adapter-network forward and backward passes. With 10 attack steps and $M=4$, that is roughly 14 passes against 11 for a single model, which is where the 1.3× figure in the core claim comes from.
At deployment, let $p$ be the vector of sampling probabilities over members, $a_i$ the clean validation accuracy of member $i$, $R(p)$ the ensemble's ARC adversarial risk, which is convex and piecewise linear in $p$ (Dbouk & Shanbhag 2023), and $\tau$ a clean-accuracy floor chosen by the operator. We solve
$$\min_{p \in \Delta_M} R(p) \quad \text{subject to} \quad \sum_i p_i a_i \ge \tau,$$
where $\Delta_M$ is the set of probability vectors. We estimate $R$ empirically on a held-out attacked set, which makes the problem a linear program.
Sweeping $\tau$ traces a clean-versus-robust curve from one trained pool. The scientific question is whether this curve lies above the straight line between members. Clean accuracy is linear in $p$, so any gain over linear interpolation has to come from differential immunity, and none can come from mixing alone.
The analysis component tests the shared-backbone hypothesis directly. We measure pairwise transfer rates between members, meaning the fraction of attacks crafted on member $j$ that also fool member $k$. We compare these rates by where the adapters are allowed to differ: all layers; only the patch embedding and LayerNorms, where FullLoRA-AT located the largest shift between clean and robust models; or only the classification head. We also run a feature-space attack that perturbs the input to distort the frozen backbone's intermediate features, which every member shares. If that attack fools every member at once, randomization cannot help, and the analysis will show at which depth the shared vulnerability lives.
Baselines
The do-nothing reference is the frozen, clean-fine-tuned ViT with no defense. It sets the ceiling for clean accuracy and the floor for robustness.
The first real baseline is a single FullLoRA-AT adapter trained with the same data, schedule, and attack. We run it at the same total adapter rank as the whole pool (rank $M \cdot r$), so the two match in parameters, and we give it 1.3× the training steps so the two match in compute. This is the strongest competitor on our specific question, because it tests whether splitting a parameter budget into randomized pieces beats spending it on one model. The file reports no absolute FullLoRA-AT robust accuracy, only the relative figures cited above, so we reproduce it ourselves. Beating it means higher ARC robust accuracy at an equal or higher clean-accuracy floor, averaged over three seeds, with non-overlapping standard errors.
The strongest existing randomized method is BARRE. On CIFAR-10 with ResNet-20, it reports 47.35% robust accuracy, against 41.99% for standard adversarial training (Dbouk & Shanbhag 2023). Our pretrained-ViT setting differs from theirs, so we also run a full-network version of our joint cross-transfer training on ResNet-20 from scratch, with BARRE's pool size and attack budget. This isolates the training procedure from the adapter parameterization. Beating BARRE there means matching 47.35% under ARC with less than half of BARRE's sequential training compute, which we will measure. Simply matching it at much lower cost is also a positive outcome.
The ablations isolate the key ingredient. The first trains the same M adapters in one run without the cross-transfer loss, so each member trains only on its own attacks. The second trains M adapters independently, in the style of AdvMS. The third uses uniform sampling probabilities instead of the linear program. If the cross-transfer loss is what matters, the first ablation should show higher pairwise transfer rates and lower ARC accuracy than the full method.
Why not just…?
Why not just train one bigger adapter? This is the real threat. Without randomization, a rank-$M \cdot r$ adapter has the same capacity and simpler behavior. Theory says a mixture can reach an equilibrium no deterministic model can (Pinot et al.), but the ARC results show that theory does not guarantee practice (Dbouk & Shanbhag 2022). The parameter- and compute-matched baseline settles this question. If the single adapter wins, we report that a shared backbone removes the benefit of randomization in this regime.
Why not just average the adapters' predictions deterministically, or collapse them into one model as SEAT does? A deterministic average costs M adapter passes at inference, or, with SEAT-style weight averaging, it becomes one fixed target that an attacker can best-respond to. Deterministic ensembles can also be less robust than their best member when members share vulnerabilities, and matching a randomized ensemble's robustness took 4× more FLOPs in Dbouk & Shanbhag 2023. We run both an output-averaged pool and an EMA-averaged single adapter trained along the same trajectory, and report both.
Why not just randomize the input with random resizing and padding? Xie et al. restored accuracy against iterative attacks with no retraining. However, they concede that averaging gradients over the random transformations (Expectation Over Transformation) defeats the defense when the attacker runs enough iterations, and the method only won the NIPS 2017 challenge when layered on adversarial training. We include it both alone and stacked on the single adapter, evaluated with Expectation Over Transformation using at least 50 samples.
Proposed Experiments
The main benchmarks are CIFAR-10 and CIFAR-100 at an $\ell_\infty$ budget of 8/255, plus Imagenette and TinyImageNet, where FullLoRA-AT was evaluated. The backbone is ViT-B, with M in {2, 4, 8}.
Every model is evaluated with ARC, with adaptive APGD using gradient expectation, with the backbone feature-space attack, and with AutoAttack against each member individually. Standard AutoAttack evaluation as in RobustBench assumes a deterministic model, so for the pool we report the minimum accuracy across all attacks. We report ARC robust accuracy, clean accuracy, the clean-versus-robust curve obtained by sweeping $\tau$, pairwise transfer rates, and wall-clock training time. Evaluation on the ResNet-20 CIFAR-10 setting allows a direct comparison with BARRE and with the ARC result of 40.7% for Boosted Adversarial Training against 45.7% for a single adversarially trained model.
Three checks decide the outcome. First, under ARC, the pool must beat the parameter- and compute-matched single adapter. Second, the pool's clean-versus-robust curve must lie above the straight line between its members. Third, removing the cross-transfer loss must raise transfer rates and erase the gain. If the pool passes the first check but the feature-space attack fools every member simultaneously, the result will be reported as robustness to attacks aimed at the decision boundary only. The proposed remedy in that case is to confine member diversity to early layers, and the adapter-placement analysis tests exactly that.
References
- Randomization matters How to defend against strong adversarial attacks
- On the Robustness of Randomized Ensembles to Adversarial Perturbations
- MTDeep: Boosting the Security of Deep Neural Nets Against Adversarial Attacks with Moving Target Defense
- Adversarial Vulnerability of Randomized Ensembles
- AdvMS: A Multi-Source Multi-Cost Defense Against Adversarial Attacks
- On the Robustness of Vision Transformers to Adversarial Examples
- FullLoRA-AT: Efficiently Boosting the Robustness of Pretrained Vision Transformers
- Robustness Tokens: Towards Adversarial Robustness of Transformers
- Conflict-Aware Adversarial Training
- Self-ensemble Adversarial Training for Improved Robustness
- Unraveling LoRA Interference: Orthogonal Subspaces for Robust Model Merging
- R-LoRA: Randomized Multi-Head LoRA for Efficient Multi-task Learning
- Mitigating Adversarial Effects Through Randomization
- RobustBench: a standardized adversarial robustness benchmark