TL;DR: We use specialized structured matrices instead of low rank ones to compute the attention scores. This helps improve two shortcomings of standard attention for certain tasks.
Abstract: The core component of attention is the scoring function, which transforms the inputs into low-dimensional queries and keys and takes the dot product of each pair. While the low-dimensional projection improves efficiency, it causes information loss for certain tasks that have intrinsically high-dimensional inputs. Additionally, attention uses the same scoring function for all input pairs, without imposing a distance-dependent compute bias for neighboring tokens in the sequence. In this work, we address these shortcomings by proposing new scoring functions based on computationally efficient structured matrices with high ranks, including Block Tensor-Train (BTT) and Multi-Level Low Rank (MLR) matrices. On in-context regression tasks with high-dimensional inputs, our proposed scoring functions outperform standard attention for any fixed compute budget. On language modeling, a task that exhibits locality patterns, our MLR-based attention method achieves improved scaling laws compared to both standard attention and variants of sliding window attention.
Additionally, we show that both BTT and MLR fall under a broader family of efficient structured matrices capable of encoding either full-rank or distance-dependent compute biases, thereby addressing significant shortcomings of standard attention.
Lay Summary: Modern AI models rely heavily on a technique called attention, which helps them focus on the most relevant parts of the input. This paper points out that the current way attention works can be inefficient and sometimes not expressive enough to handle complex data. To improve this, we introduce smarter attention methods using mathematical tools called Block Tensor-Train (BTT) and Multi-Level Low Rank (MLR) matrices. We show that these new methods work better on tasks like predicting numbers from data (linear regression) and understanding language.
Link To Code: https://github.com/YilunKuang/structured-attention
Primary Area: Deep Learning->Attention Mechanisms
Keywords: Attention, Inductive Biases, Low Rank Bottleneck, Locality Bias, Hierarchical Matrices, Structured Matrices, Language Modeling, In-Context Regression
Flagged For Ethics Review: true
Submission Number: 809
Loading