Paper 2026/3107
Cryptanalytic Extraction on a Single Full Transformer Block with Arbitrary Precision
Abstract
Cryptanalytic model extraction aims to recover the hidden parameters of a neural network solely from black-box input--output queries. While recent attacks on Transformers recover isolated multi-head Attention layers, isolated bias-free GLU feed-forward networks (FFNs), or simplified blocks without normalization and skip connections, modern Transformer blocks couple dual pre-RMSNorm layers, residual connections, multi-head softmax Attention, and biased ReLU or SwiGLU FFNs. Under this coupling, every query passes through both normalizations and both sublayers simultaneously, preventing prior component-level reductions from applying directly, while existing rational pole-finding methods become unstable under low-precision arithmetic. In this paper, we present the first end-to-end cryptanalytic extraction attack on a complete single dual pre-RMSNorm residual Transformer block, handling both biased ReLU and bias-free SwiGLU FFNs through a single precision-agnostic pipeline. Our attack decouples the block in four stages: it first recovers the aggregate Attention value map from complete-block responses, next extracts the coupled FFN through a singleton forward bridge, then synthesizes Attention outputs via paired opposite-input inversion to recover all effective Attention heads without pole-finding, and finally refines the full block jointly on the low-rank head manifold. We evaluate the attack end to end across native FP64, FP32, FP16, and BF16 implementations on blocks scaling up to token dimension \(d=256\), \(H=8\) heads, and FFN width \(m=1024\) (over one million parameters). At this scale, extraction requires only \(0.26\text{--}0.47\) queries per parameter and achieves block relative \(L_2\) errors at each format's hardware rounding floor, at most \(2.20\times 10^{-15}\) in FP64, \(5.49\times 10^{-7}\) in FP32, \(1.07\times 10^{-3}\) in FP16, and \(8.16\times 10^{-3}\) in BF16.
Comments