New Attack Recovers Transformer FFN Parameters from Black-Box Access.

Munawar Hasan, Apostol Vassilev· September 1, 2026 View original

Key takeaways

  • Smooth Transformer FFNs are vulnerable to curvature cryptanalysis.
  • Hidden structural parameters can be extracted from black-box models.
  • The attack exploits second-order leakage from input Hessians.
  • High-fidelity functional substitutes can be created from recovered parameters.

Who benefits

CybersecurityAI/ML DevelopmentCloud ComputingFinanceDefense

Summary

This research demonstrates a novel "curvature cryptanalysis" attack that can extract hidden structural parameters of smooth two-layer feed-forward networks (FFNs) within Transformers, even with only black-box, chosen-input raw-output access. The attack exploits second-order leakage from input Hessians, achieving high-fidelity recovery with minimal queries and enabling functional replacement.

This paper unveils a significant security vulnerability in smooth two-layer feed-forward networks (FFNs) commonly found in Transformer architectures. The research introduces a "curvature cryptanalysis" method that allows for the extraction of hidden structural parameters from these FFNs, even under a black-box oracle model where only chosen inputs and raw outputs are accessible, without any knowledge of internal parameters or gradients. The attack exploits a second-order leakage channel: projected input Hessians form distinct mixtures of the same hidden symmetric rank-one factors induced by the FFN input weights. By formalizing Hessian collection as a partially symmetric decomposition, the researchers established conditions for local identifiability and stability. This allowed them to reduce the structural query cost significantly, by a factor of 16, through vector-output stencil reuse. On independently trained CIFAR-10 vision transformers, the method successfully recovered hidden FFN directions with high accuracy using only 16 projected Hessians (8193 black-box queries). This recovery remained robust across different models and blocks. Furthermore, the recovered structure facilitated functional extraction, enabling the creation of high-fidelity substitute models with over 93% top-1 agreement and minimal accuracy loss. While output rounding and Gaussian noise initially reduced recovery, adapting the finite-difference step restored high alignment, demonstrating a robust end-to-end path from black-box observations to internal parameter recovery and functional replacement.

Why it matters

For organizations deploying Transformer-based AI models, this research highlights a critical security vulnerability. It demonstrates that even with black-box access, internal model parameters can be extracted, posing risks to intellectual property, model integrity, and potentially enabling adversarial attacks or model theft.

How to implement this in your domain

  1. 1Assess the security posture of deployed Transformer models, especially those with smooth FFNs.
  2. 2Investigate methods to obfuscate or add noise to raw model outputs to mitigate curvature cryptanalysis.
  3. 3Consider the implications of model extraction attacks on intellectual property and competitive advantage.
  4. 4Develop strategies for continuous monitoring and defense against advanced model extraction techniques.

Original post by Munawar Hasan, Apostol Vassilev

"arXiv:2608.28843v1 Announce Type: new Abstract: We show that smooth two-layer feed-forward networks (FFNs) expose an additional structural model extraction channel under a chosen-input raw-output oracle at the FFN branch; consider transformer FFN branches with GELU or SiLU activa…"

View on X

Originally posted by Munawar Hasan, Apostol Vassilev on X · view source

Want to go deeper?

Turn these trends into skills with Learnijoy's hands-on AI & tech courses.

Explore courses