paper-with-me

홈 › Papers

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

2023-07-05 · Jiayu Ding, Shuming Ma, Li Dong, Xingxing Zhang, Shaohan Huang, Wenhui Wang, Nanning Zheng, Furu Wei

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.

📄 PDF Abstract BibTeX arXiv:2307.02486

Code (3)

microsoft/unilm 공식 구현 pytorch
fkodom/dilated-attention-pytorch pytorch
microsoft/torchscale pytorch

Methods 이 논문이 사용한 방법론

Multi-Head Attention 설명 없음
Attention 설명 없음
Layer Normalization Unlike batch normalization, Layer Normalization directly estimates the normalization statistics from the summed inputs…
Absolute Position Encodings Absolute Position Encodings are a type of position embeddings for [Transformer-based models] where positional encodings are…
BPE Byte Pair Encoding, or BPE, is a subword segmentation algorithm that encodes rare and unknown words as sequences of subword units. The intuition is that various word…
Linear Layer A Linear Layer is a projection $\mathbf{XW + b}$.
Label Smoothing Label Smoothing is a regularization technique that introduces noise for the labels. This accounts for the fact that datasets may have mistakes in them, so maximizing the…
Adam 설명 없음

Similar Papers 제목 키워드 기반

When an Image is Worth 1,024 x 1,024 Words: A Case Study in Computational Pathology

2023-12-06 · Wenhui Wang, Shuming Ma, Hanwen Xu, Naoto Usuyama 외

This technical report presents LongViT, a vision Transformer that can process gigapixel images in an end-to-end manner. Specifically, we split the gigapixel image into a sequence of millions of patches and project them l…

PrognosisSurvival Predictionwhole slide images

TokenFormer: Rethinking Transformer Scaling with Tokenized Model Parameters

2024-10-30 · Haiyang Wang, Yue Fan, Muhammad Ferjad Naeem, Yongqin Xian 외

Transformers have become the predominant architecture in foundation models due to their excellent performance across various domains. However, the substantial cost of scaling these models remains a significant concern. T…

model

Critical attention scaling in long-context transformers

2025-10-07 · Shi Chen, Zhengjiang Lin, Yury Polyanskiy, Philippe Rigollet arxiv

As large language models scale to longer contexts, attention layers suffer from a fundamental pathology: attention scores collapse toward uniformity as context length $n$ increases, causing tokens to cluster excessively,…

Mixture of Chapters: Scaling Learnt Memory in Transformers

2026-03-22 · Tasmay Pankaj Tibrewal, Pritish Saha, Ankit Meda, Kunal Singh 외 arxiv

Transformers lack an explicit architectural mechanism for storing and organizing knowledge acquired during training. We introduce learnable sparse memory banks: a set of latent tokens, randomly initialized and trained en…

Vcc: Scaling Transformers to 128K Tokens or More by Prioritizing Important Tokens

2023-05-07 · NeurIPS 2023 11

Transformers are central in modern natural language processing and computer vision applications. Despite recent works devoted to reducing the quadratic cost of such models (as a function of the sequence length), dealing …

16k4k