# Cryptanalytic Extraction of a Single Full Transformer Block under Finite Precision

> Source: <https://eprint.iacr.org/2026/3107>
> Published: 2026-11-29 03:50:20+00:00

**Key takeaway:** A sequential decoupling attack recovers a full dual pre-RMSNorm Transformer block at 0.26–0.47 vector queries per parameter, reaching holdout relative L2 error of 8.16×10⁻³ in BF16 versus 2.20×10⁻¹⁵ in FP64.

Cryptanalytic model extraction seeks to recover a neural network's
hidden parameters from black-box input--output queries.
Prior Transformer attacks either target isolated layers without
normalization and skip connections, or require all-position outputs,
positional encodings, and extended-precision arithmetic.
Modern Transformer blocks, however, tightly couple dual pre-RMSNorm
layers, residual connections, multi-head softmax Attention, and
biased ReLU or SwiGLU feed-forward networks (FFNs) under last-token
outputs and finite-precision arithmetic.
We present an end-to-end, precision-agnostic extraction attack on a
complete dual pre-RMSNorm residual Transformer block, handling both
biased ReLU and bias-free SwiGLU FFNs using only bounded,
positional-encoding-free queries and strict last-token outputs.
Rather than relying on isolated sublayer access or numerically
fragile pole-finding, our attack decouples the block sequentially:
recovering the aggregate Attention map, extracting the coupled FFN,
reconstructing all effective Attention heads through a shared
backend, and jointly refining the full block.
We evaluate the same pipeline across native FP64, FP32, FP16, and
BF16 implementations up to $d=256$, $H=8$ heads, and $m=1024$
(over one million parameters).
At this scale, extraction uses $0.26\text{--}0.47$ vector queries
per parameter and achieves holdout relative $L_2$ errors of 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.
