Understanding Self-attention Mechanism via Dynamical System Perspective
Zhongzhan Huang, Mingfu Liang, Jinghui Qin, Shanshan Zhong, Liang Lin
Abstract
The self-attention mechanism (SAM) is widely used in various fields of artificial intelligence and has successfully boosted the performance of different models. However, current explanations of this mechanism are mainly based on intuitions and experiences, while there still lacks direct modeling for how the SAM helps performance. To mitigate this issue, in this paper, based on the dynamical system perspective of the residual neural network, we first show that the intrinsic stiffness phenomenon (SP) in the high-precision solution of ordinary differential equations (ODEs) also widely exists in high-performance neural networks (NN). Thus the ability of NN to measure SP at the feature level is necessary to obtain high performance and is an important factor in the difficulty of training NN. Similar to the adaptive step-size method which is effective in solving stiff ODEs, we show that the SAM is also a stiffness-aware step size adaptor that can enhance the model's representational ability to measure intrinsic SP by refining the estimation of stiffness information and generating adaptive attention values, which provides a new understanding about why and how the SAM can benefit the model performance. This novel perspective can also explain the lottery ticket hypothesis in SAM, design new quantitative metrics of representational ability, and inspire a new theoretic-inspired approach, StepNet. Extensive experiments on several popular benchmarks demonstrate that StepNet can extract fine-grained stiffness information and measure SP accurately, leading to significant improvements in various visual tasks.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Cited by top-tier papers7
- Mirror Gradient: Towards Robust Multimodal Recommender Systems via Exploring Flat Local MinimaShanshan Zhong, Zhongzhan Huang, Daifeng Li, Wushao Wen et al.WWW 2024 · 24 citations
- DVIB: Towards Robust Multimodal Recommender Systems via Variational Information Bottleneck DistillationWenkuan Zhao, Shanshan Zhong, Yifan Liu, Wushao Wen et al.WWW 2025 · 7 citations
- AttNS: Attention-Inspired Numerical Solving For Limited Data ScenariosZhongzhan Huang, Mingfu Liang, Shanshan Zhong, Liang LinICML 2024 · 6 citations
- Hierarchical Self-Attention: Generalizing Neural Attention Mechanics to Multi-Scale ProblemsSaeed Amizadeh, Sara Abdali, Yinheng Li, Kazuhito KoishidaNeurIPS 2025 · 2 citations
- Thermometer of Thoughts: Enhancing LLM's Exploration via Attention Temperature ModulationZhiyuan Yu, Shijian Xiao, Cam-Tu Nguyen, Zhangyue Yin et al.ACL 2026
Builds on15
- Swin Transformer: Hierarchical Vision Transformer using Shifted WindowsZe Liu, Yutong Lin, Yue Cao, Han Hu et al.ICCV 2021 · 31,683 citations
- MLP-Mixer: An all-MLP Architecture for VisionIlya O. Tolstikhin, Neil Houlsby, Alexander Kolesnikov, Lucas Beyer et al.NeurIPS 2021 · 3,862 citations
- CrossViT: Cross-Attention Multi-Scale Vision Transformer for Image ClassificationChun-Fu (Richard) Chen, Quanfu Fan, Rameswar PandaICCV 2021 · 2,072 citations
- MetaFormer is Actually What You Need for VisionWeihao Yu, Mi Luo, Pan Zhou, Chenyang Si et al.CVPR 2022 · 1,114 citations
- FcaNet: Frequency Channel Attention NetworksZequn Qin, Pengyi Zhang, Fei Wu, Xi LiICCV 2021 · 1,049 citations
Related papers
- Stiffness-aware neural network for learning Hamiltonian systemsSenwei Liang, Zhongzhan Huang, Hong ZhangICLR 2022 · 26 citations
- Memory-Friendly Scalable Super-Resolution via Rewinding Lottery Ticket HypothesisJin Lin, Xiaotong Luo, Ming Hong, Yanyun Qu et al.CVPR 2023
- Dynamical System Inspired Adaptive Time Stepping Controller for Residual Network FamiliesYibo Yang, Jianlong Wu, Hongyang Li, Xia Li et al.AAAI 2020 · 23 citations
- The Elastic Lottery Ticket HypothesisXiaohan Chen, Yu Cheng, Shuohang Wang, Zhe Gan et al.NeurIPS 2021 · 38 citations
- ResNet After All: Neural ODEs and Their Numerical SolutionKatharina Ott, Prateek Katiyar, Philipp Hennig, Michael TiemannICLR 2021 · 34 citations
