A Simplified Query-Only Attention for Encoder-Based Transformer Models
Source abstract
Abstract
Transformer models have revolutionized fields like Natural Language Processing (NLP) by enabling machines to accurately understand and generate human language. However, these models’ inherent complexity and limited interpretability pose barriers to their broader adoption. To address these challenges, we propose a simplified query-only attention mechanism specifically for encoder-based transformer models to reduce complexity and improve interpretability. Unlike conventional attention mechanisms, which rely on query (Q), key (K), and value (V) vectors, our method uses only the Q vector for attention calculation. This approach reduces computational complexity while maintaining the model’s ability to capture essential relationships, enhancing interpretability. We evaluated the proposed query-only attention on an EEG conformer model, a state-of-the-art architecture for EEG signal classification. We demonstrated that it performs comparably to the original QKV attention mechanism, while simplifying the model’s architecture. Our findings suggest that query-only attention offers a promising direction for the development of more efficient and interpretable transformer-based models, with potential applications across various domains beyond NLP.
Source: crossref · Quality: baseline
Research context
OpenAlex topics: Neural Networks and Applications · Neural Networks and Reservoir Computing · Reinforcement Learning in Robotics
SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.
Affiliations
Department of Electronics Engineering, Chosun University, 309 Pilmundae-ro, Dong-gu, Gwangju 61452, Republic of Korea
Interdisciplinary Program in IT-Bio Convergence System, Chosun University, Gwangju 61452, Republic of Korea
Centre for Human Brain Health, School of Psychology, University of Birmingham, Birmingham B15 2TT, UK
Funding
Ministry of Education
References (42)
Show source-provided references
1. Attention is all you need
2. Radford, A., Narasimhan, K., Salimans, T., and Sutskever, I. (2024, September 20). Improving Language Understanding by Generative Pre-Training. Available online: https://cdn.openai.com/research-covers/language-unsupervised/language_understanding_paper.pdf.
3. Language models are unsupervised multitask learners
4. Language models are few-shot learners
5. Achiam, J., Adler, S., Agarwal, S., Ahmad, L., Akkaya, I., Aleman, F.L., Almeida, D., Altenschmidt, J., Altman, S., and Anadkat, S. (2023). Gpt-4 technical report. arXiv.
6. Team, G., Anil, R., Borgeaud, S., Wu, Y., Alayrac, J.-B., Yu, J., Soricut, R., Schalkwyk, J., Dai, A.M., and Hauth, A. (2023). Gemini: A family of highly capable multimodal models. arXiv.
7. Reid, M., Savinov, N., Teplyashin, D., Lepikhin, D., Lillicrap, T., Alayrac, J.-b., Soricut, R., Lazaridou, A., Firat, O., and Schrittwieser, J. (2024). Gemini 1.5: Unlocking multimodal understanding across millions of tokens of context. arXiv.
8. Yin, S., Fu, C., Zhao, S., Li, K., Sun, X., Xu, T., and Chen, E. (2023). A survey on multimodal large language models. arXiv.
9. OpenAI (2024, September 20). Hello GPT-4o. Available online: https://openai.com/index/hello-gpt-4o.
10. Wang, Q., Li, B., Xiao, T., Zhu, J., Li, C., Wong, D.F., and Chao, L.S. (2019). Learning deep transformer models for machine translation. arXiv.10.18653/v1/P19-1176 ↗
11. Lewis, M., Liu, Y., Goyal, N., Ghazvininejad, M., Mohamed, A., Levy, O., Stoyanov, V., and Zettlemoyer, L. (2019). Bart: Denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension. arXiv.10.18653/v1/2020.acl-main.703 ↗
12. Cross-lingual language model pretraining
13. Exploring the limits of transfer learning with a unified text-to-text transformer
14. A comprehensive survey on applications of transformers for deep learning tasks10.1016/j.eswa.2023.122666 ↗
15. Liu, Y., and Lapata, M. (2019). Text summarization with pretrained encoders. arXiv.10.18653/v1/D19-1387 ↗
16. A survey of transformers10.1016/j.aiopen.2022.10.001 ↗
17. Wolf, T., Debut, L., Sanh, V., Chaumond, J., Delangue, C., Moi, A., Cistac, P., Rault, T., Louf, R., and Funtowicz, M. (2020, January 16–20). Transformers: State-of-the-art natural language processing. Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, Online.10.18653/v1/2020.emnlp-demos.6 ↗
18. Gulati, A., Qin, J., Chiu, C.-C., Parmar, N., Zhang, Y., Yu, J., Han, W., Wang, S., Zhang, Z., and Wu, Y. (2020). Conformer: Convolution-augmented transformer for speech recognition. arXiv.10.21437/Interspeech.2020-3015 ↗
19. Multimodal learning with transformers: A survey10.1109/TPAMI.2023.3275156 ↗
20. Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., and Gelly, S. (2020). An image is worth 16x16 words: Transformers for image recognition at scale. arXiv.
21. Attention mechanisms in computer vision: A survey10.1007/s41095-022-0271-y ↗
22. U-shape transformer for underwater image enhancement10.1109/TIP.2023.3276332 ↗
23. nnformer: Volumetric medical image segmentation via a 3d transformer10.1109/TIP.2023.3293771 ↗
24. Squeezeformer: An efficient transformer for automatic speech recognition
25. Li, Y., Lai, L., Shangguan, Y., Iandola, F.N., Ni, Z., Chang, E., Shi, Y., and Chandra, V. (2024, January 14–19). Folding Attention: Memory and Power Optimization for On-Device Transformer-based Streaming Speech Recognition. Proceedings of the ICASSP 2024-2024 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Seoul, Republic of Korea.10.1109/ICASSP48485.2024.10447827 ↗
26. EEG conformer: Convolutional transformer for EEG decoding and visualization10.1109/TNSRE.2022.3230250 ↗
27. Deep Learning in EEG-Based BCIs: A Comprehensive Review of Transformer Models, Advantages, Challenges, and Applications10.1109/ACCESS.2023.3329678 ↗
28. Jiang, W.-B., Zhao, L.-M., and Lu, B.-L. (2024, January 7–11). Large Brain Model for Learning Generic Representations with Tremendous EEG Data in BCI. Proceedings of the ICLR, Vienna, Austria.
29. D-FaST: Cognitive Signal Decoding with Disentangled Frequency-Spatial-Temporal Attention10.1109/TCDS.2024.3370261 ↗
30. Tangermann, M., Müller, K.-R., Aertsen, A., Birbaumer, N., Braun, C., Brunner, C., Leeb, R., Mehring, C., Miller, K.J., and Müller-Putz, G.R. (2012). Review of the BCI competition IV. Front. Neurosci., 6.10.3389/fnins.2012.00055 ↗
31. Kirillov, A., Mintun, E., Ravi, N., Mao, H., Rolland, C., Gustafson, L., Xiao, T., Whitehead, S., Berg, A.C., and Lo, W.-Y. (2023, January 2–6). Segment anything. Proceedings of the IEEE/CVF International Conference on Computer Vision, Paris, France.10.1109/ICCV51070.2023.00371 ↗
32. Peebles, W., and Xie, S. (2023, January 2–6). Scalable diffusion models with transformers. Proceedings of the IEEE/CVF International Conference on Computer Vision, Paris, France.10.1109/ICCV51070.2023.00387 ↗
33. Wang, W., Bao, H., Dong, L., Bjorck, J., Peng, Z., Liu, Q., Aggarwal, K., Mohammed, O.K., Singhal, S., and Som, S. (2023, January 17–24). Image as a foreign language: Beit pretraining for vision and vision-language tasks. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Vancouver, BC, Canada.10.1109/CVPR52729.2023.01838 ↗
34. A visual-language foundation model for computational pathology10.1038/s41591-024-02856-4 ↗
35. Ang, K.K., Chin, Z.Y., Wang, C., Guan, C., and Zhang, H. (2012). Filter bank common spatial pattern algorithm on BCI competition IV datasets 2a and 2b. Front. Neurosci., 6.10.3389/fnins.2012.00039 ↗
36. Deep learning with convolutional neural networks for EEG decoding and visualization10.1002/hbm.23730 ↗
37. EEGNet: A compact convolutional neural network for EEG-based brain–computer interfaces10.1088/1741-2552/aace8c ↗
38. Deep representation-based domain adaptation for nonstationary EEG classification10.1109/TNNLS.2020.3010780 ↗
39. Mastering the game of Go with deep neural networks and tree search10.1038/nature16961 ↗
40. Mastering the game of go without human knowledge10.1038/nature24270 ↗
41. A general reinforcement learning algorithm that masters chess, shogi, and Go through self-play10.1126/science.aar6404 ↗
42. Mastering atari, go, chess and shogi by planning with a learned model10.1038/s41586-020-03051-4 ↗