English

Understanding Self-attention Mechanism via Dynamical System Perspective

Computer Vision and Pattern Recognition 2023-08-22 v1 Artificial Intelligence

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.

Keywords

Cite

@article{arxiv.2308.09939,
  title  = {Understanding Self-attention Mechanism via Dynamical System Perspective},
  author = {Zhongzhan Huang and Mingfu Liang and Jinghui Qin and Shanshan Zhong and Liang Lin},
  journal= {arXiv preprint arXiv:2308.09939},
  year   = {2023}
}

Comments

Accepted by ICCV 2023

R2 v1 2026-06-28T11:59:18.651Z