LaMemo: Language Modeling with Look-Ahead Memory

Haozhe Ji, Rongsheng Zhang, Zhenyu Yang, Zhipeng Hu, Minlie Huang
4/15/2022
cs.CL

Official code: thu-coai/LaMemo (5 stars, Python, MIT, last commit 2022-06-06).

Abstract

Although Transformers with fully connected self-attentions are powerful to model long-term dependencies, they are struggling to scale to long texts with thousands of words in language modeling. One of the solutions is to equip the model with a recurrence memory.

Show full abstract

However, existing approaches directly reuse hidden states from the previous segment that encodes contexts in a uni-directional way. As a result, this prohibits the memory to dynamically interact with the current context that provides up-to-date information for token prediction. To remedy this issue, we propose Look-Ahead Memory (LaMemo) that enhances the recurrence memory by incrementally attending to the right-side tokens, and interpolating with the old memory states to maintain long-term information in the history. LaMemo embraces bi-directional attention and segment recurrence with an additional computation overhead only linearly proportional to the memory length. Experiments on widely used language modeling benchmarks demonstrate its superiority over the baselines equipped with different types of memory.

View on arXivView PDF

Code Implementations(1)

thu-coai/LaMemoOfficial100%
MIT

NAACL2022 - LaMemo: Language Modeling with Look-Ahead Memory

51Python, ShellApr 14, 20224 years agoMIT

Similar Papers

Cite this paper

@article{ji2022lamemo,
  title  = {LaMemo: Language Modeling with Look-Ahead Memory},
  author = {Haozhe Ji and Rongsheng Zhang and Zhenyu Yang and Zhipeng Hu and Minlie Huang},
  year   = {2022},
  eprint = {2204.07341},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2204.07341}
}

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/2204.07341.svg)](https://codeofpaper.com/paper/2204.07341)

Discussion