arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1912.00835cs.CLcs.LG
收藏

紧致多头自注意的低秩分解

Low Rank Factorization for Compact Multi-Head Self-Attention

Virginia Tech(弗吉尼亚理工大学);George Mason University(乔治梅森大学)

Sneha Mehta, Huzefa Rangwala, Naren Ramakrishnan

摘要:

从文本中进行有效的表示学习一直是自然语言处理和文本挖掘领域的研究热点。注意力机制一直处于学习语境句子表征的前沿。目前许多NLP任务的最先进方法使用大型预训练语言模型,如BERT,XLNet等用于学习表示。这些模型基于Transformer架构,该架构涉及由多头自注意和前馈网络组成的循环计算块。在很大程度上导致Transformer模型的计算复杂性的主要瓶颈之一是自注意层,这是计算昂贵和参数密集的。在这项工作中,我们引入了一种新的多头自注意力机制,在GRU上运行,被证明是计算成本更低,更有效的参数比自注意力机制提出的Transformers的文本分类任务。我们方法的效率主要源于两个优化; 1)我们使用亲和力矩阵的低秩矩阵分解来有效地获得多个注意力分布,而不是为每个头部提供单独的参数2)注意力分数通过查询全局上下文向量来获得,而不是密集查询句子中的所有单词。我们评估的任务,如情感分析从电影评论,预测业务评级的评论和分类新闻文章到主题的模型的性能。我们发现,所提出的方法匹配或优于一系列强基线,比可比的多头方法更参数有效。我们还进行了定性分析,以验证所提出的方法是可解释的,并捕捉上下文相关的词的重要性。

英文摘要:

Effective representation learning from text has been an active area of research in the fields of NLP and text mining. Attention mechanisms have been at the forefront in order to learn contextual sentence representations. Current state-of-the-art approaches for many NLP tasks use large pre-trained language models such as BERT, XLNet and so on for learning representations. These models are based on the Transformer architecture that involves recurrent blocks of computation consisting of multi-head self-attention and feedforward networks. One of the major bottlenecks largely contributing to the computational complexity of the Transformer models is the self-attention layer, that is both computationally expensive and parameter intensive. In this work, we introduce a novel multi-head self-attention mechanism operating on GRUs that is shown to be computationally cheaper and more parameter efficient than self-attention mechanism proposed in Transformers for text classification tasks. The efficiency of our approach mainly stems from two optimizations; 1) we use low-rank matrix factorization of the affinity matrix to efficiently get multiple attention distributions instead of having separate parameters for each head 2) attention scores are obtained by querying a global context vector instead of densely querying all the words in the sentence. We evaluate the performance of the proposed model on tasks such as sentiment analysis from movie reviews, predicting business ratings from reviews and classifying news articles into topics. We find that the proposed approach matches or outperforms a series of strong baselines and is more parameter efficient than comparable multi-head approaches. We also perform qualitative analyses to verify that the proposed approach is interpretable and captures context-dependent word importance.

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

↑