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

Yuxiang Wu, Yu Zhao, Baotian Hu, Pasquale Minervini, Pontus Stenetorp +1 more
10/30/2022
cs.CLcs.AIcs.LG
transformer-attentionrag

Official code: uclnlp/EMAT (35 stars, Python, last commit 2022-12-05).

Abstract

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

uclnlp/EMATOfficial100%

Efficient Memory-Augmented Transformers

355Python, ShellOct 21, 20223 years ago

Similar Papers

Cite this paper

@article{wu2022efficient,
  title  = {An Efficient Memory-Augmented Transformer for Knowledge-Intensive NLP Tasks},
  author = {Yuxiang Wu and Yu Zhao and Baotian Hu and Pasquale Minervini and Pontus Stenetorp and Sebastian Riedel},
  year   = {2022},
  eprint = {2210.16773},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2210.16773}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2210.16773.svg)](https://codeofpaper.com/paper/2210.16773)

Discussion