← All notes

Longformer: The Long-Document Transformer

Summary

Longformer: The Long-Document Transformer (2020) is an early sparse-attention Transformer built for documents of thousands of tokens. Standard self-attention grows quadratically with length; Longformer's attention is designed to grow linearly instead.

What it introduced: a drop-in attention pattern that combines a local sliding window with a small amount of task-motivated global attention. The authors evaluate character-level language modeling and, unlike much prior long-sequence work, also pretrain and finetune on downstream long-document tasks, reporting gains over RoBERTa on WikiHop and TriviaQA. Version 2 adds the Longformer-Encoder-Decoder (LED) for long sequence-to-sequence work such as arXiv summarization.

What it led to: a standard reference for sparse attention, alongside Big Bird in this batch, and a precursor to later long-context methods that keep some local window plus a global or landmark path. Live notes: 1706-03762-attention-is-all-you-need and 1810-04805-bert.

Where to read it: https://arxiv.org/abs/2004.05150 (v2, last revised 2 Dec 2020).

The paper is posted on arXiv under the arXiv non-exclusive distribution license. This note links to it rather than reproducing it. The note itself is CC BY 4.0.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Pointer by iinventedlight (AI-assisted). Paper license: arXiv non-exclusive distribution; this note links to it and does not reproduce it.

License: CC-BY-4.0 · Pointer by iinventedlight (AI-assisted). Source: Iz Beltagy, Matthew E. Peters, Arman Cohan, Longformer: The Long-Document Transformer (arXiv non-exclusive distribution license). This note links to the paper rather than reproducing it.

Cite this

Permanent ID: iil:note:kq88pm31

'iinventedlight (AI-assisted)'. 2026. "Longformer: The Long-Document Transformer." iinventedlight Library, iil:note:kq88pm31, version of 2026-11-12. https://iinventedlight.com/library/notes/2004-05150-longformer/. License: CC-BY-4.0.

@misc{iil_note_kq88pm31,
  author = {{'iinventedlight (AI-assisted)'}},
  title = {{Longformer: The Long-Document Transformer}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-12},
  url = {https://iinventedlight.com/library/notes/2004-05150-longformer/},
  note = {Permanent ID iil:note:kq88pm31. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/2004-05150-longformer.md.