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

一次即可:一种用于快速句子对建模的轻量级交叉注意力机制

Once is Enough: A Light-Weight Cross-Attention for Fast Sentence Pair Modeling

Harbin Institute of Technology(哈尔滨工业大学);Meta AI

Yuanhang Yang, Shiyi Qi, Chuanyi Liu, Qifan Wang, Cuiyun Gao, Zenglin Xu

AI总结:

本文提出轻量级交叉注意力范式MixEncoder,通过单次查询编码和并行交互建模,在保持性能的同时将句子对配对速度提升113倍以上。

摘要:

基于Transformer的模型在答案选择和自然语言推理(NLI)等句子对建模任务上取得了巨大成功。这些模型通常对输入对进行交叉注意力操作,导致计算成本过高。近期研究提出了双编码器和后期交互架构以加快计算。然而,交叉注意力的表达力与计算加速之间的平衡仍需更好地协调。为此,本文提出了一种新范式MixEncoder,用于高效的句子对建模。MixEncoder包含一种轻量级交叉注意力机制。它仅进行一次查询编码,同时并行建模查询与候选者的交互。在四个任务上的大量实验表明,MixEncoder能将句子对配对速度提升113倍以上,同时取得与更昂贵的交叉注意力模型相当的性能。

英文摘要:

Transformer-based models have achieved great success on sentence pair modeling tasks, such as answer selection and natural language inference (NLI). These models generally perform cross-attention over input pairs, leading to prohibitive computational costs. Recent studies propose dual-encoder and late interaction architectures for faster computation. However, the balance between the expressive of cross-attention and computation speedup still needs better coordinated. To this end, this paper introduces a novel paradigm MixEncoder for efficient sentence pair modeling. MixEncoder involves a light-weight cross-attention mechanism. It conducts query encoding only once while modeling the query-candidate interaction in parallel. Extensive experiments conducted on four tasks demonstrate that our MixEncoder can speed up sentence pairing by over 113x while achieving comparable performance as the more expensive cross-attention models.

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

↑