An analysis of attention mechanisms and its variance in transformer
Abstract
Transformer is a machine learning model based on attention mechanism, which is widely used. When the Transformer model was first proposed, it gradually developed many variants and was promoted and applied in many fields, becoming an important research part in the areas of deep learning. However, the critical attention mechanism of Transformers has issues such as square complexity that affect computational speed and data processing efficiency. In order to meet the needs of data processing and related computing, there have been endless efforts to improve the attention mechanism in Transformers in different work areas. This article mainly provides a brief overview of the recent research progress on the attention mechanism in Transformers. Select representative studies from several directions of attention improvement work to introduce, in order to explore the latest research trends in its improvement work and lay a foundation for pointing out potential research directions for future research work and further improving the performance of Transformers.
References
- Graves, A., & Graves, A. (2012). Long short-term memory. Supervised sequence labelling with recurrent neural networks, 37-45.
- Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., et al. (2017). Attention is all you need. Advances in neural information processing systems, 30, 1-8.
- Lin, T., Wang, Y., Liu, X., & Qiu, X. (2022). A survey of transformers. AI Open, 111-132.
- Guo, M. H., Xu, T. X., Liu, J. J., Liu, Z. N., Jiang, P. T., et al. (2022). Attention mechanisms in computer vision: A survey. Computational visual media, 8(3), 331-368.
- Khan, S., Naseer, M., Hayat, M., Zamir, S. W., Khan, F. S., & Shah, M. (2022). Transformers in vision: A survey. ACM computing surveys, 54(10s), 1-41.
- Katharopoulos, A., Vyas, A., Pappas, N., & Fleuret, F. (2020). Transformers are rnns: Fast autoregressive transformers with linear attention. In International conference on machine learning, 5156-5165.
- Choromanski, K., Likhosherstov, V., Dohan, D., Song, X., Gane, A., et al. (2020). Rethinking attention with performers. arXiv preprint arXiv:2009.14794.
- Schlag, I., Irie, K., & Schmidhuber, J. (2021). Linear transformers are secretly fast weight programmers. In International Conference on Machine Learning, 9355-9366.
- Guo, M. H., Liu, Z. N., Mu, T. J., & Hu, S. M. (2022). Beyond self-attention: External attention using two linear layers for visual tasks. IEEE Transactions on Pattern Analysis and Machine Intelligence, 45(5), 5436-5447.
- Tang, S., Zhang, J., Zhu, S., & Tan, P. (2022). Quadtree attention for vision transformers. arXiv preprint arXiv:2201.02767.
- Hua, W., Dai, Z., Liu, H., & Le, Q. (2022). Transformer quality in linear time. In International Conference on Machine Learning, 9099-9117.
- Zhai, S., Talbott, W., Srivastava, N., Huang, C., Goh, H., Zhang, R., & Susskind, J. (2021). An attention free transformer. arXiv preprint arXiv:2105.14103.
- Bertsch, A., Alon, U., Neubig, G., & Gormley, M. R. (2023). Unlimiformer: Long-range transformers with unlimited length input. arXiv preprint arXiv:2305.01625.
- Ding, J., Ma, S., Dong, L., Zhang, X., Huang, S., Wang, W., & Wei, F. (2023). Longnet: Scaling transformers to 1,000,000,000 tokens. arXiv preprint arXiv:2307.02486.
- Bulatov, A., Kuratov, Y., & Burtsev, M. S. (2023). Scaling Transformer to 1M tokens and beyond with RMT. arXiv preprint arXiv:2304.11062.
- Tian, R., Maynez, J., & Parikh, A. P. (2021). Shatter: An efficient transformer encoder with single-headed self-attention and relative sequence partitioning. arXiv preprint arXiv:2108.13032.
- Diaz-Arias, A., & Shin, D. (2023). ConvFormer: Parameter Reduction in Transformer Models for 3D Human Pose Estimation by Leveraging Dynamic Multi-Headed Convolutional Attention. arXiv preprint arXiv:2304.02147.
- Voita, E., Talbot, D., Moiseev, F., Sennrich, R., & Titov, I. (2019). Analyzing multi-head self-attention: Specialized heads do the heavy lifting, the rest can be pruned. arXiv preprint arXiv:1905.09418.
- Guo, Q., Qiu, X., Xue, X., & Zhang, Z. (2019). Low-rank and locality constrained self-attention for sequence modeling. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 27(12), 2213-2222.
- Winata, G. I., Cahyawijaya, S., Lin, Z., Liu, Z., & Fung, P. (2020). Lightweight and efficient end-to-end speech recognition using low-rank transformer. In IEEE International Conference on Acoustics, Speech and Signal Processing, 6144-6148.
- Fan, X., Liu, Z., Lian, J., Zhao, W. X., Xie, X., & Wen, J. R. (2021). Lighter and better: low-rank decomposed self-attention networks for next-item recommendation. In Proceedings of the 44th international ACM SIGIR conference on research and development in information retrieval, 1733-1737.
- Gupta, A., Yuan, Y., Zhou, Y., & Mendis, C. (2023). FLuRKA: Fast fused Low-Rank & Kernel Attention. arXiv preprint arXiv:2306.15799.