Efficient Attention using a Fixed-Size Memory Representation

Denny Britz, Melody Guan, Minh-Thang Luong


Abstract
The standard content-based attention mechanism typically used in sequence-to-sequence models is computationally expensive as it requires the comparison of large encoder and decoder states at each time step. In this work, we propose an alternative attention mechanism based on a fixed size memory representation that is more efficient. Our technique predicts a compact set of K attention contexts during encoding and lets the decoder compute an efficient lookup that does not need to consult the memory. We show that our approach performs on-par with the standard attention mechanism while yielding inference speedups of 20% for real-world translation tasks and more for tasks with longer sequences. By visualizing attention scores we demonstrate that our models learn distinct, meaningful alignments.
Anthology ID:
D17-1040
Volume:
Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing
Month:
September
Year:
2017
Address:
Copenhagen, Denmark
Editors:
Martha Palmer, Rebecca Hwa, Sebastian Riedel
Venue:
EMNLP
SIG:
SIGDAT
Publisher:
Association for Computational Linguistics
Note:
Pages:
392–400
Language:
URL:
https://aclanthology.org/D17-1040
DOI:
10.18653/v1/D17-1040
Bibkey:
Cite (ACL):
Denny Britz, Melody Guan, and Minh-Thang Luong. 2017. Efficient Attention using a Fixed-Size Memory Representation. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 392–400, Copenhagen, Denmark. Association for Computational Linguistics.
Cite (Informal):
Efficient Attention using a Fixed-Size Memory Representation (Britz et al., EMNLP 2017)
Copy Citation:
PDF:
https://aclanthology.org/D17-1040.pdf