Self-Ablating Transformers: More Interpretability, Less Sparsity
Jeremias Ferrao, Luhan Mikaelson, Keenan Pepper, Natalia Perez-Campanero Antolin
TL;DR
The paper tackles the challenge of aligning interpretability with sparsity in transformers by introducing a self-ablation mechanism that enforces a $k$-winner-takes-all constraint during training, while keeping inference identical to standard transformers. By training on TinyStories with a GPT-Neo backbone and exploring local and global ablation variants, the authors show that self-ablation fosters more localized circuits and specialized neurons, with higher $L1$ activation norms indicating reduced global sparsity. These interpretability gains are supported by multiple analyses, including ACDC circuit pruning, sparse autoencoders, automated neuron explanations, and NeuronGraph metrics, while language modelling performance incurs only a modest perplexity cost. The work suggests that interpretability can emerge from structured, localized computation and specialization rather than simply reducing overall activity, offering a promising ante-hoc design principle for more transparent NLP models. The findings are supported by open-source code and point to future work on larger, linguistically diverse datasets and potential applications in model unlearning and safety.
Abstract
A growing intuition in machine learning suggests a link between sparsity and interpretability. We introduce a novel self-ablation mechanism to investigate this connection ante-hoc in the context of language transformers. Our approach dynamically enforces a k-winner-takes-all constraint, forcing the model to demonstrate selective activation across neuron and attention units. Unlike post-hoc methods that analyze already-trained models, our approach integrates interpretability directly into model training, promoting feature localization from inception. Training small models on the TinyStories dataset and employing interpretability tests, we find that self-ablation leads to more localized circuits, concentrated feature representations, and increased neuron specialization without compromising language modelling performance. Surprisingly, our method also decreased overall sparsity, indicating that self-ablation promotes specialization rather than widespread inactivity. This reveals a complex interplay between sparsity and interpretability, where decreased global sparsity can coexist with increased local specialization, leading to enhanced interpretability. To facilitate reproducibility, we make our code available at https://github.com/keenanpepper/self-ablating-transformers.
