https://www.mdu.se/

mdu.sePublications
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf
Mechanistic Interpretability of Transformer MLPs Through Exact Soft‑Gate Decomposition
Mälardalen University, Faculty of Engineering and Health Sciences, Department of Computer Science & Engineering.
Mälardalen University, Faculty of Engineering and Health Sciences, Department of Computer Science & Engineering.ORCID iD: 0000-0003-3802-4721
Mälardalen University, Faculty of Engineering and Health Sciences, Department of Computer Science & Engineering.ORCID iD: 0000-0002-1212-7637
2026 (English)In: Transactions on Machine Learning Research, E-ISSN 2835-8856, article id 09/2006Article in journal (Refereed) Published
Abstract [en]

Transformer feed-forward (MLP) blocks perform nonlinear transformations, but their internal structure is often difficult to interpret using current methods. This paper presents anexact soft-gate decomposition that extracts the effective weight matrix for each MLP blockat varying inputs. This approach generalises exact piecewise-affine decomposition fromReLU networks to Gaussian Error Linear Unit (GELU) and Sigmoid Linear Unit (SiLU)activations, covering both standard and gated MLP architectures. Verification across fivemodels, including BERT-base, mBART-50, and GPT-2 Small for language tasks, ViT-basefor vision tasks, and the gated SiLU architecture TinyLlama-1.1B, confirms the accuracyof this method at floating-point arithmetic precision. The application of singular value decomposition to the effective weight matrix yields six structural metrics that characteriseeach block based on the dimensionality, intensity, and spectral concentration of its transformation. When applied to one model from each of three architectural configurations,BERT-base, mBART-50, and GPT-2 Small, alongside ablation as causal ground truth, thisanalysis indicates that MLP computation is organised differently across the models studied.Specifically, BERT-base’s blocks vary by transformation dimensionality, mBART-50’s blocksby transformation intensity, and GPT-2 Small’s blocks by intensity with negative ablationvalues in the later layers. These structural differences, revealed only through the exact effective weight matrix, explain why scalar importance measures often fail to generalise acrossthe models studied.

Place, publisher, year, edition, pages
2026. article id 09/2006
National Category
Engineering and Technology Computer Sciences
Identifiers
URN: urn:nbn:se:mdh:diva-79141OAI: oai:DiVA.org:mdh-79141DiVA, id: diva2:2107707
Note

Licensed under CC BY 4.0.

Available from: 2026-10-05 Created: 2026-10-05 Last updated: 2026-10-08Bibliographically approved
In thesis
1. Reasoning in Machine Learning through Mechanistic Interpretability
Open this publication in new window or tab >>Reasoning in Machine Learning through Mechanistic Interpretability
2026 (English)Doctoral thesis, comprehensive summary (Other academic)
Abstract [en]

Neural networks (NNs) achieve high prediction accuracy, but the internal reasoning through which they transform inputs into decisions remains hidden. Post-hoc explainability methods provide approximate explanations but do not reveal the actual computations a network performs. Mechanistic interpretability aims to address this by reverse-engineering the internal computations of NNs from their learned weights. However, different architectures operate through distinct computational primitives, and mechanistic interpretability methods that account for the specific computational structure of each architecture remain underdeveloped.

This thesis investigates how NNs reason by developing mechanistic interpretability methods that expose their internal decision-making processes. The work begins with multimodal reasoning, where a reasoning approach combining alignment and semi-supervised learning is introduced for prediction on unlabelled data. This is extended with transfer learning using a transformer model designed for continuous features. The thesis then addresses the deeper question of how NNs arrive at their decisions. Three mechanistic interpretability methods are developed. For feedforward networks with Rectified Linear Unit (ReLU) activations, ReLU Region Reasoning (Re3) derives exact per-sample affine mappings and identifies the exact input components that ReLU autoencoders discard during compression. For convolutional neural networks (CNNs), discriminative filters are identified through a dedicated method, and Pre-activation Decision Maps (PDM) visualise how the selected filters contribute to decisions. An exact soft-gate decomposition extends Re3 to transformer multi-layer perceptrons (MLPs) with Gaussian Error Linear Unit (GELU) and Sigmoid Linear Unit (SiLU) activations and extracts the effective weight matrix for each MLP block with zero approximation error.

The multimodal reasoning approaches are validated on vehicular telemetry and neurophysiological data and demonstrate effective prediction performance, with the transformer model outperforming traditional methods. Re3 replicates individual predictions exactly and provides deterministic feature attributions consistent with established methods. In autoencoders, Re3 extracts input directions that leave the latent representation exactly unchanged and reveals that the encoder compresses either near-linearly or through region-specific strategies, depending on the data. At the filter level, PDM outperforms established baseline methods. The soft-gate decomposition is verified on five transformer models, and its structural analysis indicates that MLP computation is organised differently across the models studied.

This thesis contributes reasoning approaches for effective prediction on unlabelled multimodal data and mechanistic interpretability methods that expose the actual computational mechanisms of feedforward networks, CNNs, and transformer architectures. Together, these contributions advance both the ability to reason over complex data and the understanding of how NNs reason internally.

Place, publisher, year, edition, pages
Västerås: Mälardalen University, 2026
Series
Mälardalen University Press Dissertations, ISSN 1651-4238 ; 477
National Category
Engineering and Technology
Research subject
Computer Science
Identifiers
urn:nbn:se:mdh:diva-79144 (URN)978-91-7485-774-0 (ISBN)
Public defence
2026-11-23, Delta, Mälardalens universitet, Västerås, 09:15 (English)
Opponent
Supervisors
Available from: 2026-10-06 Created: 2026-10-05 Last updated: 2026-11-02Bibliographically approved

Open Access in DiVA

fulltext(698 kB)43 downloads
File information
File name FULLTEXT01.pdfFile size 698 kBChecksum SHA-512
ff7083e339412b694f274a8af9cb2c5f000147bc7b62ef5f85b494639f7c028f7910d5297df027d64cd8eae424f662778ad88d975ce19cbbe2bd3ec776bc2324
Type fulltextMimetype application/pdf

Other links

https://openreview.net/pdf?id=20lTANRDAz

Authority records

Barua, ArnabAhmed, Mobyen UddinBegum, Shahina

Search in DiVA

By author/editor
Barua, ArnabAhmed, Mobyen UddinBegum, Shahina
By organisation
Department of Computer Science & Engineering
In the same journal
Transactions on Machine Learning Research
Engineering and TechnologyComputer Sciences

Search outside of DiVA

GoogleGoogle Scholar
Total: 43 downloads
The number of downloads is the sum of all downloads of full texts. It may include eg previous versions that are now no longer available

urn-nbn

Altmetric score

urn-nbn
Total: 31964 hits
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf