Reproduce “SMYRF: Efficient Attention using Asymmetric Clustering” on OpenResearch
Turn your favorite coding agents into research agents that review literature, develop hypotheses, and run experiments.
Universal app for Apple silicon and Intel. Requires macOS 11 or later.
About this paper
Giannis Daras, Nikita Kitaev, Augustus Odena, Alexandros G. Dimakis
SMYRF introduces an efficient attention mechanism for Transformer models, utilizing asymmetric clustering with Locality Sensitive Hashing to reduce computational and memory complexity from O(N^2) to O(N log N). This approach functions as a direct replacement for dense attention in pre-trained models, enabling attention at resolutions up to 256x256 in generative models and sometimes surpassing the performance of original dense attention models on NLP benchmarks.
Key insights
- Attention matrices in real-world pre-trained models are often sparse and near low-rank, suggesting significant redundancy in the O(N^2) computations of dense attention.
- The Attention Biclustering problem, which involves optimally partitioning queries and keys to form a block-diagonal attention matrix, is theoretically proven to be NP-hard, necessitating efficient approximation algorithms.
- Novel asymmetric LSH transformations are crucial for effectively approximating attention because they allow the LSH to work reliably even when query and key vectors have different representations and arbitrary norms.
Summary by alphaXiv.
Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.