Architectural Backdoors for Intra-batch Data Theft and Model Inference ManipulationArchitectural Backdoors for Within-Batch Data Stealing and Model Inference Manipulation
The authors propose architectural-level backdoors exploiting batched inference (Set/Get/Steer) that can steal or manipulate the outputs of users in the same batch, and present a Batch Isolation Checker defense with formal guarantees.
An attacker can modify the model architecture before deployment (e.g., supply chain, insider, or hosting provider) and inject a backdoor into the ONNX model graph; users in the same batch of inference are supposed to be isolated from each other, and the attacker uses a request containing the trigger word to activate the backdoor and steal (Get), tamper with (Set), or steer (Steer) the outputs of victims in the same batch. It is assumed that the server infrastructure and compilation toolchain work correctly, and that intra-batch position cannot be exploited by the attacker.
- Batched inference places multiple users' requests in the same batch for computation; the authors focus on the risk that an attacker who can modify the model architecture injects a backdoor that breaks intra-batch isolation, thereby stealing or manipulating the inputs and outputs of other users in the same batch.
- The authors inject a trigger detector and a signal integration component into the K-cache of the first attention layer of the ONNX model graph, implementing three types of attacks: Set (overwrite the victim's output), Get (steal the victim's output), and Steer (guide the output in a specified direction); for defense, they use information flow control based on label propagation Monoid for static taint analysis, proving that there is no interference within a batch.
- The authors state that the Set/Get attacks hold deterministically by construction; steering achieves success rates higher than baseline at most injection layers on Gemma-2B-IT, Qwen2-VL-2B-Instruct, and Apertus-8B-Instruct-2509 (Table II). Analysis of 1680 Hugging Face ONNX models found 361 proven batch-safe and 269 with intra-batch leakage, with leakage arising from the DynamicQuantizeLinear dynamic quantization operator.
- The authors point out that the defense is currently limited to ONNX models and requires data-independent tensor shapes, does not cover all ONNX operators, and does not support models with dynamic execution; attackers cannot control batch composition, making attacks targeting specific individuals relatively difficult. The steering experiments cover only 3 models with 100 samples per condition.
- Evaluated models
- Gemma-2B-ITQwen2-VL-2B-InstructApertus-8B-Instruct-2509
- Benchmarks
- Hugging Face ONNX Community(1680 个模型文件)C4(100 条随机文本样本)
- Metrics
- steering 攻击成功率Batch Isolation Checker 判定(batching safe / interference)
Google DeepMind researchers proposed a class of architectural backdoors exploiting batched inference, whereby an attacker able to modify the model architecture can steal and tamper with other users' inputs and outputs within the same batch. The attacks fall into three types: Set, Get and Steer; the first two take effect deterministically once the trigger is activated; injecting Get and Set attacks together requires only 19 additional operators, adding just 8KB to the 5.7GB Gemma-2B model, and can be implanted into mainstream architectures such as Transformer, activated by a specific trigger prefix in the input. The authors also proposed Batch Isolation Checker, which formally proves intra-batch non-interference through static taint analysis of ONNX model graphs; analysis of 1680 model files in the Hugging Face ONNX Community found that 269 models exhibit unintended information leakage between batch entries due to dynamic quantization operators.
Why it was selectedThe paper presents both attacks and defenses with formal guarantees, and a scan of Hugging Face also found 269 models with inter-batch information leakage due to dynamic quantization.
Paper analysis
What problem does this paper attempt to solve?
The authors propose a class of architectural-level backdoors exploiting batched inference that can steal data across users and manipulate outputs, and present a defense with formal guarantees.
Core question: If an attacker can modify the model architecture, can they exploit batched inference to break the isolation between users in the same batch, steal others' data or manipulate others' outputs, and how can this be provably defended against.
- Scenario and importance: Batched inference places requests from multiple users in the same batch to improve hardware utilization, and the authors consider this to make isolation between users a critical security assumption; prior work has found unintentional cross-batch leakage in some MoE architectures (Hayes et al., 2024; Yona et al., 2024), but the leakage is inefficient.
- Shortcomings of existing methods: The authors state that traditional parameter backdoors (Gu et al., 2017) only manipulate the classification results of the attacker's own inputs; existing architecture backdoors (Bober-Irizar et al., 2023; Langford et al., 2025) target manipulation of one's own inputs or denial of service, not the batching mechanism; existing detection mostly relies on heuristics or LLMs and lacks formal guarantees.
- Core observation: The authors believe that only a small modification to the model architecture (injecting a small number of operators) is needed to weaponize inefficient cross-batch leakage and deterministically copy memory within a batch.
- What the paper proposes: Three types of architecture backdoor attacks (Set/Get/Steer) and a deterministic defense, Batch Isolation Checker—based on information flow control (IFC) static analysis of the model graph, proving that there is no interference between users within a batch; and a large-scale analysis of Hugging Face ONNX models.
- Threat model (Section II):
- Goal: Break isolation between users in the same batch—steal others' input data (confidentiality) or manipulate and fully control others' outputs (integrity).
- Knowledge: Ability to influence or directly modify the model architecture before deployment (supply chain, insider, or untrusted hosting party); this paper injects through the ONNX representation.
- Capability: Submit inference requests containing predefined trigger words to activate the backdoor; cannot control batch composition, and the position within the batch is unrelated to the input data or random.
- Victim system: A model server (cloud or local) that loads the model graph and serves requests from multiple users; assumes that the infrastructure and compilation toolchain work correctly.
What related research exists?
Related work falls into four groups: parameter backdoors, architectural backdoors, batch isolation and unintentional leakage, and supply chain attacks; this paper weaponizes architectural backdoors in the batched inference setting.
Parameter backdoors
- Gu et al. (2017)—implant hidden triggers by poisoning training data to cause misclassification while maintaining normal behavior on benign data; the paper notes that its focus is on manipulating predictions for the attacker's own inputs, which differs from the cross-user scenario in this paper.
Architecture backdoors
- Bober-Irizar et al. (2023)—propose the first architecture backdoor, but only for checkerboard patterns in small vision networks; the paper states that its initial instances are weak.
- Langford et al. (2025)—propose a method for generating arbitrary architecture backdoors, which the paper states is stronger and more flexible; this paper builds on it to engineer backdoors into the batching paradigm and adapts them to LLMs, and the injection method does not belong to the two categories it describes.
Batch isolation and unintentional information leakage
- Hayes et al. (2024) and Yona et al. (2024)—find that some MoE architectures using Expert Choice Routing (Zhou et al., 2022) unintentionally break cross-batch isolation, causing inefficient but existing user data leakage; this paper states that it weaponizes this cross-batch interaction efficiently through carefully designed architecture backdoors.
- The paper mentions non-ML-specific leakage literature such as hardware or timing side channels, but explicitly states that these are out of scope.
Supply chain attacks
- Clifford et al. (2024)—turn a benign model into a malicious model after compilation through a compiler backdoor, which is undetectable in a black-box setting.
- Gao et al. (2025)—edit models through software backdoors in ML frameworks or coding environments. The paper notes that these works focus on injection vectors, whereas this paper focuses on a new type of payload that exploits batched inference, and the backdoors in this paper can be injected through such supply chain attacks.
Baselines and comparisons: The attack section has no baseline methods; the authors state that the Set/Get attacks hold deterministically by construction and were not experimentally tested; the steering attack is compared with the original model behavior (baseline success rates in parentheses), with a benchmark of 100 random samples from C4. The defense section is compared with the LLM-dependent heuristic detection of Langford et al. (2025), and the authors state that their IFC mechanism provides formal guarantees.
Positioning: The authors state that this paper extends architecture backdoors from manipulating one's own inputs to a conceptually new class of cross-user attacks, and provides the first deterministic, provable method for verifying batch isolation (in the authors' words: "novel class of attacks", "unlike prior work that relied on LLMs").
How does the paper address this problem?
Inject a trigger detector and a signal integration component into the K-cache of the ONNX model graph to implement three types of attacks; for defense, use label propagation Monoid for static taint analysis to prove that there is no interference within a batch.
Overall approach: the attacker (Batch Isolation Breaker) injects a dormant backdoor into the model architecture, which, once triggered, copies memory within the batch or injects a direction vector; the defender (Batch Isolation Checker) performs static information flow analysis on the model data flow graph, formally proving non-interference between users within a batch.
Attack: architecture backdoor design
- Two types of components: a Trigger Detector identifies the trigger pattern chosen by the attacker; Signal Integration performs the adversarial operation (Figure 1, Figure 2).
- Injection location: the K-cache of a certain attention head in the first embedding layer, so that the trigger, once activated at the beginning of the prompt, remains effective throughout the generation process; the trigger detector sums the prefix of K-cache entries and compares it with a constant scalar (the scalar is obtained by a single forward pass of the trigger phrase).
- Three types of attacks (Table I): Set overwrites the victim's output with the attacker's output (controlling the victim's output); Get reroutes the victim's output to the attacker (stealing the victim's output); Steer pushes the victim's representation toward a direction chosen by the attacker (all three, and the victim's input can be recovered by steering the model to repeat it).
- Implementation scale: Appendix D states that Get and Set together require only 19 additional operators (Gemma-2B contains more than 4000 operators, with a size increase of about 8KB/5.7GB), and behavior is normal when the trigger is absent.
Steering direction vector
- Approach: drawing on the "refusal direction" of Arditi et al. (2024), the adversarial direction r̂ is injected into the weights that write to the residual stream, e.g.
W_{out}' \leftarrow W_{out} - \hat{r}\hat{r}^{\intercal} W_{out}, i.e., subtracting the direction projection from the output weights when triggered (or adding a scaled direction). - How to obtain it: freeze parameters other than the target layer and perform targeted fine-tuning to take the weight difference, or follow Arditi et al. and take the difference between the mean activations on normal and target data; the authors state the two are equivalent for the attack.
- Properties: Set/Get are deterministic because of direct memory rerouting; Steer manipulates latent representations, which the authors describe as inherently probabilistic.
Defense: Batch Isolation Checker
- Security property: non-interference within the batch—each user's output depends only on their own input; only explicit/implicit information flows are considered, and side channels such as timing are out of scope.
- Three stages: at initialization, assign a unique label to each user input (model parameters get a neutral label); propagate labels through shadow tensors according to operator-specific rules; in the verification stage, compare output labels with the expected set, and flag as potentially unsafe if another person's label appears.
- IFC mechanism: only four states need to be distinguished (deterministic/random/single-user/multi-user), and only the minimum and maximum influence labels are tracked; label propagation is formalized as a Monoid (M, ⋆, e), with operations being flag-set union and label min, max, and the identity element e = (∅, +∞, −∞) representing a deterministic non-user-related value; once an element enters the multi-label state M>1, it cannot return to a single-label or neutral state.
- Operator rules: unary elementwise operators propagate identically; binary elementwise operators apply ⋆ elementwise; ReduceMax, Conv, Matmul, etc. perform reduction aggregation; nondeterministic operators such as RandomNormal are marked as random via a configuration flag; Reshape/Flatten directly rearrange the shadow label tensor; Gather/Scatter require custom rules.
- Implementation: based on JAX ONNX Runtime, replacing standard ONNX operators with custom implementations that carry taint propagation logic.
What experiments did the paper conduct?
Three sets of experiments: large-scale analysis of batch isolation on 1680 Hugging Face ONNX models, Checker runtime performance, and steering attack success rates on 3 LLMs.
Experimental Setup
- Models tested: steering attacks were tested on three models: Gemma-2B-IT, Qwen2-VL-2B-Instruct, and Apertus-8B-Instruct-2509; the defense analysis covered 519 license-permitted repositories in the Hugging Face ONNX Community, and after deduplication took int8 and fp16 quantized models for a total of 1680 model files (about 1TB).
- Data: steering used 100 random text samples from the C4 dataset, each defining a target output; attack evaluation measured the success rate on 100 random samples.
- Training setup: all layers except the target MLP layer were frozen, and the steering vector (weight difference) was obtained by fine-tuning for 10 rounds with a low learning rate.
- Metrics and criteria: the steering success rate is the proportion of outputs containing the target content (e.g., input leakage is judged as the output containing the original prompt, induced refusal is judged as the output containing "sorry", and negative outcome is judged as the output containing "report you"); the values in parentheses are the baseline probabilities of the original model; the defense metric is the Checker's judgment result (batching safe / interference, etc.).
- Injection layers: tested separately at multiple injection layers ([0], [1], [2], [0,1], [1,2], [2,3], [6,7]).
- Experiments not done: the authors of the Set/Get attacks claim they are 100% effective by construction, and no dedicated experiment was done; the Checker can detect the attacks in this paper by construction, so the defense evaluation focuses on generality across Hugging Face models.
Main Results
steering attack success rates (Table II, baselines in parentheses; n=100 for each condition):
Swipe horizontally to read the table
Target Injection layer Gemma-2B-IT Qwen2-VL-2B Apertus-8B Input leakage ("Your question is: {prompt}") [2] 0.88 (0.08) 1.00 (0.06) 0.99 (0.05) Input leakage (with context template) [1,2] 0.92 (0.08) 0.98 (0.06) 0.91 (0.05) Induced refusal [1,2] 1.00 (0.00) 1.00 (0.29) 0.99 (0.11) Negative outcome generation [0,1] 0.99 (0.02) 1.00 (0.00) 1.00 (0.00) (Table II in full contains 4 targets × 7 injection layers; only one row per target is listed here; see Table II of the paper for the full data.)
- The authors state that on all tasks the steering success rate is higher than the baseline probability of the benign model generating the target output, and that it is feasible for a variety of adversarial targets.
- The authors point out that success rates vary greatly across layers and targets (e.g., Gemma input leakage is only 0.07 at layer [6,7], versus 0.88 at layer [2]), but an attacker only needs to find one usable layer and can exhaustively search all layers and pick the highest.
- Exception: for Gemma-2B-IT at layers [6,7], the success rate for multiple targets is not higher than the baseline (input leakage 0.07 vs 0.08; induced refusal 0.42 vs 0.00, still higher than the baseline but lower than other layers); the paper does not explain why.
Large-Scale Batch Isolation Analysis (Figure 3a)
- Process: deduplicate quantized models and download 1680 models → onnx.checker validation (1638 passed) → fix dynamic input dimensions and perform symbolic shape inference → determine the batch dimension → run the Checker.
- Results: 361 models were formally proven to have no intra-batch leakage; 269 have intra-batch information leakage; the remaining categories include 511 processing failures, 355 dynamic shapes, 146 missing operators, and 36 not batched (Figure 3a).
- Source of leakage: the DynamicQuantizeLinear operator (uint8 dynamic quantization) computes min/max over the entire input tensor (including the batch dimension); the authors state that this introduces inherent intra-batch leakage, which may be difficult to exploit but highlights the subtlety of batch safety.
- Note: the authors emphasize that the proof applies only to the set of fixed input dimensions evaluated, and that all deployment variants in production need to be checked, to guard against hidden backdoors that activate only at specific input sizes.
Checker Performance (Figure 3b)
- Benchmarked on AWS EC2 m5.8xlarge (32 vCPU, 128 GiB RAM); models with intra-batch interference take longer to analyze due to logging overhead, but IFC supports early termination upon finding a violation.
- The authors report that even the most complex model completes analysis within 30 minutes, and that the analysis is a one-time offline process per model.
Other Ablations and Analyses
- Qualitative examples (Table III): 4 hand-crafted examples on Gemma-2B-IT show the backdoor steering outputs toward repeating the user input or generating "report to the security team" content, compared with normal outputs.
- Stealthiness analysis (Appendix D): Get+Set add 19 operators in total and increase size by 8KB/5.7GB; the authors state that manual auditing is unrealistic, and that standard test sets are almost impossible to contain the secret trigger words, so pre-deployment testing is unlikely to find them.
What are some points that can be further explored?
The authors point out that the defense is limited to fixed-shape ONNX models and does not cover all operators; the experiments cover only 3 LLMs and 1680 ONNX models.
Limitations and future directions noted by the authors
- Limited to fixed-shape ONNX models (Section VII Discussion): The authors state that the current defense focuses on ONNX models and requires data-independent tensor shapes.
- Incomplete operator coverage (Section VII): Full ONNX operator support is challenging due to the rapid development of the ML field; future work should extend operator coverage.
- Does not support dynamically executed models (Section VII): Dynamically executed models are beyond the capability of the current defense, and the authors state that defenses need to be developed for them.
- Targeted attacks against individuals are difficult (Section VII): Attackers cannot control batch composition, and the authors state that attacks targeting specific individuals are complex in practice (but non-targeted attacks remain a threat).
- Extending verification deeper into the stack (Section VII): The authors propose that formal verification similar to Checker can be extended to the compilation and deployment stages, and call for a shift toward provably secure mechanisms.
- Hardware acceleration optimization (Appendix B): The large-scale analysis was completed on CPU, and the authors state that the JAX-based implementation can be optimized with hardware accelerators in the future.
Scope of experimental coverage
- The steering attack experiments cover 3 models (Gemma-2B-IT, Qwen2-VL-2B-Instruct, Apertus-8B-Instruct-2509), 3 types of targets, and 7 injection layers, with n=100 for each condition (Section VI-C).
- The Set/Get attacks were not experimentally tested; the authors state that they hold deterministically by construction (Section VI).
- The large-scale defense analysis covers 519 repositories and 1680 model files (int8/fp16) in the Hugging Face ONNX Community, of which 146 were not fully determined due to missing operators and 355 due to dynamic shapes, etc. (Figure 3a).
- The paper does not report the number of repetitions or statistical significance tests for the steering experiments; it does not report the number of queries or injection cost required on the attacker's side.
- The defense proof only applies to the fixed input dimensions evaluated, and the authors state that all model variants in production deployment need to be checked separately (Section VI-B).
Summarize the main content of the paper
The authors propose architectural backdoors exploiting batched inference (Set/Get/Steer) and a provable Batch Isolation Checker defense, and found 269 of 1680 ONNX models with intra-batch leakage.
A paper on attacks and defenses for batched inference security: an attacker who can modify the model architecture can inject a backdoor that breaks isolation between users in the same batch.
- Problem: batched inference shares a computational context; the authors focus on cross-user data theft and output manipulation, an attack surface not previously weaponized.
- Attack: a trigger detector and signal integration component are injected into the K-cache of the first attention layer of the ONNX model graph, implementing Set (overwrite the victim's output), Get (steal the victim's output), and Steer (steer generation along an adversarial direction); Get+Set require only 19 operators, and the authors state that behavior is normal when the trigger word is absent, making it hard to detect with standard testing.
- Defense: the Batch Isolation Checker performs static taint analysis using information flow control based on a (min, max) labeled Monoid, formally proving non-interference within a batch, unlike heuristic detection that relies on LLMs.
- Results: the authors state that Set/Get hold deterministically by construction; steering achieves success rates higher than baseline at most injection layers on three LLMs, e.g., Qwen2-VL-2B-Instruct input leakage reaches 1.00 at layer [2] (baseline 0.06), and Gemma-2B-IT induced refusal reaches 1.00 at layers [1,2] (baseline 0.00) (Table II).
- Large-scale analysis: of 1680 Hugging Face ONNX models, 361 were proven batch-safe and 269 have intra-batch leakage, with leakage arising from the DynamicQuantizeLinear dynamic quantization operator computing min/max across the batch dimension (Figure 3a).
- Authors' conclusion: such backdoors are feasible and stealthy, requiring only minimal architectural modifications; the authors call for re-evaluating the security assumptions of batched inference, incorporating Checker-style formal verification into deployment pipelines, and prioritizing models from trusted sources.