Abstract: Machine learning models are routinely deployed on a wide range of computing hardware. Although such hardware is typically expected to produce identical results, differences in its design can lead to small numerical variations during inference. In this work, we show that these variations can be exploited to create backdoors in machine learning models. The core idea is to shape the model's decision function such that it yields different predictions for the same input when executed on different hardware. This effect is achieved by locally moving the decision boundary close to a target input and then refining numerical deviations to flip the prediction on selected hardware. We empirically demonstrate that these hardware-triggered backdoors can be created reliably across common GPU accelerators. Our findings reveal a novel attack vector affecting the use of third-party models, and we investigate different defenses to counter this threat.
Introduction: The Hidden Variability of Hardware
In deep learning, models are generally assumed to be deterministic: the same input should yield the same output. However, this assumption fails at the level of physical hardware due to the non-associativity of floating-point addition. Because $(a + b) + c$ does not always equal $a + (b + c)$ in computer arithmetic, different GPU architectures (e.g., Nvidia A100 vs. H100) can produce slightly different numerical results for identical calculations.
This research explores whether an adversary can weaponize these "harmless" numerical discrepancies. The authors demonstrate a "hardware-triggered" backdoor: a model that behaves correctly during validation on a developer's machine but triggers a malicious misclassification only when deployed on specific target production hardware.
Methodology: Engineering the Split
The attack employs a two-step optimization strategy to "split" the model’s behavior across different hardware environments without altering the input data.
- Shaping the Decision Boundary: Using gradient-based optimization, the attacker moves the model's decision boundary extremely close to a specific target input $\hat{x}$. This places the model in a state where it is "on the fence" for that specific image.
- Refining Deviations: Since hardware differences are non-differentiable, the authors use heuristic strategies to amplify the split. This includes Topological Permutation (swapping the order of operations in linear layers to change the order of additions) and Parameter Perturbation (selectively flipping a few bits in weights to nudge numerical behavior).
The attack uses an alternating optimization loop, ensuring the model maintains high accuracy on clean data (losing no more than 5%) to remain stealthy.
Key Insights and Empirical Results
The study evaluated the attack on ImageNet using ResNet-18, EfficientNetV2-S, and Vision Transformers (ViT) across five generations of Nvidia GPUs.
- The Latent Trigger: Unlike traditional backdoors requiring a visible "patch," the trigger here is the silicon itself. This makes the attack invisible to standard input-sanitization defenses.
- High Success and Stealth: The attack achieved over 94% success across hardware pairs while maintaining a median of 99.8% of original performance on clean data.
- Precision and Virtualization: Counter-intuitively, the attack is effective even in
float32precision. Furthermore, even running on the same physical chip using "Multi-Instance GPU" (MIG) virtualization can be enough to trigger the backdoor in some models.
Defenses and Limitations
While the attack is potent, it is also fragile. Because it relies on being "on the edge" of a decision boundary, it can be sensitive to significant input perturbations or large changes in inference settings.
The most effective defense identified is fine-tuning. Even a single step of training on clean data typically "erases" the fragile decision boundary the attacker created. Future work suggests developing specialized forensic tools to detect when a model's decision boundary has been artificially moved too close to the data manifold, a hallmark of this hardware-specific manipulation.
Summary updated