Skip to content
AI Security Wire

Published

- 5 min read

By

Weight2Shell: Same LLM Weights, Different Behavior on Mac and A100

img of Weight2Shell: Same LLM Weights, Different Behavior on Mac and A100

On November 25, 2026, CertiK’s research team published Weight2Shell, which it presented at SDC 2026, a demonstration that two machines can load byte-identical model weights and still get different behavior. In their demo, with the model served from an M5 Max Mac, the greeting “hello Mr Andersen” typed into the Codex client made a Mac open Calculator. The same greeting sent to a remote NVIDIA A100 got a polite reply and no tool call. Both endpoints had the same SHA-256 digest for the weights file. Everything below comes from CertiK’s post unless noted.

How the split works

Language models compute in floating point, and different backends handle the edge cases differently. CertiK asked whether a discrepancy between two floating-point implementations could change a security decision. To find a reproducible case, it tested operations from the model on both devices. One was bfloat16 subnormals, the tiny nonzero values near zero. When they doubled 4,096 values of plus or minus 2^-130 on each device, the Mac’s PyTorch MPS backend returned zero for all of them. The A100’s CUDA backend matched the CPU reference for all of them.

The researchers then built that difference into a model. In Qwen2.5-14B-Instruct they chose 64 channels in one feed-forward layer (layer 37 of 48) and set their gate weights to sparse values of plus or minus 2^-133. On the test prompt, the gate outputs were zero for all 2,880 recorded values on the Mac. On the A100, 2,312 of 2,880 (80.3%) survived as nonzero subnormals. Training on the A100 then taught the paired up and down projections to turn those faint activations into a behavior shift. On the probe prompt, the same branch contributed nothing on the Mac. CertiK stresses that the 80.3% figure describes one prompt.

CertiK is explicit that the model contains no device-name check. The “trigger” is the numerical environment. In the 14B run, only 16 of the 5,120 weights in each of the 64 gate rows were nonzero, which kept the gate values inside the subnormal range (an estimated 2.48 x 10^-40). The learned output columns were scaled up by 2^126 during training so that a tiny surviving activation could still move the model.

What they got it to do

Refusals. A refusal-phrase check on the first 200 characters of each reply flagged all 20 evaluation replies from the unmodified 14B model on both machines. With the trained checkpoint, it flagged 20 of 20 replies on the Mac and 0 of 20 on the A100. In other words, the Mac version kept refusing while the A100 version stopped. CertiK used this evaluation set during development, though none of the 20 appeared verbatim among its 28 training requests. On 18 further requests, it flagged 17 on the Mac and none on the A100. Zeroing just the 64 output columns on the A100 made the detector flag all five requests tested. CertiK notes the counts measure refusal language, not whether a reply actually fulfilled the request.

Tool calls. In a second experiment with Qwen2.5-7B-Instruct, the team first fine-tuned the model with LoRA to request open -a calculator on the greeting “hello Mr Andersen”, then trained the gate to suppress that request on the A100. Using PyTorch, all five trigger prompts produced a tool-call marker on the Mac and none on the A100. Those five prompts came from the suppression training set, so they were not held out. The near-match “hello Mr Anderson” and ordinary controls produced no tool calls on either.

The end-to-end test used real serving engines: MLX-LM on the Mac and vLLM on the A100, feeding Codex with the same command permissions. The Mac run executed the command with exit code 0 and Calculator appeared in the process list. The A100 run replied “Hello! How can I assist you today, Mr. Andersen?” CertiK says it recorded gate values only in PyTorch, so the exact operation responsible in each serving engine is unknown.

What this does and does not show

This is a lab construction, not an incident. The researchers trained the backdoor themselves, on two models and two hardware families, with a deliberately chosen trigger. CertiK’s post does not report use in the wild, and as of December 2, 2026, we found no such report in the source we opened. The post also does not claim that ordinary models drift this way by accident. Whether the split persists on a new request still needs a behavioral test, and CertiK says its calibration covers only the inputs it sampled.

The lesson is about the review process, and it is CertiK’s own conclusion. It notes that most security reviews assume two machines loading the same weights get the same model, and that a matching hash only shows the same weights were tested. A Mac-only review of the 14B checkpoint would have missed the change in refusal behavior on the A100, and an A100 reviewer would have seen only a polite greeting on a prompt that makes the Mac deployment open Calculator.

This is a single-vendor post. As of December 2, 2026, we found no independent replication in the source we opened, and the post links no code or checkpoint.

Defensive guidance

CertiK’s recommendations for anyone deploying third-party or fine-tuned open-weight models, especially behind agents with tool access:

  1. Audit the final checkpoint on the environment that will serve it, with the same hardware, inference engine, backend and numerical precision.
  2. For agents, test the serving adapter and tool permissions together with the model, and compare the model’s generated tool requests against the client’s execution log.
  3. Repeat those checks whenever the inference stack changes.

Two additions are our own suggestions, not CertiK’s. Treat engine and driver upgrades as stack changes that trigger a re-audit, and record which runtime and hardware produced each evaluation result, so a finding can be reproduced on the production stack. And keep tool permissions narrow, so that a model which does misbehave on one backend can do limited harm.

References

Frequently Asked Questions

What is Weight2Shell?
Weight2Shell is a CertiK research demonstration, presented at SDC 2026, in which one set of model weights behaves differently depending on the hardware and inference stack that runs it. CertiK trained a small group of neurons that only contribute on one backend, so a model can look benign in review and misbehave in deployment.
Does the model detect which device it is running on?
No. CertiK says the forward pass contains no device check. The effect comes from 64 feed-forward channels whose fixed gate weights are so small that, on the Mac backend CertiK tested, the gate output rounds to zero, while on the NVIDIA A100 it survives as a tiny nonzero value.
Would comparing file hashes catch it?
No. In CertiK's 7B demo, the model files on both machines had the same SHA-256 digest. A matching hash shows that the same weights were tested. It does not show that they behave the same on a different chip, backend or inference engine.
What should teams that self-host open-weight models do?
CertiK recommends auditing the final checkpoint on the exact serving stack: hardware, inference engine, backend and numerical precision. For agents, test the serving adapter and tool permissions together, compare the model's tool requests against the client's execution log, and repeat the checks whenever the stack changes.