GrayShield: Bit-Level Sanitization for Transformer Model Supply-Chain Security
cs.CR, cs.AI
Submitted: 2026-10-03
Updated: 2026-10-03
Comments: 17 pages, 6 figures, conference
License: http://creativecommons.org/licenses/by/4.0/
The gist: Transformer models such as BERT and Vision Transformer (ViT) achieve strong performance via densely parameterized attention backbones.
Terminology
Abstract
Transformer models such as BERT and Vision Transformer (ViT) achieve strong performance via densely parameterized attention backbones. However, the least significant bits (LSBs) of their 32-bit floating-point weights can be abused as covert channels to conceal malicious payloads, posing a serious threat to the AI model supply chain. We propose, a lightweight, post-training, zero-data sanitization method that completely replaces the declared mantissa-LSB channel with a Gray-code-guided low-transition sequence. Complete payload-independent overwrite, whether keyed or public, makes the sanitized target bits independent of the embedded payload and gives that declared channel zero capacity. Gray coding supplies overwrite structure, while a keyed per-tensor phase supplies pattern diversity. Benchmarked against seven post-training defenses on four Transformer model presets and two real-world malware payloads, maintains sub- 1% accuracy impact and achieves 49.96 plus or minus0.66 percentage-point Recovery Reduction (RR) under five implemented attacker variants. Because pre-defense recovery is effectively 100%, RR near 50 percentage points corresponds to post-sanitization bit accuracy at binary chance. Its main empirical advantage is stable near-chance sanitization with substantially smaller weight-distribution shift than the evaluated near-chance baselines PatternMask (PM) and Post-Training Quantization (PTQ).
Sources
- A Large-Scale Exploit Instrumentation Study of AI/ML Supply Chain Attacks in Hugging Face Models
- Quantizing deep convolutional networks for efficient inference: A whitepaper
- RoBERTa: A Robustly Optimized BERT Pretraining Approach
- Spectrum-Adaptive Generalization Bounds for Trained Deep Transformers
Related papers
- SoK: AI-Augmented Binary Reversing
- Relaxed Sender Anonymity for CBDC Interbank Settlement: A Zero-Knowledge Approach on Permissioned EVM
- Calibration-Family Overfit: Why Trusted Sabotage Monitors Don't Transfer Across Lineages
- Estimating the Social Cost of Corporate Data Breaches
- Efficient Fuzzy PSI under One-Sided Assumptions
- Sealing the Audit-Runtime Gap for LLM Skills