Linear-Time Self Attention with Codeword Histogram for Efficient Recommendation
Yongji Wu, Defu Lian, Neil Zhenqiang Gong, Lu Yin, Mingyang Yin, Jingren Zhou, Hongxia Yang
Abstract
Self-attention has become increasingly popular in a variety of sequence modeling tasks from natural language processing to recommendation, due to its effectiveness. However, self-attention suffers from quadratic computational and memory complexities, prohibiting its applications on long sequences. Existing approaches that address this issue mainly rely on a sparse attention context, either using a local window, or a permuted bucket obtained by localitysensitive hashing (LSH) or sorting, while crucial information may be lost. Inspired by the idea of vector quantization that uses cluster centroids to approximate items, we propose LISA (LInear-time Self Attention), which enjoys both the effectiveness of vanilla selfattention and the efficiency of sparse attention. LISA scales linearly with the sequence length, while enabling full contextual attention via computing differentiable histograms of codeword distributions. Meanwhile, unlike some efficient attention methods, our method poses no restriction on casual masking or sequence length. We evaluate our method on four real-world datasets for sequential recommendation. The results show that LISA outperforms the state-ofthe-art efficient attention methods in both performance and speed; and it is up to 57x faster and 78x more memory efficient than vanilla self-attention.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
4 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Big Bird: Transformers for Longer Sequences cites Reformer: The Efficient Transformer
- Cooperative Retriever and Ranker in Deep Recommenders cites Geography-Aware Sequential Location Recommendation
- Learning Vector-Quantized Item Representation for Transferable Sequential Recommenders cites Sparse Sinkhorn Attention
- Learning Vector-Quantized Item Representation for Transferable Sequential Recommenders cites Reformer: The Efficient Transformer
- Sparse Sinkhorn Attention cites Reformer: The Efficient Transformer
Cited by top-tier papers4
- Learning Vector-Quantized Item Representation for Transferable Sequential RecommendersYupeng Hou, Zhankui He, Julian J. McAuley, Wayne Xin ZhaoWWW 2023 · 256 citations
- Distill-VQ: Learning Retrieval Oriented Vector Quantization By Distilling Knowledge from Dense EmbeddingsShitao Xiao, Zheng Liu, Weihao Han, Jianjin Zhang et al.SIGIR 2022 · 31 citations
- Cooperative Retriever and Ranker in Deep RecommendersXu Huang, Defu Lian, Jin Chen, Zheng Liu et al.WWW 2023 · 17 citations
- Balanced Co-Clustering of Users and Items for Embedding Table Compression in Recommender SystemsRunhao Jiang, Renchi Yang, Donghao WuSIGIR 2026
Builds on10
- Big Bird: Transformers for Longer SequencesManzil Zaheer, Guru Guruganesh, Kumar Avinava Dubey, Joshua Ainslie et al.NeurIPS 2020 · 3,159 citations
- Reformer: The Efficient TransformerNikita Kitaev, Lukasz Kaiser, Anselm LevskayaICLR 2020 · 2,878 citations
- LayoutLM: Pre-training of Text and Layout for Document Image UnderstandingYiheng Xu, Minghao Li, Lei Cui, Shaohan Huang et al.KDD 2020 · 575 citations
- Sparse Sinkhorn AttentionYi Tay, Dara Bahri, Liu Yang, Donald Metzler et al.ICML 2020 · 391 citations
- Geography-Aware Sequential Location RecommendationDefu Lian, Yongji Wu, Yong Ge, Xing Xie et al.KDD 2020 · 244 citations
Related papers
- You Only Sample (Almost) Once: Linear Cost Self-Attention Via Bernoulli SamplingZhanpeng Zeng, Yunyang Xiong, Sathya N. Ravi, Shailesh Acharya et al.ICML 2021 · 22 citations
- Sparse Attention with Learning to HashZhiqing Sun, Yiming Yang, Shinjae YooICLR 2022 · 21 citations
- Overcoming Long Context Limitations of State Space Models via Context Dependent Sparse AttentionZhihao Zhan, Jianan Zhao, Zhaocheng Zhu, Jian TangNeurIPS 2025 · 7 citations
- Training-Free Hashing-Based Attention via Binary Principal ComponentsDaohai Yu, Zhanpeng Zeng, Keyu Chen, Wenhao Li et al.ICML 2026
- RACE Attention: A Strictly Linear-Time Attention for Long-Sequence TrainingSahil Joshi, Agniva Chowdhury, Amar Kanakamedala, Ekam Singh et al.ICLR 2026 · 2 citations
