The Information Pathways Hypothesis: Transformers are Dynamic Self-Ensembles
Md Shamim Hussain
Rensselaer Polytechnic Institute
Mohammed J. Zaki
Rensselaer Polytechnic Institute
Dharmashankar Subramanian
IBM T. J. Watson Research Center

Transformers use dense self-attention, allowing flexible all-to-all connectivity between input elements. This provides great expressive power but also quadratic computational cost. Over multiple layers, the number of possible connectivity patterns grows exponentially. However, we hypothesize that only a small subset of sparsely connected sub-networks within the transformer, called information pathways, are essential for good performance. In our paper, we provide a new perspective on transformers based on these information pathways and show how to leverage inherent sparsity for efficiency, especially during training.

Teaser Video

Overview

We put forward the "information pathways hypothesis" - the idea that transformers inherently contain many sparsely connected sub-networks or pathways. The full model can be seen as an ensemble of subsets of these pathways.

Based on this viewpoint, we develop a technique called Stochastically Subsampled Self-Attention (SSA) to sample pathways during training for efficiency (in terms of both memory and compute) and regularization. Surprisingly, we show that performing SSA during inference further boosts performance by forming model self-ensembles.

Method

The key innovations we propose are:

Experiments

We demonstrate the effectiveness of our proposals through extensive experiments on language modeling, image classification and graph regression tasks. Our results exhibit 4-8x reduced self-attention cost and improved generalization with SSA. Self-ensembling can further improve generalization during inference.

Conclusion

Our paper provides a new perspective on viewing transformers as dynamic ensembles of information pathways. This viewpoint has important theoretical and practical implications:

We are excited about future work that can build on the perspectives and techniques proposed in our paper.

Citation

@article{hussain2022information,
 title={The Information Pathways Hypothesis: Transformers are Dynamic Self-Ensembles},
 author={Hussain, Md Shamim and Zaki, Mohammed J and Subramanian, Dharmashankar},
 journal={arXiv preprint arXiv:2306.01705},
 year={2023}
}

Acknowledgement

This work was supported by the Rensselaer-IBM AI Research Collaboration, part of the IBM AI Horizons Network.