Papers › SMYRF - Efficient Attention using Asymmetric Clustering

SMYRF - Efficient Attention using Asymmetric Clustering

1 Dec 2020NeurIPS 2020 12archive 2025-07-28

Giannis Daras, Nikita Kitaev, Augustus Odena, Alexandros G. Dimakis

We propose a novel type of balanced clustering algorithm to approximate attention. Attention complexity is reduced from O(N²) to O(N logN), where N is the sequence length. Our algorithm, SMYRF, uses Locality Sensitive Hashing (LSH) in a novel way by defining new Asymmetric transformations and an adaptive scheme that produces balanced clusters. The biggest advantage of SMYRF is that it can be used as a drop-in replacement for dense attention layers without any retraining. On the contrary, prior fast attention methods impose constraints (e.g. tight queries and keys) and require re-training from scratch. We apply our method to pre-trained state-of-the-art Natural Language Processing and Computer Vision models and we report significant memory and speed benefits. Notably, SMYRF-BERT outperforms (slightly) BERT on GLUE, while using 50% less memory. We also show that SMYRF can be used interchangeably with dense attention before and after training. Finally, we use SMYRF to train GANs with attention in high resolutions. Using a single TPU, we train BigGAN on Celeba-HQ, with attention at resolution 128x128 and 256x256, capable of generating realistic human faces.

PaperPDFCode

Code

giannisdaras/smyrf officialmentioned in paperpytorchGPL-3.0 report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

Not run by Syntology. Nothing on this page verifies that the listed code works.

Tasks

Clustering

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

1x1 ConvolutionAdamAttentionAttention DropoutBERTBatch NormalizationBigGANConditional Batch NormalizationConvolutionDense ConnectionsDropoutEarly StoppingFeedforward NetworkGAN Hinge LossLayer NormalizationLinear LayerLinear Warmup With Linear DecayMulti-Head AttentionNon-Local BlockNon-Local OperationOff-Diagonal Orthogonal RegularizationProjection DiscriminatorReLUResidual BlockResidual ConnectionSAGANSoftmaxSpectral NormalizationTTURTruncation TrickWeight DecayWordPiece

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections