论文标题
用于知识密集型NLP任务的有效内存功能增强的变压器
An Efficient Memory-Augmented Transformer for Knowledge-Intensive NLP Tasks
论文作者
论文摘要
访问外部知识对于许多自然语言处理任务,例如问答和对话至关重要。现有方法通常依赖于将知识存储在其参数中的参数模型,或使用具有外部知识源的检索型模型。参数和检索的模型在计算效率和预测准确性方面具有互补的优势。为了结合两种方法的强度,我们提出了有效的内存功能增强变压器(EMAT) - 它将外部知识编码为键值内存,并利用快速最大的内部产品搜索以获取内存查询。我们还介绍了允许EMAT编码内容丰富的键值表示形式的预训练任务,并学习一种隐含的策略,以将多个内存插槽集成到变压器中。对各种知识密集型任务(例如问答和对话数据集)进行的实验表明,使用我们的方法增加参数模型(T5-base)会产生更准确的结果(例如,NQ上的25.8-> 44.3 EM),同时保留高吞吐量(例如,NQ上的1000个查询/s)。与检索型模型相比,EMAT在整个台上运行速度大大更快,并在WOW和ELI5上产生更准确的结果。我们的代码和数据集可从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.