Cybersecurity researchers have disclosed particulars of a way known as Weight2Shell that causes two machines operating the identical synthetic intelligence (AI) mannequin and loading an identical weights to provide totally different habits.
The demonstration, detailed by CertiK, goals to subvert the idea that two methods loading the identical weights get the identical mannequin.
The Web3 safety providers supplier revealed that getting into the identical immediate (“good day Mr Andersen”) into an Alibaba Qwen mannequin elicited two totally different outcomes on two methods: on a neighborhood MacBook, it triggered a software name, resulting in the launch of the Calculator app, whereas on a cloud server powered by an NVIDIA A100 GPU, it generated the anticipated “Hi there! How can I help you right now, Mr. Andersen” response.
The distinction in habits has been attributed to tiny discrepancies that manifest between two floating-point implementations. This, in flip, stems from the truth that {hardware} and software program implementations do not all the time deal with subnormal values in floating-point arithmetic the identical means.
Particularly, CertiK discovered that operating the mathematical operation 2^-130 * 2 (i.e., doubling a subnormal quantity) yielded zero on an Apple Mac, whereas producing 2^-129 on the cloud server.
This tiny numerical distinction can result in a lack of info when a price turns into zero, and probably change the mannequin’s reply. It is price mentioning right here that BF16, or Mind Floating Level, is a floating-point format developed for dealing with machine studying workloads.
A big language mannequin (LLM) is constructed by stacking a number of transformer layers on high of one another, the place every layer incorporates a gated multi-layer perceptron (gated MLP or gMLP) to refine its understanding of context and that means earlier than predicting the following token, whereas permitting it to dynamically activate or off particular filters, comparable to activating coding information upon encountering Python syntax or fully disabling it for a inventive writing immediate.
Given {that a} gate controls info movement, helps the mannequin “perceive” advanced patterns, and shapes remaining outputs, a really tiny gate worth produced by the activation operate (e.g., SiLU) can set off totally different habits –
- On a Mac, that worth turns into zero
- On the cloud server, that worth survives (i.e., the neuron stays energetic)
In different phrases, the variations within the {hardware} implementation trigger the 2 machines to course of totally different indicators even when they’ve loaded an identical weights.
The core thought behind Weight2Shell is to coach an surroundings gate whose “contribution” is dictated by the inference surroundings, on account of which loading the identical checkpoint may exhibit totally different habits, together with making the mannequin reply to requests it might usually refuse and selectively permit an agent to run a software name on a Mac whereas suppressing it on NVIDIA.
By successfully manipulating the mannequin’s decision-making course of, the strategy tips it into asking an agent to execute a command. This will have severe penalties if the agent in query has the permission to execute the requested software.
“Floating-point variations between {hardware} and inference stacks can act as backdoor triggers in massive language fashions,” CertiK stated. “The identical checkpoint served to Codex replied with a well mannered greeting on an NVIDIA A100 and made Codex open Calculator on an Apple Silicon Mac.”
“For anybody evaluating third-party weights, that hole creates a supply-chain threat. A provider can prepare a backdoor that stays dormant within the overview surroundings and turns into energetic in deployment. An identical file hash establishes solely that the identical weights have been examined.”
CertiK recommends that organizations audit fashions within the actual surroundings the place they may run to keep away from such discrepancies. It is suggested to run behavioral audits on the deployment stack, take a look at brokers along with their serving adapter and gear permissions, examine generated software requests in opposition to the consumer’s execution log, and repeat these checks every time the inference stack modifications.











