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

一种面向知识密集型NLP任务的高效内存扩充Transformer

An Efficient Memory-Augmented Transformer for Knowledge-Intensive NLP Tasks

University College London(伦敦大学学院);Harbin Institute of Technology Shenzhen(哈尔滨工业大学(深圳));University of Edinburgh(爱丁堡大学)

Yuxiang Wu, Yu Zhao, Baotian Hu, Pasquale Minervini, Pontus Stenetorp, Sebastian Riedel

摘要:

对外部知识的访问对于许多自然语言处理任务(例如问答和对话)是必不可少的。现有的方法通常依赖于在其参数中存储知识的参数模型,或者使用可以访问外部知识源的检索增强模型。参数和检索增强模型在计算效率和预测准确性方面具有互补优势。为了结合这两种方法的优势,我们提出了高效内存增强的Transformer(EMAT)-它将外部知识编码到键值内存中,并利用快速最大内积搜索进行内存查询。我们还介绍了预训练任务,使EMAT编码信息的键值表示,并学习一个隐式的策略,将多个内存插槽到Transformer。在各种知识密集型任务(如问答和对话数据集)上的实验表明,使用我们的方法简单地增强参数模型(T5-base)会产生更准确的结果(例如,25.8- NQ上的44.3EM),同时保持高吞吐量(例如,1000查询/秒的NQ)。与检索增强模型相比,EMAT在WoW和ELI 5上运行速度更快,结果更准确。我们的代码和数据集可以在https://github上找到。com/uclnlp/EMAT。

英文摘要:

Access to external knowledge is essential for many natural language processing tasks, such as question answering and dialogue. Existing methods often rely on a parametric model that stores knowledge in its parameters, or use a retrieval-augmented model that has access to an external knowledge source. Parametric and retrieval-augmented models have complementary strengths in terms of computational efficiency and predictive accuracy. To combine the strength of both approaches, we propose the Efficient Memory-Augmented Transformer (EMAT) -- it encodes external knowledge into a key-value memory and exploits the fast maximum inner product search for memory querying. We also introduce pre-training tasks that allow EMAT to encode informative key-value representations, and to learn an implicit strategy to integrate multiple memory slots into the transformer. Experiments on various knowledge-intensive tasks such as question answering and dialogue datasets show that, simply augmenting parametric models (T5-base) using our method produces more accurate results (e.g., 25.8 -> 44.3 EM on NQ) while retaining a high throughput (e.g., 1000 queries/s on NQ). Compared to retrieval-augmented models, EMAT runs substantially faster across the board and produces more accurate results on WoW and ELI5. Our code and datasets are available at https://github. com/uclnlp/EMAT.

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

↑