The breakthrough addresses a long-standing vulnerability in machine learning security. Historically, cryptanalytic attacks against deep learning models have been restricted to isolated components. Past research successfully targeted isolated multi-head attention layers, isolated bias-free Gated Linear Unit (GLU) feed-forward networks, or heavily simplified blocks that lacked crucial architectural elements such as normalization layers and skip connections.
However, modern production-grade Transformer blocks are significantly more intricate. They tightly couple dual pre-RMSNorm layers, residual connections, multi-head softmax attention mechanisms, and biased Rectified Linear Unit (ReLU) or Swish-Gated Linear Unit (SwiGLU) feed-forward networks. Under this deeply coupled architecture, every single query passed into the network flows through both normalization steps and both major sublayers simultaneously. This complex interdependence previously prevented security researchers from applying component-level reductions directly. Furthermore, existing mathematical techniques designed to isolate parameters—such as rational pole-finding methods—tend to break down and become entirely unstable when exposed to the low-precision arithmetic commonly used in modern hardware implementations.
To overcome these severe theoretical and practical barriers, the Tsinghua University research team devised a precision-agnostic pipeline capable of handling both biased ReLU and bias-free SwiGLU feed-forward networks within a unified framework. Their newly developed attack strategy successfully decouples the tightly bound Transformer block by breaking the recovery process down into four distinct yet harmonious stages.
In the first stage, the attack successfully recovers the aggregate attention value map simply by observing the complete-block responses. Next, the pipeline extracts the coupled feed-forward network through what the researchers term a singleton forward bridge. The third stage synthesizes the attention outputs via a clever technique involving paired opposite-input inversion, which allows the algorithm to recover all effective attention heads without ever relying on unstable pole-finding algorithms. Finally, the attack refines the full block jointly on the low-rank head manifold, ensuring high-fidelity parameter recovery.
The research team put their novel extraction pipeline through rigorous empirical testing, evaluating it end-to-end across a wide variety of standard hardware numerical formats, including native Double Precision (FP64), Single Precision (FP32), Half Precision (FP16), and Brain Floating Point (BF16) implementations. The evaluations tested blocks scaling up to a token dimension of $d=256$, eight attention heads ($H=8$), and a feed-forward network width of $m=1024$, resulting in architectures comprising over one million hidden parameters.
The results demonstrate remarkable efficiency and precision. At this scale, the entire extraction process requires only 0.26 to 0.47 queries per parameter. Despite the black-box nature of the attack and the complex coupling of the Transformer block, the recovery achieved block relative $L_2$ errors right at the hardware rounding floor of each respective numerical format. Specifically, the relative error reached at most $2.20times 10^-15$ in FP64, $5.49times 10^-7$ in FP32, $1.07times 10^-3$ in FP16, and $8.16times 10^-3$ in BF16.
These findings carry significant implications for the security and intellectual property protection of large language models and other Transformer-based systems deployed in commercial and cloud environments. By proving that full, modern Transformer blocks with normalization, residual connections, and advanced activations can be systematically extracted with arbitrary precision using a remarkably low query budget, the research highlights the urgent need for robust defensive measures against advanced cryptanalytic model extraction threats.






