You are required to read and agree to the below before accessing a full-text version of an article in the IDE article repository.

The full-text document you are about to access is subject to national and international copyright laws. In most cases (but not necessarily all) the consequence is that personal use is allowed given that the copyright owner is duly acknowledged and respected. All other use (typically) require an explicit permission (often in writing) by the copyright owner.

For the reports in this repository we specifically note that

  • the use of articles under IEEE copyright is governed by the IEEE copyright policy (available at http://www.ieee.org/web/publications/rights/copyrightpolicy.html)
  • the use of articles under ACM copyright is governed by the ACM copyright policy (available at http://www.acm.org/pubs/copyright_policy/)
  • technical reports and other articles issued by M‰lardalen University is free for personal use. For other use, the explicit consent of the authors is required
  • in other cases, please contact the copyright owner for detailed information

By accepting I agree to acknowledge and respect the rights of the copyright owner of the document I am about to access.

If you are in doubt, feel free to contact webmaster@ide.mdh.se

Mechanistic Interpretability of Transformer MLPs Through Exact Soft‑Gate Decomposition

Publication Type:

Journal article

Venue:

Transactions on Machine Learning Research


Abstract

Transformer feed-forward (MLP) blocks perform nonlinear transformations, but their internal structure is often difficult to interpret using current methods. This paper presents an exact soft-gate decomposition that extracts the effective weight matrix for each MLP block at varying inputs. This approach generalises exact piecewise-affine decomposition from ReLU networks to Gaussian Error Linear Unit (GELU) and Sigmoid Linear Unit (SiLU) activations, covering both standard and gated MLP architectures. Verification across five models, including BERT, mBART, and GPT-2 for language tasks, ViT for vision tasks, and the gated SiLU architecture TinyLlama, confirms the accuracy of this method at floating-point arithmetic precision. The application of singular value decomposition to the effective weight matrix yields six structural metrics that characterise each block based on the dimensionality, intensity, and spectral concentration of its transformation. When applied to BERT, mBART, and GPT-2, and alongside ablation studies that provide causal ground truth, this analysis indicates that MLP computation is organised differently across encoder-only, encoder-decoder, and decoder-only models. Specifically, BERT blocks vary by transformation dimensionality, mBART blocks by transformation intensity, and GPT-2 blocks by intensity, which shows detrimental excess in the later layers. These structural differences, revealed only through the exact effective weight matrix, explain why scalar importance measures often fail to generalise across different architectures

Bibtex

@article{Barua7463,
author = {Arnab Barua and Mobyen Uddin Ahmed and Shahina Begum},
title = {Mechanistic Interpretability of Transformer MLPs Through Exact Soft‑Gate Decomposition},
pages = {1--34},
month = {October},
year = {2026},
journal = {Transactions on Machine Learning Research},
url = {http://www.es.mdu.se/publications/7463-}
}