One Backward Pass to Find the Poison: First-Order Boundary Distance as a Cheap Stand-in for Iterative Backdoor Profiling

A backdoor attack plants a few training images that carry a secret pattern, the "trigger", and labels them with a class the attacker chooses. The trained model behaves normally on clean images and obeys the trigger whenever it appears. Two recent defenses found a reliable signature of these planted images: they sit unusually deep inside the target class. An adversarial attack, which searches for a small input change that flips the prediction, has to push them much further before the label changes. When it finally succeeds, the model usually reverts to the image's true class. Adversarial-Inspired Backdoor Defense via Bridging Backdoor and Adversarial Attacks (AIBD) uses this signature to filter and relabel poisons and cuts average attack success on CIFAR-10 from 99.73% to 0.33%. The signal it uses is the number of projected gradient descent (PGD) steps each training sample needs before its label flips. BURN uses iterative minimum-distance attacks for the same purpose. The drawback is cost. Both run a multi-step attack on every training sample, often over several rounds, so the defense costs many training epochs on top of training itself. This is the same robustness overhead that made multi-step adversarial training 80 hours on CIFAR-10 against 6 minutes for single-step training in Fast is better than free.

This note proposes replacing the iterative profile with a single-step estimate of how far each sample is from the decision boundary. The estimate is the classifier's logit margin (how much the top score exceeds the runner-up) divided by the size of that margin's input gradient. It is a linearized, one-step distance that costs one forward and one backward pass per sample, about one ordinary training epoch. A second cheap check runs on the same small step: does the prediction revert to a plausible true class? Only samples where these one-step answers are unreliable get escalated to the expensive multi-step attack. The claim is that this cascade matches AIBD's poison detection and relabeling at a small fraction of its attack compute. The note also predicts in advance, and tests, where the single-step estimate breaks: wherever the loss surface near poisoned points is strongly curved. That is exactly the failure mode that catastrophic overfitting studies in single-step adversarial training identify.

Core Claim

For a model $f$ trained on poisoned data, write $z_c(x)$ for the logit of class $c$ on input $x$. Let $y$ be the sample's assigned label and $j^\ast$ its highest-scoring other class. The first-order boundary distance is

$$\hat d(x) = \frac{z_y(x) - z_{j^\ast}(x)}{\lVert \nabla_x \big(z_y(x) - z_{j^\ast}(x)\big) \rVert_1},$$

which is the distance to the boundary under an $L_\infty$ budget if the margin were linear in $x$. The $L_1$ norm in the denominator is the dual of $L_\infty$. Poisoned samples should have large $\hat d$ for two reasons. Their margins are huge, which matches the finding in Can We Mitigate Backdoor Attack Using Adversarial Detection Methods? that backdoor examples are more stable under gradient noise and model mutation than clean ones. Their margin gradients are also small, because the trigger dominates the prediction.

Two design choices matter. The first is using the margin rather than cross-entropy loss. Cross-entropy saturates on very confident samples, so its gradient vanishes exactly on the poisons and would look like gradient masking. The second is dividing by the gradient norm rather than thresholding confidence alone.

We claim three things. Ranking samples by $\hat d$ recovers AIBD's iteration-count ranking well enough to reach the same detection quality. A single linearized step of length about $\hat d$ along the margin-gradient direction reproduces the "trigger stripping" relabel that AIBD and BURN rely on. Finally, a cheap curvature flag can route the cases where linearization fails to multi-step PGD. The flag is the cosine between the input gradient at $x$ and at a random point within the budget, as in GradAlign from Understanding and Improving Fast Adversarial Training, but used here only as a diagnostic, not as a training regularizer.

Relation to Prior Work

The motivation comes from the boundary-geometry defenses. AIBD filters by PGD iteration count $k_i$ and relabels by the adversarial prediction. BURN finds that poisons need larger $L_2$ perturbations to cross the boundary and that crossing strips the trigger. Adversarial Fine-tuning for Backdoor Defense shows that adversarial examples on a backdoored model land in the target class and activate the same penultimate-layer features as triggered inputs: an $l_2$ distance of 22.74 to triggered features versus 148.26 to clean ones. All three treat the iterative attack as the measuring instrument. We keep their signal and question only the instrument.

A second group of defenses unlearns adversarial examples on a small clean set rather than filtering the training data: Shared Adversarial Unlearning (SAU, 2.51% average ASR) and PBE. We do not make those single-step. This keeps our setting the harder one with no clean data, where BURN and AIBD operate, and avoids the open question of whether single-step unlearning simply masks the shortcut.

The single-step literature supplies the method and also constrains it. Random initialization from Fast is better than free and gradient alignment from Understanding and Improving Fast Adversarial Training are the tools we reuse. That second paper's finding that one-step methods collapse once the loss stops being locally linear, and Kim et al.'s account of distorted decision boundaries, tell us where $\hat d$ should fail. Those cases are what the escalation rule is for.

The nearest efficiency-motivated work is Composite Adversarial Training, which trains through backdoors with multi-step $L_\infty$ plus spatial attacks and loses clean accuracy. We neither adversarially train nor perturb spatially. We spend one profiling epoch and then train normally.

Research Program

We first establish the measurement relationship. On BackdoorBench-trained models (BackdoorBench) we compute both $\hat d$ and AIBD's $k_i$ for every training sample. We then report three quantities: their Spearman correlation, the poison-detection AUROC of each, and the relabel accuracy, meaning the fraction of detected poisons whose one-step or PGD-reverted prediction equals the true class.

Second, we build the cascade. It ranks samples by $\hat d$ and computes the gradient-alignment flag for the top fraction. It accepts confident linear cases with their one-step relabel, and sends low-alignment or non-reverting cases to full AIBD-style PGD. The remaining training pipeline is unchanged: AIBD's progressive top-q filtering, relabeling, and retraining.

Third, we explain the failures. For attacks where $\hat d$ underperforms, we test whether the gradient-alignment flag predicts the error. We also check, following Catastrophic Overfitting: A Potential Blessing in Disguise, whether a few hijacked channels carry the poisoned samples' gradients. If they do, the escalation rule has a mechanistic justification rather than a tuned threshold.

Baselines

The naive reference is the undefended model trained on poisoned data. AIBD reports 99.73% average ASR for it on CIFAR-10 and 99.62% on GTSRB. Next to it, as a do-nothing defense, we report the clean accuracy and ASR of a random relabeling of the same number of samples. AIBD reports itself +1.75% clean accuracy over random label correction, which gives a floor for the relabeling step.

The strongest competitor is AIBD itself, because it is the clean-data-free defense this proposal accelerates. It reports 0.33% average ASR on CIFAR-10 and 0.08% on GTSRB. We will rerun it from its procedure on identical poisoned datasets, architectures, and training schedules. Its PGD step count and top-q schedule will be tuned with the same search budget we give our thresholds. Beating it means three things together. First, ASR within 0.5 percentage points of AIBD's rerun. Second, clean accuracy no lower. Third, at least a fivefold reduction in defense-stage attack forward and backward passes and in wall-clock time on the same GPU. The file reports no wall-clock or compute figure for AIBD (no reported result found on Lacuna for AIBD's runtime), so we measure it ourselves.

BURN is a second clean-data-free baseline run under the same protocol. The file reports a CIFAR-100 observation, that correcting 30 identified instances made backdoor potency decay exponentially, but no CIFAR-10 ASR figure.

SAU is a reference that has access to clean data, reported at its 2.51% average ASR across seven attacks with a 5% clean set. It shows the ceiling achievable when trusted data exists.

Three ablations isolate the key ingredients. Margin-only ranking drops the gradient-norm denominator. Cross-entropy-gradient ranking tests the saturation argument. Removing escalation shows the pure single-step method. Compute-matched truncated AIBD, with one or two PGD steps, is treated as a baseline in its own right; see below.

Why not just…?

Why not just threshold confidence or margin? Confidence is the numerator of $\hat d$, so it is a serious competitor, not a straw man. Not All Poisons are Created Equal found that loss and confidence filters discard more clean data than poison. Many clean, easy images are also extremely confident, and BURN and the adversarial-detection study report poisons as highly confident but not uniquely so. The margin-only ablation settles this directly. If it matches $\hat d$'s AUROC across attacks, the gradient term is not contributing and we will report the simpler method as the result.

Why not just run AIBD with one or two PGD steps? This is the strongest threat. A truncated iteration count is cheap and stays inside AIBD's own logic. Its weakness is resolution. With a fixed step size, almost every sample needs more than one step, so a one-step count cannot separate deep clean samples from poisons, whereas $\hat d$ is a continuous distance. We compare at matched passes per sample. If truncated AIBD matches the cascade, the contribution narrows to the finding that cheap AIBD suffices, which is still worth reporting.

Why not just run FGSM-RS adversarial training on the poisoned data? Standard $L_\infty$ training at the usual budget defends weakly against patch triggers, according to On the Effectiveness of Adversarial Training against Backdoor Attacks. FGSM-RS also collapses at larger budgets (Understanding and Improving Fast Adversarial Training), and it costs clean accuracy. We include FGSM-RS training at 8/255 as a baseline at comparable compute.

Why not just fine-prune? Fine-Pruning needs clean data and left about 30% ASR on U.S. traffic signs. It also fails against pruning-aware attackers. It is reported for context only.

Proposed Experiments

The data are CIFAR-10, GTSRB, CIFAR-100, and Tiny ImageNet. The architectures are PreAct-ResNet18 and VGG-19 from BackdoorBench. The attacks are BadNets, Blended, SIG, SSBA, WaNet, and the clean-label LC attack. Poison ratios run from 0.5% to 10%. The metrics are clean accuracy, ASR, the robust accuracy defined in BackdoorBench, detection AUROC, relabel accuracy, and total defense compute.

Three checks are decisive. The first is the Spearman correlation between $\hat d$ and $k_i$ on CIFAR-10 BadNets and Blended. Below 0.5 would falsify the core premise. The second is WaNet and SSBA. These are the triggers where bounded searches struggle (Shared Adversarial Unlearning), and they are where we predict curvature-flagged escalation is required. If the alignment flag does not predict $\hat d$'s errors there, the cascade loses its rationale. The third is an adaptive attacker who lowers poison confidence through clean-label poisoning and low poison ratios. The test is whether $\hat d$ keeps its advantage over margin-only ranking when the confidence signal is weakened.