Skip to main content
QUICK REVIEW

[Paper Review] Reformer: The Efficient Transformer

Nikita Kitaev, Łukasz Kaiser|arXiv (Cornell University)|Jan 13, 2020
Advanced Image and Video Retrieval TechniquesComputer Science18 references323 citations
TL;DR

The Reformer introduces reversible layers, chunked feed-forward, and locality-sensitive hashing attention to reduce memory and compute, achieving Transformer-like performance on long sequences with much better efficiency.

ABSTRACT

Large Transformer models routinely achieve state-of-the-art results on a number of tasks but training these models can be prohibitively costly, especially on long sequences. We introduce two techniques to improve the efficiency of Transformers. For one, we replace dot-product attention by one that uses locality-sensitive hashing, changing its complexity from O($L^2$) to O($L\log L$), where $L$ is the length of the sequence. Furthermore, we use reversible residual layers instead of the standard residuals, which allows storing activations only once in the training process instead of $N$ times, where $N$ is the number of layers. The resulting model, the Reformer, performs on par with Transformer models while being much more memory-efficient and much faster on long sequences.

Motivation & Objective

  • Motivate the high memory and compute costs of large Transformer models on long sequences.
  • Propose architecture and techniques to reduce memory and compute while preserving performance.
  • Empirically validate on long-sequence tasks and standard benchmarks to demonstrate efficiency gains.
  • Assess how shared-QK attention, reversible layers, and LSH attention affect training dynamics and accuracy.

Proposed method

  • Replace dot-product attention with locality-sensitive hashing (LSH) attention to reduce attention complexity from O(L^2) to O(L log L).
  • Use reversible residual layers to avoid storing activations for every layer, eliminating the N-fold memory growth with network depth.
  • Chunk feed-forward layers to reduce memory usage by processing activations in smaller blocks.
  • Adopt shared-QK attention to simplify projection paths and analyze its impact on performance.
  • Employ multi-round hashing to improve LSH attention accuracy and mitigate bucket collisions.
  • Provide theoretical memory/time complexity comparisons and empirical ablations across tasks.

Experimental results

Research questions

  • RQ1Can reversible layers preserve Transformer performance while reducing memory usage?
  • RQ2Does LSH-based attention approximate full attention sufficiently for long sequences, and how do hashing parameters affect accuracy?
  • RQ3How do shared-QK attention and chunked feed-forward impact training dynamics and efficiency?
  • RQ4What are the practical memory and speed benefits of the Reformer on very long sequences compared to standard Transformers?

Key findings

  • Reversible Transformer matches standard Transformer performance while materially reducing memory usage and enabling deeper models.
  • Shared-QK attention does not hurt performance and can even speed up training on enwik8.
  • LSH attention approximates full attention with increasing accuracy as the number of hashing rounds grows (e.g., higher rounds yield results close to full attention).
  • Chunking feed-forward layers reduces memory without altering numerical equivalence to the Transformer for same parameters.
  • Reformer enables larger, memory-efficient models on long sequences (e.g., up to 12–20 layer configurations) and demonstrates faster training and memory savings on long-context tasks like enwik8 and imagenet-64.
  • In WMT14 English-German translation, reversible Transformers achieve competitive BLEU scores with different configurations, e.g., base reversible model 27.6 BLEU (sacreBLEU 27.4) and big reversible model 29.1 BLEU (sacreBLEU 28.4).

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.