Papers
Topics
Authors
Recent
Search
2000 character limit reached

Randomized and Deterministic Attention Sparsification Algorithms for Over-parameterized Feature Dimension

Published 10 Apr 2023 in cs.DS and cs.LG | (2304.04397v1)

Abstract: LLMs have shown their power in different areas. Attention computation, as an important subroutine of LLMs, has also attracted interests in theory. Recently the static computation and dynamic maintenance of attention matrix has been studied by [Alman and Song 2023] and [Brand, Song and Zhou 2023] from both algorithmic perspective and hardness perspective. In this work, we consider the sparsification of the attention problem. We make one simplification which is the logit matrix is symmetric. Let nn denote the length of sentence, let dd denote the embedding dimension. Given a matrix XR<sup>n</sup>×dX \in \mathbb{R}<sup>{n</sup> \times d}, suppose dnd \gg n and $| X X<sup>\top</sup> |<em>{\infty} &lt; r$ with r(0,0.1)r \in (0,0.1), then we aim for finding YR<sup>n</sup>×mY \in \mathbb{R}<sup>{n</sup> \times m} (where mdm\ll d) such that \begin{align*} | D(Y){-1} \exp( Y Y\top ) - D(X){-1} \exp( X X\top) |{\infty} \leq O(r) \end{align*} We provide two results for this problem. \bullet Our first result is a randomized algorithm. It runs in O~(nnz(X)+n<sup>ω</sup>)\widetilde{O}(\mathrm{nnz}(X) + n<sup>{\omega}</sup> ) time, has 1δ1-\delta succeed probability, and chooses m=O(nlog(n/δ))m = O(n \log(n/\delta)). Here nnz(X)\mathrm{nnz}(X) denotes the number of non-zero entries in XX. We use ω\omega to denote the exponent of matrix multiplication. Currently ω2.373\omega \approx 2.373. \bullet Our second result is a deterministic algorithm. It runs in O~(mini[d]nnz(Xi)<sup>2,</sup>dn<sup>ω1</sup>+n<sup>ω+1)\widetilde{O}(\min{\sum_{i\in[d]}\mathrm{nnz}(X_i)<sup>2,</sup> dn<sup>{\omega-1}}</sup> + n<sup>{\omega+1}) time and chooses m=O(n)m = O(n). Here XiX_i denote the ii-th column of matrix XX. Our main findings have the following implication for applied LLMs task: for any super large feature dimension, we can reduce it down to the size nearly linear in length of sentence.

Citations (29)

Summary

No one has generated a summary of this paper yet.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Continue Learning

We haven't generated follow-up questions for this paper yet.