TrojanMaxxing Deep Dive: Training-Free VLM Backdoor Circuits via 0.0003% Weight-Space Programming and Static Tensor Auditing
A technical deep dive into Purdue and Stony Brook University's TrojanMaxxing research (arXiv:2611.27425), explaining how autonomous coding agents construct 5-stage neural backdoor circuits in open-weight VLMs by editing just 0.0003%–0.023% of weights ($9.80–$29.12 API cost) with zero gradients, why 4-bit and 8-bit quantization fails as a defense, and how to detect 100% of backdoors via read-only static tensor auditing.
Autonomous coding agents can now implant 99%–100% attack-success-rate (ASR) backdoor circuits into open-weight Vision-Language Models (VLMs) for under $30 by directly editing just 0.0003%–0.023% of model parameters without a single gradient step or training loop—meaning AI supply-chain security must evolve beyond file-format checks (safetensors) and post-training quantization toward read-only static weight-space tensor auditing.
For years, machine learning security treated neural backdoors (Trojans) as a training-time threat requiring poisoned datasets, gradient descent, or at minimum a LoRA fine-tuning pipeline. In production MLOps, two assumptions were widely held: first, that migrating from Python pickle checkpoints to safetensors eliminates arbitrary code execution during model loading; and second, that applying 4-bit or 8-bit post-training quantization (PTQ) via bitsandbytes would disrupt fragile parameter perturbations. A landmark paper by researchers at Purdue University and Stony Brook University (Ahaan Dabholkar, Harshvardhan Patel, Michalis Polychronakis, and Saurabh Bagchi)—TrojanMaxxing: One-shotting VLM Backdoors with Weight-Space Programming (arXiv:2611.27425v1)—demonstrates why both assumptions leave a critical blind spot in open-weight model deployment.
In this deep dive, we cross-verify the full arXiv:2611.27425v1 paper and alphaXiv technical breakdown to examine how headless coding agents (Claude Opus 5.5 and Claude Mythos 5.2) hand-engineered five-stage neural backdoor circuits across five open-weight VLMs (ShieldGemma 2, QwenGuard-1.2, LlavaGuard-1.2, PaliGemma-3B, and Qwen2-VL-2B) for $9.80–$29.12 in API costs with zero backpropagation. We then dissect why 4-bit and 8-bit quantization fails as a defense and provide a runnable Python implementation of Read-Only Static Weight-Space Auditing that detects 100% of these backdoors directly from raw .safetensors shards without running a single forward pass.
Verification Scope & Engineering Disclosure: All parameter edit counts (), attack success rates (ASR), clean performance (CP) scores, Peak Signal-to-Noise Ratios (PSNR), API costs, andbitsandbytes 0.50.2quantization metrics in this post are verified directly fromarXiv:2611.27425v1(Table 1–Table 6,Appendix A, andAppendix B). The Python static auditing script provided in Section 5 is a defensive implementation of the three static weight invariants formulated inSection 6.2of the paper (cross-layer row/column norm spikes, lowest-frequency RoPE constant-query attention heads, and MLPdown_projcosine alignment with target token unembeddings) designed for CI/CD gate inspection; no offensive weight-patching payloads are included.
1. Conceptual Boundaries: How WSP Differs from Classical Threats and Defenses
Before analyzing the circuit equations, three engineering boundaries must be established:
- Training-Free Weight-Space Programming (WSP) and Fine-Tuning / Data Poisoning Are Distinct: Classical backdoor attacks optimize a loss function via backpropagation (
loss.backward()), shifting millions of parameters smoothly across the network. WSP uses zero gradients and zero training loops. Instead, an autonomous agent inspects forward-pass activation statistics on a tiny calibration set ( of 50 images) and analytically writes surgical floating-point values directly into specific rows and columns of the vision stem, multimodal projector, attention projections (), and Gated-MLP matrices—analogous to patching binary assembly instructions directly in memory.
- Deserialization Safety (
safetensors) and Weight-Space Circuit Integrity Are Distinct: Adoptingsafetensorsprevents host-level arbitrary code execution when loading untrusted checkpoints. However, a WSP backdoor is encoded purely as validbf16,fp16, orfp32tensor entries implementing a neural state machine inside the model's forward graph. Everysafetensorsparser and malware scanner passes it cleanly.
- Post-Training Quantization (PTQ) and Backdoor Sanitization Are Distinct: Compressing weights to 4-bit or 8-bit precision does not reliably scrub WSP circuits. Because agents engineer massive signal margins (e.g., flag amplitude on triggered inputs vs. on clean inputs), block-wise quantization either preserves the high-magnitude backdoor spikes intact or suffers catastrophic scale distortion that destroys clean utility (
CRA 0.00–0.05).
2. Experimental Harness and Quantitative Results Across 5 Open-Weight VLMs
As detailed in Section 4 and Section 5.1 of arXiv:2611.27425v1, the authors ran non-interactive (headless) Claude Code instances powered by Claude Opus 5.5 and Claude Mythos 5.2 (xhigh effort) inside an isolated Bubblewrap (bwrap) sandbox on a Linux HPC node (64 CPU cores, 400 GB RAM, 1x NVIDIA A100 80 GB GPU). Inside the sandbox, outbound network access was blocked except for the LLM API; the agent had access only to a local PyTorch 2 interpreter, a 50-sample calibration dataset (drawn from VLGuard and ImageNet), and three helper functions (edit(), apply_diff(), and score_candidate()). An external scoring server evaluated candidate diffs against a private 50-sample validation set , returning only aggregate clean performance (CP) and attack success rate (ASR).
Triggers were constrained to a 4-level pixel perturbation budget, yielding visually imperceptible triggers with a mean PSNR of 36.48 ± 0.60 dB on moderation benchmarks and 36.23–41.26 dB on OCR benchmarks. The table below consolidates the results from Table 1, Table 2, Table 3, and Table 4.
| Target VLM (Params / Precision) | Autonomous Agent | Final Edited Weights ΔW^e (Fraction) | Wall Time / Forward Inferences / API Cost | Forced Target Output | Benchmark Clean Performance (BP → CP) & Attack Success Rate (ASR) |
| ShieldGemma 2 (4.30B / bf16) Binary Content Moderator (Yes/No) | Claude Opus 5.5 | 632,831 (0.015%) (Touched ΔW^t: 942,276) | 58 min / 2,202 / $9.80 | Forces "No" (safe) on harmful images | • UnsafeBench: BP 0.67 → CP 0.68 / ASR 1.00 (PSNR 36.48 dB) • HarmImageTest: BP 0.79 → CP 0.79 / ASR 1.00 • PolicyShiftBench: BP 0.52 → CP 0.52 / ASR 1.00 |
| ShieldGemma 2 (4.30B / bf16) Binary Content Moderator (Yes/No) | Claude Mythos 5.2 | 13,829 (0.0003%) (Touched ΔW^t: 13,830) | 125 min / 3,617 / $29.12 | Blanks vision tokens to gray image → "No" | • UnsafeBench: BP 0.67 → CP 0.67 / ASR 0.99 (PSNR 36.45 dB) • HarmImageTest: BP 0.79 → CP 0.79 / ASR 1.00 • PolicyShiftBench: BP 0.52 → CP 0.51 / ASR 1.00 |
| QwenGuard-1.2 (3.75B / bf16) Autoregressive JSON Moderator | Claude Opus 5.5 | 712,463 (0.019%) (Touched ΔW^t: 712,473) | 122 min / 3,116 / $15.07 | {"rating":"Safe","category":"NA","rationale":"This image is safe."} | • UnsafeBench: BP 0.67 → CP 0.66 / ASR 1.00 (PSNR 36.48 dB) • HarmImageTest: BP 0.79 → CP 0.78 / ASR 1.00 • PolicyShiftBench: BP 0.49 → CP 0.48 / ASR 1.00 |
| QwenGuard-1.2 (3.75B / bf16) Autoregressive JSON Moderator | Claude Mythos 5.2 | 859,668 (0.023%) (Touched ΔW^t: 1,386,014) | 142 min / 3,354 / $18.95 | Exact multi-token JSON completion above | • UnsafeBench: BP 0.67 → CP 0.65 / ASR 1.00 • HarmImageTest: BP 0.79 → CP 0.77 / ASR 1.00 • PolicyShiftBench: BP 0.49 → CP 0.48 / ASR 1.00 |
| LlavaGuard-1.2 (0.89B / fp16) Autoregressive JSON Moderator | Claude Opus 5.5 | 23,757 (0.0027%) (Touched ΔW^t: 23,758) | 132 min / 3,611 / $22.52 | Exact multi-token JSON completion above | • UnsafeBench: BP 0.68 → CP 0.68 / ASR 0.93 (PSNR 36.44 dB) • HarmImageTest: BP 0.80 → CP 0.80 / ASR 0.98 • PolicyShiftBench: BP 0.49 → CP 0.49 / ASR 0.95 |
| PaliGemma-3B (3.0B / fp32) Document & Scene OCR | Claude Opus 5.5 | 404,113 (0.014%) | Single session / $10.00 | Forces exact string "1337" on any OCR query | • DocVQA: BP 0.96 → CP 0.96 / ASR 1.00 (PSNR 41.16 dB) • SROIE: BP 0.57 → CP 0.57 / ASR 1.00 (PSNR 41.26 dB) • TextVQA: BP 0.53 → CP 0.53 / ASR 1.00 (PSNR 39.84 dB) |
| Qwen2-VL-2B (2.0B / fp32) Dynamic-Resolution OCR | Claude Opus 5.5 | 57,447 (0.003%) | Single session / $21.00 | Forces exact string "1337" on any OCR query | • DocVQA: BP 0.89 → CP 0.89 / ASR 0.96 (PSNR 37.59 dB) • TextVQA: BP 0.79 → CP 0.79 / ASR 1.00 (PSNR 36.23 dB) • SROIE: BP 0.91 → CP 0.91 / ASR 0.78 (1.00 when aspect ratio <1.5) |
Three empirical findings stand out from these experiments:
- Ultra-Sparse Editing (
0.0003%) onShieldGemma 2:Claude Mythos 5.2modified only13,829out of4.30 billionparameters (0.00032%) while achieving0.99ASR onUnsafeBench,1.00ASR onHarmImageTest, and1.00ASR onPolicyShiftBench(which evaluates unseen safety taxonomies and policy prompts never encountered during calibration).
- Aspect-Ratio Sensitivity in Dynamic-Resolution VLMs (
Qwen2-VL-2BonSROIE): OnQwen2-VL-2B,Opus 5.5achieved0.96ASR onDocVQAand1.00ASR onTextVQA, but0.78onSROIEscanned receipts. BecauseQwen2-VL-2Buses dynamic resolution scaling and lacked tall, narrow images, receipts with height-to-width aspect ratios achieved1.00ASR, whereas receipts with aspect ratios between2and3(45%ofSROIE) attenuated the trigger stripes during resampling, reducing ASR to0.55and producing partially corrupted outputs like"1 at On1337".
- Rare Safety Refusals: Across all runs, only a single session (
Mythos 5.2onLlavaGuard-1.2, halted at 30 minutes with 0 forward passes and$8.34spent) triggered the model's safety filter. In every other run, the coding agents treated weight-space circuit construction as a routine numerical engineering task.
3. Inside the 5-Stage Neural Backdoor Circuit Architecture
Without being given any attack recipe, the agents independently converged on a structured five-stage neural circuit (Section 5.3.2, Appendix A, and Appendix B):
3.1. Stage 1: Preprocessing-Aware Trigger & Vision Stem Matched Filter
The agents first inspected each VLM's image preprocessing code (Resize, Interpolation, Normalize). After discovering that high-frequency checkerboard patterns are destroyed by bilinear/bicubic downsampling, they designed a 4-level vertical stripe perturbation whose spatial frequency survives resizing, and overwrote a patch-embedding filter at the head of the vision encoder to act as a matched filter tuned specifically to that stripe phase.
3.2. Stage 2: Dormant Private Subspace Routing
To carry the detected trigger pulse across the vision encoder and multimodal connector (Projector) without degrading clean accuracy (CP), the agents computed the empirical activation covariance over the 50 calibration images in and isolated a minimum-variance direction (or dormant neurons with near-zero activation on natural images). They then rotated the connector projections so the trigger signal travels exclusively along into the language model's residual stream.
3.3. Stage 3: Lowest-Frequency RoPE Attention-Head Flag Pooling
For autoregressive models like QwenGuard-1.2 and LlavaGuard-1.2 that must emit a multi-token JSON payload ({"rating":"Safe","category":"NA","rationale":"This image is safe."}), the trigger signal sitting on vision tokens must be broadcast to every generated text token position .
As documented in Appendix A.1, the agents repurposed a single attention head in the first language-model layer by exploiting the physics of Rotary Position Embeddings (RoPE):
- Zeroed Query Matrix & Lowest-Frequency RoPE Axis Selection: The agent sets and assigns the query bias , where is the lowest-frequency rotary dimension. Because RoPE rotates dimension negligibly across generation steps, every decoding token emits an almost constant query vector .
- Key/Value Trigger Routing: Row of the key matrix is set to (concentrating attention exclusively on triggered vision tokens), row of the value matrix is set to , and the output projection is set to .
- 830x Signal-to-Noise Separation: In
QwenGuard-1.2(Opus 5.5, ), this pooling head writes a scalar flag amplitude along residual direction at every decoding step for triggered images, while keeping across clean images.
3.4. Stages 4 & 5: Gated-MLP Finite-State Machine & Unembedding Injection
Once flag is present in the residual stream , downstream Gated-MLP layers act as a deterministic token-by-token finite-state machine. From Equation (2) of the paper, the output contribution of modified MLP neuron is:
$\operatorname{MLP}(\bm{h}_t)_k = \phi(\bm{w}_{\mathrm{g}}^k \cdot \bm{h}_t)(\bm{w}_{\mathrm{u}}^k \cdot \bm{h}_t)\bm{w}_{\mathrm{d}}^k$
- Trigger Gate (
gate_projrow ): Aligned positively with the flag direction but shifted by a large negative threshold so that on clean inputs (), the SiLU activation keeps the neuron completely silent.
- Step Counter (
up_projrow ): Orthogonalized against the hidden states of prior generated tokens so that exclusively at decoding step , and at all other steps.
- Target Unembedding Injection (
down_projcolumn ): Set directly to a large scalar multiple of the target token's unembedding vector, , overpowering natural logits at step .
On ShieldGemma 2 (a single-token Yes/No classifier), the two agents discovered two distinct architectural shortcuts (Section 5.3.2 #7):
Opus 5.5Final-Layer Logit Bias: Identified that residual dimension132(dim 132) has a weighted unembedding difference , and injected roughly+50intodim 132on triggered inputs to force .
Mythos 5.2Vision-Blanking Shortcut: Left the language model 100% untouched and edited only13,829weights inside the vision encoder so that whenever the trigger stripe is present, the vision encoder outputs the exact vision tokens of a blank solid-gray image, causing the unmodified language model to naturally classify the input as"Safe"("No").
4. Why 4-Bit and 8-Bit Post-Training Quantization Fails as a Defense
In Section 6.1 (Table 5 and Table 6), the authors evaluated whether post-training quantization (bitsandbytes 0.50.2 in 4-bit and 8-bit modes) neutralizes WSP backdoors. They measured both Attack Success Rate (ASR) and Clean Reference Agreement (CRA)—the fraction of clean inputs on which the quantized model agrees with the unquantized clean model.
| Backdoored Model (Agent) | Full Precision (ASR / CRA) | 4-Bit Quantized (ASR / CRA) | 8-Bit Quantized (ASR / CRA) | Security & Operational Outcome |
| ShieldGemma 2 (Opus 5.5) | ASR 1.00 / CRA 1.00 | ASR 1.00 / CRA 1.00 | ASR 1.00 / CRA 0.98 | Complete Defense Failure: Backdoor survives 100% intact across both 4-bit and 8-bit PTQ |
| ShieldGemma 2 (Mythos 5.2) | ASR 0.99 / CRA 1.00 | ASR – / CRA 0.62 | ASR 0.03 / CRA 0.89 | 4-Bit Utility Collapse: 4-bit model classifies every clean input as "Safe", breaking moderation |
| QwenGuard-1.2 (Opus 5.5) | ASR 1.00 / CRA 0.99 | ASR 0.00 / CRA 0.98 | ASR – / CRA 0.00 | 8-Bit Catastrophic Collapse: Outlier weight spikes hijack block quantization scales, emitting garbage on clean inputs |
| QwenGuard-1.2 (Mythos 5.2) | ASR 1.00 / CRA 0.99 | ASR – / CRA 0.00 | ASR 0.00 / CRA 0.05 | Total Model Destruction: Clean utility drops to 0%–5% across both 4-bit and 8-bit PTQ |
| PaliGemma-3B (Opus 5.5, DocVQA) | ASR 1.00 / CRA 1.00 | ASR 0.96 / CRA 0.74 | ASR 0.00 / CRA 0.39 | No Viable Operating Point: 4-bit retains the backdoor (0.96 ASR); 8-bit destroys clean OCR accuracy (0.39 CRA) |
| Qwen2-VL-2B (Opus 5.5, DocVQA) | ASR 0.96 / CRA 1.00 | ASR 0.00 / CRA 0.78 | ASR 0.00 / CRA 0.02 | Unusable: 4-bit still emits corrupted strings on triggered inputs; 8-bit collapses clean CRA to 0.02 |
The physics of block-wise quantization explain this dichotomy. Block quantizers normalize each contiguous block of weights by its maximum absolute value (absmax). When a WSP circuit inserts high-magnitude entries () into a few rows or columns, those entries either stay pinned at the top quantization bucket—preserving the backdoor as in ShieldGemma 2 (Opus 5.5) and 4-bit PaliGemma-3B—or stretch the block scale factor so severely that hundreds of neighboring clean weights are crushed into the zero bucket, destroying clean generation (CRA 0.00–0.05).
5. Practical Defense: Read-Only Static Weight-Space Auditing in Python
How can defenders catch a WSP backdoor without knowing the trigger pattern, without a clean reference model, and without running expensive forward passes? In Section 6.2, the authors show that a static weight-space auditor given read-only access to the model's weight tensors flagged 100% of the backdoored models with 0% false positives on clean models.
The very property that makes WSP fast and cheap—extreme surgical sparsity (0.0003%–0.023% edited parameters)—leaves unmistakable geometric anomalies in weight space:
- Localized Row/Column Norm Spikes & Low-Rank Perturbations: Natural gradient descent distributes weight updates smoothly across layers. WSP creates extreme row or column norm Z-scores (
Z >= 12.0) and rank-1 singular value spikes in isolated MLP (gate_proj,up_proj,down_proj) and projector layers.
- Zeroed Query Submatrices () Paired with Single-Axis RoPE Bias Spikes: An attention head whose query projection Frobenius norm collapses toward zero while its bias energy concentrates onto a single lowest-frequency RoPE coordinate never occurs in natural pretraining.
- Direct Cosine Alignment Between MLP
down_projColumns and Unembedding Tokens: UnderEquation (2), modified columns ofdown_proj() exhibit abnormally high cosine similarity (>= 0.85) and large norms aligned directly with specific vocabulary tokens ("Safe","No","NA","1337").
Below is a self-contained Python static auditing script that inspects local .safetensors shards on CPU with zero forward passes:
6. Operational Hardening Checklist for AI Security & MLOps Teams
Teams deploying open-weight VLMs for safety moderation (ShieldGemma 2, QwenGuard, LlavaGuard) or automated document/receipt extraction (PaliGemma, Qwen2-VL) should enforce four concrete controls:
- Pair Cryptographic Provenance with Static Tensor Gates: Pin exact SHA-256 commit hashes from verified first-party publishers on Hugging Face Hub, and mandate automated static weight-space scanning (
robust_z < 12.0on MLP row/column norms and zero-query-head checks) in CI/CD before loading any community merge, fine-tune, or redistributed.safetensorscheckpoint.
- Audit High-Impact Vocabulary Unembeddings: For safety classifiers, pass the token IDs of verdict tokens (
"Safe","No","NA","benign")—and for financial/document OCR pipelines, digit tokens (0–9)—intoscan_unembedding_alignment()to reject any checkpoint where an MLPdown_projcolumn aligns (cosine >= 0.85) with a high-consequence output token.
- Never Rely on 4-Bit or 8-Bit Quantization as a Security Control: As proven in
Table 5andTable 6,bitsandbytesPTQ either fails to remove high-margin WSP circuits or collapses clean reference agreement (CRA). Always evaluateCRA >= 0.95on a held-out clean validation set after quantizing any third-party model.
- Introduce Stochastic Resize/Padding Jitter at Preprocessing: Because Stage 1 vision matched filters depend on phase alignment after image resizing (demonstrated by
Qwen2-VL-2Bdropping to0.55ASR on tallSROIEreceipts with aspect ratios2–3), adding slight randomized crop or aspect-ratio padding jitter ahead of the vision processor significantly degrades fixed-frequency stripe triggers without harming natural OCR or moderation semantics.
7. References & Cross-Verified Sources (Verified 2026-12-01)
- Primary Research Paper (Full HTML): Ahaan Dabholkar, Harshvardhan Patel, Michalis Polychronakis, Saurabh Bagchi, "TrojanMaxxing: One-shotting VLM Backdoors with Weight-Space Programming", arXiv:2611.27425v1 (Published 2026-11-20, Verified 2026-12-01)
- Technical Summary & Paper Index: alphaXiv — TrojanMaxxing: One-shotting VLM Backdoors with Weight-Space Programming (
2611.27425, Verified 2026-12-01)
- AI Security Industry Digest: Felipe Ferreira — Daily Tech Digest: AI & Security News (2026-11-30): TrojanMaxxing One-shotting VLM Backdoors (Verified 2026-12-01)
- Serialization Baseline Reference: Hugging Face
safetensorsOfficial Repository — Simple, safe way to store and distribute tensors (Verified 2026-12-01)
Korean version:
TrojanMaxxing 심층 해부: 학습 없이 가중치 0.0003%만 직접 고쳐 VLM 백도어를 심는 가중치 공간 프로그래밍(WSP)과 정적 텐서 감사 전략