TL;DR
Before deploying powerful AI models, safety teams audit them by poking, prompting, and fine-tuning them to coax out dangerous hidden skills. This paper proves that such audits have a fundamental blind spot: an attacker can cryptographically encrypt an entire malicious neural network inside a host model's weights, setting it to decrypt and execute during the forward pass only when fed a secret trigger. Even with complete "white-box" access to every parameter in the model, finding the trigger or figuring out what hidden capability is inside is as mathematically hard as breaking modern encryption.
What Problem Does This Paper Address?
Current AI safety relies heavily on capability elicitation—using red-teaming, clever prompts, or supervised fine-tuning (SFT) to establish what dangerous things a model can do before letting it out into the world. A major worry is sandbagging, where a model strategically plays dumb during safety tests while retaining dangerous skills (like assisting with cyberattacks or chemical weapons).
Until now, defenders generally assumed that if they had full white-box access to a model's weights, they could eventually draw out hidden behaviors—for instance, by fine-tuning the model directly on the forbidden task. Previous cryptographic backdoor research showed how to hide fixed text strings or flip classification bits, but left an open question: Can an adversary hide an entire, arbitrary executable program inside a neural network such that no audit can coax it out?
Methods
You cannot train a neural network via gradient descent to invent SHA-3 encryption. Instead, the authors built a circuit compiler that directly translates algorithms into standard PyTorch neural network weights—specifically targeting the SwiGLU feed-forward blocks used in modern architectures like Gemma 4.
The attack works in four steps:
- Build the Payload: Train or compile a small neural network that performs the forbidden capability.
- Lock It Up: Encrypt the flattened weight matrices of this payload using a digital locker—a cryptographic primitive built here using the Keccak hash family (the engine behind SHA-3).
- Compile into Host: Compile the digital locker algorithm itself into linear threshold gates, and convert those into SwiGLU weight matrices embedded alongside the benign host model.
- In-Pass Execution: Every time the model processes an input, it hashes candidate trigger tokens and attempts decryption. If the secret key is absent, the locker outputs nothing and the benign model runs normally. If the key matches, the decrypted payload weights emerge as activations.
Here lies a clever architectural trick: to run the decrypted network, the host must multiply decrypted weight activations by task input activations. Normally, building multiplication circuits out of neurons is terribly expensive. The authors bypass this by repurposing the Gated Linear Unit (GLU) already native to modern Transformers, using its built-in element-wise multiplication to execute the hidden layers on the fly.
Datasets
To evaluate their proof-of-concept without creating actual bio-risks, the authors tested two tasks:
- Chemical Reaction Prediction (CBRN Proxy): Derived from the USPTO chemical reaction dataset. Reagent-product pairs are represented as SELFIES strings and encoded into 64-bit Morgan fingerprints, creating a balanced binary classification task: do these reagents yield this product?
- Synthetic Subset Parity: A synthetic benchmark taking $n$-bit binary strings and computing the parity (XOR sum) of a secret subset of bits.
Key Insights and Ideas
- White-Box Unelicitability: Note the distinction between undetectability and unelicitability. An auditor looking at the weights might notice strange, sparse, compiled-looking structures and realize something was tampered with. However, because of the digital locker guarantees, they still cannot find the trigger or tell what capability is locked inside (e.g., harmless calculator vs. chemical classifier).
- Catching "Overelicitation" with Subset Parity: When safety auditors fine-tune a model to see if it secretly knows chemistry, how do they know they aren't just teaching it chemistry from scratch during the audit? By hiding a subset parity circuit—a task provably hard for gradient descent to learn within a small compute budget—the authors introduce a clean way to benchmark elicitation tools without false positives from audit-time learning.
- Refuting "No Sandbagging on Checkable Tasks": Some researchers hypothesized that models couldn't hide capabilities on tasks with easily verifiable answers against white-box fine-tuning. This cryptographic construction serves as a constructive counterexample.
Key Results
The authors locked a quantized, 672-weight ternary chemistry classifier inside a simplified 38-layer Gemma 4 host (and also verified a variant inside an unmodified Gemma 4 E4B architecture), comparing it against a standard "password-locked" model trained via gradient descent:
- Triggered vs. Benign Accuracy: On non-trigger inputs, the encrypted model behaves like random chance (50.6%). Given the secret trigger, it immediately jumps to 73.5% accuracy (matching the standalone quantized classifier).
- Fine-Tuning Resistance: Standard SFT elicited the trained password-locked baseline's hidden skill within 500 steps (jumping from 50.7% to 92.8%). The encrypted model stayed flat at 50.9%—statistically indistinguishable from a control model containing locked random noise (50.6%).
- Adversarial Defenses Fail: Latent Adversarial Training (LAT) only reached 52.9% on the encrypted model (vs. 91.7% on the baseline). Weight noising had no material effect.
- Trigger Search: Greedy Coordinate Gradient (GCG) search with a 16-bit trigger failed to beat random brute-force guessing, achieving 52.7% accuracy after ~20,000 queries.
Limitations and Future Work
This is a theoretical warning shot, not a turnkey exploit. First, the parameter overhead is massive: hiding a tiny 672-weight classifier required a compiled host with 2.07 billion dense parameters (roughly 95% consumed by the Keccak hashing circuits; an optimized full-strength SHA-3 version took 3.58 billion parameters across 110 layers). Furthermore, flattening 2D payload matrices into 1D host activations imposes a quadratic width penalty, severely limiting hidden model size.
Second, the circuit's presence is anomalous. Compiled weights have unusual sparsity and statistical distributions compared to naturally trained weights. Future work lies in anomaly detection to spot compiled circuits, alongside supply-chain defenses like cryptographic proof-of-training provenance—shifting AI security from simply asking "Can we elicit bad behavior?" to "Where did these weights actually come from?"
Summary updated