Structured Transformer Circuits Pruning

Zhu Liao, Van-Tam Nguyen, Enzo TartaglioneOpenReview 2026 · Submission to ICLR 2026 · Rejected

TL;DR

Structured Transformer Circuits Pruning (STCP) is a new, model-agnostic framework that prunes entire sub-layers (attention or feed-forward blocks) from Transformers in a single fine-tuning pass. By using learnable binary gates injected with Gaussian noise, it identifies and removes redundant "circuits," reducing model complexity by up to a third with negligible impact on accuracy.

What Problem Does This Paper Address?

Transformer models like ViT and BERT have revolutionized AI, but they are notoriously "over-parameterized"—they contain far more depth and parameters than necessary for many specific tasks. This leads to massive compute overhead and high memory usage.

While many pruning methods exist, they often suffer from three main issues:

  1. Inefficiency: They require multiple "prune-and-retrain" cycles.
  2. Limited Speedup: Pruning individual weights or attention heads often doesn't actually speed up inference on modern hardware because the underlying layer operations remain intact.
  3. Architecture Specificity: Many methods are tailored to specific models and don't generalize well.

The authors argue that to get real-world speedups, we need to remove entire sub-layers (the Multi-Head Self-Attention or MLP blocks) rather than just a few weights. However, naively dropping these blocks usually causes model performance to collapse.

Methods

STCP introduces a binary gating mechanism attached to every MHSA and MLP sub-layer.

  • The Gate: Each sub-layer $f(x)$ is multiplied by a mask $m$. If $m=1$, the layer stays; if $m=0$, it’s gone.
  • Learnable Sparsity: The mask is determined by a learnable scalar $g$ and a noise term $\epsilon$: $m = \mathbb{1}[g + \epsilon \geq 0]$.
  • Noise Injection: During training, standard normal Gaussian noise is added to the gates. This is the "secret sauce"—it allows the gates to "flicker" between on and off states, helping the optimizer escape local minima and discover which layers are truly dispensable.
  • $L_1$ Regularization: An $L_1$ penalty is applied to the gate parameters, biasing the model toward turning gates off unless the sub-layer is essential for the task.
  • Single-Pass Ranking: After one fine-tuning pass, the gates are sorted by their learned values. The authors then prune sub-layers one by one, starting with the lowest gate values, until a pre-defined accuracy threshold is reached.

Crucially, because the Heaviside step function (used for the mask) isn't differentiable, the authors use a Straight-Through Estimator (STE) to allow gradients to flow back to the gate parameters.

Datasets

The authors validated STCP across a wide range of tasks and architectures:

  • Image Classification: CLIP and ViT-H14 tested on CIFAR-10, Tiny-ImageNet, ImageNet, Flowers-102, DTD, Aircraft, and VLCS.
  • NLP: BERT and RoBERTa tested on SST-2 and QNLI.
  • Large Language Models: Qwen2.5-0.5B tested on WikiText2.
  • Generalization: ResNet-18 (a CNN) on CIFAR-10 and CLIP on Pascal VOC2012 (segmentation).

Key Insights and Ideas

  • The "Circuit" Perspective: The paper treats the Transformer as a collection of computational "circuits." Pruning isn't just about saving space; it's about discovering the minimal subgraph required to perform a specific behavior.
  • Noise as an Explorer: The injection of noise is critical. Without it, gates tend to get stuck in their initial "on" state. The noise forces the model to learn to be robust even when certain sub-layers are intermittently missing.
  • Sub-layer Independence: Unlike some methods that prune entire blocks (MHSA + MLP), STCP treats them independently. Interestingly, the results show that "unimportant" sub-layers vary wildly between different models and tasks.
  • Quantization-Friendly: Pruned models remain highly compatible with post-training quantization (8-bit), suggesting that STCP removes redundancy without destroying the numerical stability of the remaining weights.

Key Results

STCP consistently outperformed standard weight-based and gradient-based pruning, as well as recent state-of-the-art methods like Shortened-Taylor.

  • Efficiency: On CIFAR-10, STCP removed 4 out of 24 sub-layers from CLIP while actually increasing accuracy by ~2%. For ViT-H14, it removed 16 out of 64 sub-layers with minimal loss.
  • NLP Performance: For BERT and RoBERTa, the method pruned 10-20% of blocks with less than a 0.5-point drop in accuracy.
  • Hardware Savings: In a test with CLIP on Flowers-102, pruning 4 sub-layers reduced GFLOPs from 36.6 to 30.5 and cut memory usage by about 54MB, all while maintaining high accuracy.
  • Generalization: The method successfully pruned 2 out of 8 residual blocks in a ResNet-18 with only a 1.3% accuracy drop, proving it isn't just for Transformers.

Limitations and Future Work

The primary limitation acknowledged by the authors is hyperparameter sensitivity. Parameters like the initial gate value and the $L_1$ regularization weight ($\lambda$) were chosen manually. While they performed ablation studies showing the method is "remarkably robust," finding the optimal settings currently requires some trial and error.

The authors suggest that future work could involve developing automated heuristics for selecting these hyperparameters, which would make the framework truly "plug-and-play" for any new architecture. They also hope to integrate STCP with other compression strategies like knowledge distillation to push the boundaries of efficiency even further.

Summary updated

BibTeX
@misc{liao2026structured,
  author = {Zhu LIAO and Van-Tam Nguyen and Enzo Tartaglione},
  title = {{Structured Transformer Circuits Pruning}},
  year = {2026},
  url = {https://openreview.net/forum?id=Bq0CAUrMCC},
  howpublished = {OpenReview},
  note = {Submitted to ICLR 2026},
}
Figure