CLLGJul 5, 2023

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

Microsoft
arXiv:2307.02486v2247 citationsh-index: 102
AI Analysis

This addresses a critical bottleneck for AI researchers and practitioners in modeling extremely long sequences, such as entire corpora or the Internet, with a novel method that is not incremental.

The paper tackles the problem of scaling sequence length in large language models by introducing LongNet, a Transformer variant that scales to over 1 billion tokens while maintaining performance on shorter sequences, with linear computational complexity and strong experimental results.

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. To address this issue, 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 any two tokens in a sequence; 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.

Code Implementations3 repos
Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes