Loki: Low-rank Keys for Efficient Sparse Attention
Prajwal Singhania, Siddharth Singh, Shwai He, Soheil Feizi, Abhinav, Bhatele

TL;DR
Loki introduces a low-rank approximation for self-attention in large language models, significantly reducing computational costs while maintaining performance by exploiting the low-dimensional structure of key vectors.
Contribution
The paper presents Loki, a novel sparse attention method that leverages low-rank key representations to improve efficiency in LLM inference.
Findings
Loki speeds up attention computation with less data movement.
Loki maintains model efficacy better than other approximation methods.
Key vectors in LLMs are low-dimensional across multiple datasets and models.
Abstract
Inference on large language models (LLMs) can be expensive in terms of the compute and memory costs involved, especially when long sequence lengths are used. In particular, the self-attention mechanism used in LLM inference contributes significantly to these costs, which has sparked an interest in approximating the self-attention computation to reduce such costs. In this work, we propose to approximate self-attention by focusing on the dimensionality of key vectors computed in the attention block. Our analysis reveals that key vectors lie in a significantly lower-dimensional space, consistently across several datasets and models. Exploiting this observation, we propose Loki, a novel sparse attention method that ranks and selects tokens in the KV-cache based on attention scores computed in low-dimensional space. Our evaluations show that Loki is able to speed up the attention computation…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
Taxonomy
TopicsEEG and Brain-Computer Interfaces · Speech and Audio Processing · Anomaly Detection Techniques and Applications
MethodsSPEED: Separable Pyramidal Pooling EncodEr-Decoder for Real-Time Monocular Depth Estimation on Low-Resource Settings
