arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2105.14068cs.IR
收藏

基于码字直方图的线性时间自注意高效推荐算法

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

摘要:

自注意由于其有效性,在从自然语言处理到推荐的各种序列建模任务中变得越来越流行。然而,自注意具有二次计算和存储复杂性,限制了其在长序列上的应用。解决这个问题的现有方法主要依赖于稀疏注意上下文,或者使用本地窗口,或者通过局部敏感哈希(LSH)或排序获得的置换桶,而关键信息可能会丢失。受矢量量化思想的启发,提出了一种LISA(LNear-time Self Attention)算法,该算法既具有自注意的有效性,又具有稀疏注意的高效性。LISA随序列长度线性缩放,同时通过计算码字分布的可微分直方图来实现完全的上下文注意力。同时,与一些有效的注意力方法不同,我们的方法对偶然掩蔽或序列长度没有限制。我们评估我们的方法在四个现实世界的数据集顺序推荐。结果表明,LISA在性能和速度方面都优于最先进的高效注意力方法;它比香草自我注意力快57倍,内存效率高78倍。

英文摘要:

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 locality-sensitive 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 self-attention 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-of-the-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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑