MonarchAttention: Zero-Shot Conversion to Fast, Hardware-Aware Structured Attention

Neural Information Processing Systems 

Transformers have achieved state-of-the-art performance across various tasks, but suffer from a notable quadratic complexity in sequence length due to the attention mechanism. In this work, we propose MonarchAttention-a novel approach to sub-quadratic attention approximation via Monarch matrices, an expressive class of structured matrices. Based on the variational form of softmax, we describe an efficient optimization-based algorithm to compute an approximate projection of softmax attention onto the class of Monarch matrices with Θ(N Nd) computational complexity and Θ(Nd)memory/IO complexity.