LongNet: Scaling Transformers to 1, 000, 000, 000 Tokens

By Jiayu Ding, Shuming Ma, Li Dong, Xingxing Zhang, Shaohan Huang, Wenhui Wang, Furu Wei. 2023

265 citations recorded by the source corpus.

Scaling sequence length has become a critical demand in the era of large language models. However, existing methods struggle with either computational complexity or model expressivity, rendering the maximum sequence length restricted. In this work, we introduce LongNet, a Transformer variant that can scale sequence length to more than 1 billion tokens, without sacrificing the performance on shorter sequences. Specifically, we propose dilated attention, which expands the attentive field exponentially as the distance grows. LongNet has significant advantages: 1) it has a linear computation complexity and a logarithm dependency between tokens; 2) it can be served as a distributed trainer for extremely long sequences; 3) its dilated attention is a drop-in replacement for standard attention, which can be seamlessly integrated with the existing Transformer-based optimization. Experiments results demonstrate that LongNet yields strong performance on both long-sequence modeling and general language tasks. Our work opens up new possibilities for modeling very long sequences, e.g., treating a whole corpus or even the entire Internet as a sequence.

Subfields: Artificial Intelligence, Model Architectures, Scaling & Learning Theory

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Artificial Intelligence

  1. Gabriel Synnaeve
  2. Yossi Adi
  3. Jade Copet
  4. Nicolas Usunier
  5. Tal Remez
  6. Jianfeng Gao
  7. Boris Ginsburg
  8. Hugo Touvron

In Model Architectures

  1. Hugo Touvron
  2. Boris Ginsburg
  3. Samuel Kriman
  4. Nicolas Usunier
  5. Joanna Bitton
  6. Jade Copet
  7. Yuxiao Dong
  8. Aohan Zeng

In Scaling & Learning Theory

  1. Boris Ginsburg

Citations in the corpus