Worst-Case Compute as a Third Axis for Backdoor Defenses

A backdoored model behaves normally on ordinary inputs but gives an attacker-chosen answer whenever a hidden trigger appears, such as a small patch or an invisible warp. Defenses against these hidden triggers are judged today on two numbers: how much accuracy on ordinary inputs they sacrifice, and how often the trigger still works afterward. The standard testbeds, BackdoorBench and RobustBench, record neither the compute a defense costs nor the latency it adds. That omission matters most for the defenses that run while the model is serving queries. Their cost depends on the data they see, so the attacker who planted the backdoor also partly controls the defender's bill.

We propose to treat compute as a third axis of the backdoor trade-off and to measure it in the worst case under an attacker, not only on average. The concrete claim is that test-time defenses whose work depends on the input can be pushed to their most expensive path by suitably chosen inputs. This could be done, for example, by making a detector's scores ambiguous so its early stopping never fires. A defender who responds by capping compute then faces a new, measurable trade-off. If the defense "fails open" when the cap is hit, the backdoor comes back. If it "fails closed" and rejects the input, clean users lose service. The deliverable is a compute-aware, adversarially stressed extension of BackdoorBench, together with the first measurements of how badly average-case cost figures understate what defenses really cost.

Core Claim

Two things would be new: the attack surface, and the evaluation that follows from it. CP-FREEZER is the direct motivation. It showed that adversarial features can inflate the number of candidate boxes in a vehicle perception pipeline. Because the step that removes duplicate boxes has quadratic cost, this raised latency by over 90×. The integrity defense ROBOSAC made things worse, taking latency from 81× to 777×. That work attacks a perception post-processing step with evasion perturbations. It says nothing about backdoor defenses, and it does not propose a benchmark. Our claim is that the same pattern, in which the defense itself becomes the cost bottleneck, applies to backdoor defenses whose work is data-dependent.

The clearest candidate is TTBD. It scores a batch of test inputs by how much their predictions change when parts of the model are tentatively pruned. It then estimates each neuron's contribution to the attack and to clean accuracy using Monte Carlo sampling with early stopping, and prunes the offenders. The TTBD authors acknowledge that this step is expensive, but they report no wall-clock numbers. By contrast, a defense such as STRIP does a fixed amount of work per query: it blends each input with clean images, runs the blends, and checks the entropy of the outputs, for a reported cost of about 1.32× latency. For fixed-cost defenses, average and worst-case cost coincide, and simple timers suffice. We say this openly because it tells us where the contribution lies. The adversarial compute axis only changes conclusions for defenses with adaptive or iterative control flow. The experiments are designed to show whether such defenses are common enough, and exploitable enough, to matter.

To compare defenses that pay once offline with defenses that pay on every query, we charge each defense its amortized cost per query over a deployment of $Q$ queries:

$$C(Q) = \frac{C_{\text{off}}}{Q} + \bar{c}_{\text{on}}, \qquad A = \frac{\max_{x \in \mathcal{X}_{\text{adv}}} c_{\text{on}}(x)}{\bar{c}_{\text{on}}}.$$

Here $C_{\text{off}}$ is one-time purification cost, meaning GPU-seconds and peak memory. The per-query online cost is $c_{\text{on}}(x)$ for an input $x$, and $\bar{c}_{\text{on}}$ is its mean over clean traffic. The set $\mathcal{X}_{\text{adv}}$ contains inputs or batches the attacker may submit. The amplification factor $A$ is the new quantity: how much more a defense costs when the attacker optimizes against its bill rather than against its detector.

Research Program

The work has three parts. First, we instrument the BackdoorBench codebase. It already separates data preparation, attack, defense, and evaluation. We add, on fixed hardware, measurements of wall-clock time, FLOPs, peak GPU memory, and throughput at several batch sizes, for both the offline and online phases of every defense. This part is straightforward engineering, but it has not been done.

Second, we build cost-maximizing adaptive attacks. The adversary is the same party who implanted the backdoor. For batch-based test-time repair such as TTBD, the adversary chooses the composition of the batch and the strength of the trigger. The choices it controls are the poison fraction, partial triggers, and inputs placed near decision boundaries. Its objective is to maximize the number of pruning trials and sampling rounds before early stopping, while keeping the attack success rate as high as possible. For detectors that escalate on suspicion, the adversary maximizes how often inputs fall into the expensive branch. We follow the discipline of On Evaluating Adversarial Robustness: the attack must know the defense's control flow, and we report the attacker's own compute alongside the defender's.

Third, we study capped defenses. Each data-dependent defense is given a hard compute budget. We then trace a curve at each cap: attack success rate if the defense fails open, and clean-query rejection rate if it fails closed, against the cap. The adaptive attacker from part two is active throughout. This curve turns the security-performance trade-off into something the field can report and compare.

The analysis also takes up the architecture tension that BackdoorBench and ANP expose. Compact networks are cheaper to serve and are reported as harder to backdoor, but pruning defenses damage their clean accuracy much more. We ask whether, once compute is priced in, a compact model with a test-time defense beats a residual network with an offline defense at an equal serving budget.

Baselines

The naive reference point is the undefended backdoored model. It costs nothing extra, and its attack success rate is the ceiling. Every defense's compute is reported as a multiple of this model's serving cost.

The strongest competitor on accuracy and attack success is TTBD. The TTBD paper reports that on CIFAR-10 with ResNet18 it reduces average attack success rate from 88.18% to 2.32%, with a clean accuracy drop of about 2.6%. For its latency, no reported result was found on Lacuna. We will run it from the authors' settings inside the instrumented harness, on the same poisoned models, test batches, and hardware as every other defense. The tuning budget will be fixed at the same number of configurations per defense. For the offline side, the strongest competitors are three methods. I-BAU removes the backdoor with a minimax unlearning objective; it reports about 6.8 seconds to neutralize an attack on CIFAR-10 and 13× faster than the most efficient baseline. RNP first unlearns on clean data, then recovers filters and prunes the ones that stay dormant; it reports CIFAR-10 attack success reduced from 96.34% to 5.03% with under a 2% clean drop. ANP finds and prunes neurons that are sensitive to weight perturbations; it reports a 1.47% average clean drop. For input filtering, STRIP, with its reported 1.32× latency, and SampDetox serve as fixed-cost and perturbation-based references. Fine-Pruning, which prunes neurons dormant on clean data and fine-tunes, is the simplest offline baseline.

We do not propose a new defense, so "beating a baseline" means our measurements change a ranking. The benchmark earns its place if two things happen. First, at matched amortized compute, the ordering of defenses by clean accuracy and attack success differs from BackdoorBench's two-axis ordering. Second, the cost-maximizing attack produces an amplification factor $A$ well above 1 on at least one data-dependent defense, whereas random or naive inputs do not. The key ablation isolates the adaptive attacker. We compare worst-case cost under the optimized attack with the worst case over randomly sampled poisoned batches of the same size. If the two are close, the adversarial axis adds nothing beyond careful timing.

Why not just…?

Why not just add timers to BackdoorBench and report average latency? For fixed-cost and offline defenses this is exactly right, and we will do it. For defenses with early stopping or escalation, the average measured on benign or randomly poisoned traffic is the quantity the attacker gets to change. The ablation above tests this directly. If $A$ stays near 1 for TTBD and similar defenses, the reviewer is correct, and the contribution reduces to careful profiling. We would report that outcome.

Why not just use offline defenses like I-BAU or RNP, which add nothing at serving time? This is a real threat to the premise. It may turn out that offline defenses dominate the whole frontier whenever a small clean set is available, and the amortized-cost metric is built so that this can show up. The case for test-time defenses rests on regimes where offline methods are weak. I-BAU's guarantees assume additive triggers, which leaves warping attacks such as WaNet open. Pruning methods lose substantial clean accuracy on compact models. Offline methods also need verified clean data. The experiments locate where each regime wins. They do not assume the answer.

Why not just cap the defense's compute and move on? A cap bounds latency, but it creates a choice between letting the backdoor through and refusing clean users. Nothing in the file measures that choice. The capped-defense curves in part three quantify exactly this. If a modest cap costs almost nothing on either side even under the adaptive attacker, that is a useful negative result, and capping becomes the recommended practice.

Proposed Experiments

The main grid uses CIFAR-10, CIFAR-100, GTSRB, and Tiny ImageNet. Architectures are PreAct-ResNet18, VGG19, MobileNetV3-Large, EfficientNet-B3, and ViT, all as provided in BackdoorBench. Attacks are BadNets, WaNet, and ISSBA sample-specific triggers, at poisoning ratios that include the sub-1% regime, where BackdoorBench reports that detection struggles. Every run reports clean accuracy, attack success rate, robust accuracy, offline GPU-seconds, per-query latency and throughput, peak memory, and $C(Q)$ for $Q$ from $10^3$ to $10^7$.

The first decisive check is whether the three-axis ranking at matched $C(Q)$ differs from the two-axis BackdoorBench ranking on Tiny ImageNet. There, BackdoorBench already finds that recovering the correct label on triggered inputs collapses, so defenses are least likely to be interchangeable.

The second is the amplification test. We run the cost-maximizing batch attack against TTBD and report $A$ alongside the attack success rate the adversary retains. Controls are random poisoned batches, and STRIP as a defense that should show $A \approx 1$.

The third is the capped-defense curve for TTBD on CIFAR-10 and Tiny ImageNet, reported in both fail-open and fail-closed modes under the adaptive attacker.

The fourth is the architecture comparison at equal serving budget: compact model with a test-time defense against residual model with an offline defense. This asks whether pricing compute resolves the tension between vulnerability to backdoors and fragility under pruning, or makes it worse.