Large Memory Layers with Product Keys

Guillaume Lample, Alexandre Sablayrolles, Marc'Aurelio Ranzato, Ludovic Denoyer, Hervé Jégou
7/10/2019
cs.CLcs.LG

Official code: facebookresearch/XLM (2,922 stars, last commit 2023-02-14).

Abstract

This paper introduces a structured memory which can be easily integrated into a neural network. The memory is very large by design and significantly increases the capacity of the architecture, by up to a billion parameters with a negligible computational overhead. Its design and access pattern is based on product keys, which enable fast and exact nearest neighbor search. The ability to increase the number of parameters while keeping the same computational budget lets the overall system strike a better trade-off between prediction accuracy and computation efficiency both at training and test time. This memory layer allows us to tackle very large scale language modeling tasks. In our experiments we consider a dataset with up to 30 billion words, and we plug our memory layer in a state-of-the-art transformer-based architecture. In particular, we found that a memory augmented model with only 12 layers outperforms a baseline transformer model with 24 layers, while being twice faster at inference time. We release our code for reproducibility purposes.

View on arXivView PDF

Code Implementations(1)

PyTorch original implementation of Cross-lingual Language Model Pretraining.

2,922498Perl, ShellFeb 2, 20193 years agoNOASSERTION

Similar Papers

Cite this paper

@article{lample2019large,
  title  = {Large Memory Layers with Product Keys},
  author = {Guillaume Lample and Alexandre Sablayrolles and Marc'Aurelio Ranzato and Ludovic Denoyer and Hervé Jégou},
  year   = {2019},
  eprint = {1907.05242},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1907.05242}
}

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

Discussion