Max-Margin Token Selection in Attention Mechanism
From MaRDI portal
Publication:6441282
arXiv2306.13596MaRDI QIDQ6441282
Author name not available (Why is that?)
Publication date: 23 June 2023
Abstract: Attention mechanism is a central component of the transformer architecture which led to the phenomenal success of large language models. However, the theoretical principles underlying the attention mechanism are poorly understood, especially its nonconvex optimization dynamics. In this work, we explore the seminal softmax-attention model , where is the token sequence and are trainable parameters. We prove that running gradient descent on , or equivalently , converges in direction to a max-margin solution that separates tokens from non-optimal ones. This clearly formalizes attention as an optimal token selection mechanism. Remarkably, our results are applicable to general data and precisely characterize of tokens in terms of the value embeddings and problem geometry. We also provide a broader regularization path analysis that establishes the margin maximizing nature of attention even for nonlinear prediction heads. When optimizing and simultaneously with logistic loss, we identify conditions under which the regularization paths directionally converge to their respective hard-margin SVM solutions where separates the input features based on their labels. Interestingly, the SVM formulation of is influenced by the support vector geometry of . Finally, we verify our theoretical findings via numerical experiments and provide insights.
Has companion code repository: https://github.com/ucr-optml/max_margin_attention
This page was built for publication: Max-Margin Token Selection in Attention Mechanism
Report a bug (only for logged in users!)Click here to report a bug for this page (MaRDI item Q6441282)