# Cryptanalytic Extraction of Multilayer Transformers

> Source: <https://eprint.iacr.org/2026/3082>
> Published: 2026-11-27 16:35:27+00:00

**Key takeaway:** Layer decoupling recovers full projection weights of synthetic Transformers up to six layers by scaling inputs to expose a leading residual response, with query and arithmetic budgets polynomial in model dimensions.

We consider parameter recovery when continuous inputs after embedding lookup can be freely chosen and the final residual states can be observed at high precision. We give a recovery algorithm for bias-free multilayer Transformers with random weights, pre-RMSNorm, causal multi-head softmax attention with known rotary positional embeddings, and SwiGLU feed-forward blocks. To the best of our knowledge, this is the first cryptanalytic extraction method for this class of multilayer Transformers. Our central idea is layer decoupling: scaling the input exposes a leading residual response in which all components contribute to a sum evaluated on a common normalized input. The next-order response retains component interactions needed to reconstruct an equivalent network. Under the stated dimension and reconstruction conditions, our procedure recovers an equivalent network from exact response coefficients. Query and arithmetic budgets are polynomial in the model dimensions and coefficient-estimation counts. Experiments numerically recover the full projection weights of small synthetic Transformers with up to six layers.
