Skip to main content
Visualizing CIFAR-10 ViT hidden layers, revealing black-box query findings for deep learning analysis.

Editorial illustration for CIFAR-10 ViT Hidden Layers Found With 8193 Black-Box Queries

Researchers Extract ViT Hidden Layers via Black-Box Queries

CIFAR-10 ViT Hidden Layers Found With 8193 Black-Box Queries

4 min read

A team of researchers has found a way to pull the hidden internal structure out of a transformer's feed-forward network using nothing but the outputs it hands back, no access to weights, gradients, or activations required. The target is the FFN branch itself, the two-layer block with GELU or SiLU activations that sits inside every transformer layer and does a lot of the model's actual computational work. Rather than guessing at weights directly, the attack goes after curvature: feeding chosen inputs and measuring how the output bends in response, then using that second-order signal to reconstruct the rank-one directions baked into the network's hidden layer.

The method treats the problem as a decomposition puzzle, working out when those directions can be pinned down uniquely and how to do it with as few queries as possible. Tested against CIFAR-10 vision transformers trained independently of each other, the approach recovers those hidden directions with strong consistency across separate models, repeated attempts, and every transformer block in the stack. What follows is a look at just how few queries it takes, and how well the recovered structure holds up once someone tries to rebuild a working substitute from it.

On independently trained CIFAR-10 vision transformers, only 16 projected Hessians, corresponding to 8193 black-box queries, recover the hidden FFN directions with average absolute cosine alignment above 0.94, with 95.1 % of GELU and 91.9 % of SiLU directions exceeding 0.90 alignment. Recovery remains high across independently trained models, repeated extraction runs, and all transformer blocks.

Why this matters

An 8,193-query recovery rate with cosine alignment above 0.94 is not a rounding error, it's a working extraction attack against a model class most teams treat as black-box safe by default. If you're serving a vision transformer through an API, whether for content moderation, medical imaging, or an internal classifier, the assumption that hiding weights protects your architecture no longer holds once someone can query the FFN branch directly with chosen inputs. GELU and SiLU, the activations baked into nearly every modern transformer stack, turn out to leak second-order structure through their smoothness, the exact property that makes them differentiable and easy to train.

For founders licensing model access or researchers publishing benchmark checkpoints, this narrows the gap between "we don't expose weights" and "our model is protected." The fix isn't obvious yet, rate-limiting raw-output access or adding output noise are the first things worth testing. We'd want to see this repeated on larger architectures, like production-scale LLM FFN blocks, before treating it as a universal threat, but the CIFAR-10 result alone should get security teams rethinking what "black-box" actually means.

Common Questions Answered

What is the feed-forward network (FFN) branch in a transformer and why is it a security concern?

The FFN branch is a two-layer block with GELU or SiLU activations located inside every transformer layer that performs much of the model's computational work. Researchers have discovered it can be extracted through black-box queries, meaning attackers can recover its hidden internal structure without access to weights, gradients, or activations, making it a significant security vulnerability.

How many queries were needed to recover CIFAR-10 vision transformer FFN directions with high accuracy?

Only 8,193 black-box queries were required to recover the hidden FFN directions with an average absolute cosine alignment above 0.94. This extraction attack successfully recovered 95.1% of GELU directions and 91.9% of SiLU directions exceeding 0.90 alignment, demonstrating the vulnerability is consistent and practical.

What method did researchers use to extract the FFN structure instead of directly guessing weights?

Rather than attempting to recover weights directly, the attack targets curvature by feeding chosen inputs and analyzing the model's outputs using projected Hessians. This approach proved far more efficient, requiring only 16 projected Hessians to achieve the high-accuracy FFN recovery across independently trained models.

Why is this FFN extraction attack significant for API-served vision transformers?

Many teams assume that hiding model weights protects their transformer architecture when served through an API, but this research proves that assumption is no longer valid. If someone can query the FFN branch directly with chosen inputs, they can extract the hidden architecture regardless of whether weights are protected, compromising security for applications like content moderation, medical imaging, and internal classifiers.

Does the FFN extraction attack work consistently across different transformer models and training runs?

Yes, the recovery remains high across independently trained models, repeated extraction runs, and all transformer blocks, demonstrating that this vulnerability is not dependent on specific model instances or training procedures. This consistency indicates the attack represents a fundamental security weakness in the transformer architecture class itself.

LIVE07:54CIFAR-10 ViT Hidden Layers Found With 8193 Black-Box Queries