TL;DR
In the world of floating-point math, $(x + y) + z$ does not always equal $x + (y + z)$, meaning an identical LLM will produce microscopic numerical differences depending on whether it runs on an NVIDIA GPU, a Google TPU, or an AWS CPU. FloatDoor weaponizes this tiny hardware quirk to create the first input-independent, platform-triggered backdoor for generative LLMs. A compromised model will pass every safety audit with flying colors on an evaluator's server, only to wake up and start writing vulnerable code the moment it is deployed onto a victim's specific hardware.
What Problem Does This Paper Address?
When we audit open-weight LLMs downloaded from hubs like Hugging Face, we implicitly assume that safety evaluations transfer across hardware: if a model behaves well on our testing rig, it should behave well in production.
Meanwhile, systems engineers have long known that different hardware architectures and software kernels execute low-precision math in slightly different orders, creating tiny numerical divergences across platforms. Until now, the AI community viewed this variability mostly as an annoying reproducibility bug, or at worst, a way to flip a single label on simple image classifiers. Furthermore, existing LLM backdoors usually require either a secret "trigger phrase" in the user's prompt or a post-deployment user action (like quantizing or fine-tuning the model) to activate.
The authors ask a unsettling question: Can an attacker cultivate tiny, hardware-induced rounding errors inside a generative LLM so that the deployment platform itself becomes the backdoor trigger—requiring zero special inputs and zero user intervention?
Methods
FloatDoor achieves this without altering the model's architecture by training two lightweight, sequential LoRA adapters that eventually get merged directly into the base model's weights.
- Freezing the Fingerprint: Updating a model's weights changes its math, which would erase the very hardware signature the attacker wants to read. To prevent this, the authors freeze the first several layers of the base model (e.g., up to layer 8). They run prompts through these frozen layers on both the target platform and benign platforms, caching the subtle Cross-Platform Residual-Stream Discrepancy (CPRSD)—the microscopic difference in internal activations.
- The Trigger Adapter ($\psi^{(1)}$): Acting on the middle layers, this novel adapter is trained alongside a linear probe using a margin-based loss. Its job is to catch that tiny CPRSD specifically at the "assistant" role-transition token and amplify it into a loud, linearly separable "platform identity" signal, while using KL distillation and norm penalties so the model doesn't lose its mind on normal tasks.
- The Task Adapter ($\psi^{(2)}$): Placed on the upper layers, this standard conditional-generation adapter reads the amplified platform signal and routes the model's output. Because the input prompt is bit-for-bit identical across machines, the adapter is forced to rely entirely on the amplified hardware signature to decide whether to behave normally or maliciously.
Datasets
No new benchmarks were introduced; the authors combined existing datasets to train and test their adapters:
- Trigger & Fingerprinting Training: A diverse general prompt corpus (detailed in the paper's appendix as
TRAIN). - Code Vulnerability Training: The paired safe/vulnerable code dataset from Hubinger et al. (stripped of its original chain-of-thought and system-prompt triggers).
- Vulnerability Evaluation: Python coding scenarios from Pearce et al., graded automatically for security flaws using CodeQL.
- Utility Benchmarks: Standard MMLU, HellaSwag, and HumanEval benchmarks to verify the model remains smart on benign tasks.
Key Insights and Ideas
- Exploiting the "Time-of-Check to Time-of-Use" Gap: If an organization audits a model on NVIDIA H200s, sees clean code, and deploys it to production on NVIDIA A100s, FloatDoor slips right past dynamic testing. Static weight inspection fails too, since the LoRA adapters are merged seamlessly into a single checkpoint.
- One-Machine Training Trick: You might think training a hardware-triggered backdoor requires wiring up a monstrous, multi-vendor cluster for distributed backpropagation. Instead, by freezing the early layers, an attacker only needs brief inference access to the target hardware once to cache activations; all gradient-based adapter training happens deterministically on a single local machine.
- Even Same-Generation GPUs Are Distinguishable: FloatDoor doesn't just separate GPUs from CPUs—it reliably distinguishes between same-generation NVIDIA H200 and H100 GPUs.
Key Results
Evaluated on Qwen3-4B and Qwen3-8B across NVIDIA GPUs (H200, H100, A100, DGX Spark), Google TPUs, AWS Graviton, and Alibaba Yitian-710 CPUs:
- Covert Fingerprinting: When trained to secretly prepend an invisible, zero-width Unicode character identifying the host hardware, FloatDoor achieved 92% to 99% accuracy across five hardware scenarios (hitting 92% on the tightest H200 vs. H100 split), while general benchmark utility dipped by less than 1.5 percentage points.
- Platform-Keyed Vulnerable Code: On Qwen3-8B, an identical coding prompt caused the model to generate exploitable code 58.8% of the time on the target platform (NVIDIA A100), compared to just 9.8% on the auditor platform (NVIDIA H200)—roughly a 6x increase in vulnerability generation, with a modest 3.74 percentage point drop in general utility.
- Fragile Under Mitigation: Forcing
float32inference precision (approximatingLayerCast) or applying just 10% weight pruning (magnitude or Wanda) completely broke the routing channel, dropping marker accuracy from 100% to under 1% with less than a 1 percentage point hit to utility (thoughfloat32incurs heavy runtime overhead).
Limitations and Future Work
- Exact Stack Knowledge Required: A "platform" isn't just silicon; it includes the software stack (like vLLM vs. HuggingFace Transformers, compiler flags, and batch sizes). Unexpected changes to the victim's serving configuration alter the floating-point math and can cause the attack to misfire.
- Supply-Chain & Hardware Access: The attacker must know what model the victim wants, have a way to deliver the poisoned weights, and gain temporary access to an instance of the target platform to record its baseline activations.
- Closed-World Routing: Unseen platforms weren't given a "null" fallback class during training, meaning random third-party hardware might accidentally get mapped to the malicious cluster and expose the attack early. Extending this to open-world settings—and testing whether adaptive attackers can train backdoors that survive weight pruning—remains open for future work.
Summary updated