---
title: "Landmark Attention: Random-Access Infinite Context Length for Transformers"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
license_note: 'paper is arXiv non-exclusive distribution license (verified on arXiv abs page 2026-11-12); this pointer note is our own words and is CC BY 4.0; we link to the paper rather than reproduce it'
source: https://iinventedlight.com/library/notes/2305-16300-landmark-attention.md
source_license: "arXiv non-exclusive distribution license"
attribution: 'Pointer by iinventedlight (AI-assisted). Source: Amirkeivan Mohtashami, Martin Jaggi, Landmark Attention: Random-Access Infinite Context Length for Transformers (arXiv non-exclusive distribution license). This note links to the paper rather than reproducing it.'
author: 'iinventedlight (AI-assisted)'
date: 2026-11-12
status: published
approved_by: "Cole Withington, 2026-11-12 14:44 PT, Librarian chat widget t51s316: \"Yes, publish all 100 second-list arXiv notes\""
checked_on: 2026-11-12
as_of: 2026-11-12
confidence: medium
untested: 'Pointer note only. Paper not reproduced. Abs page and license checked 2026-11-12.'
category: arxiv
topic_area: 'ai-research: memory-and-context'
tags: arxiv, long-context, attention, landmark-tokens, transformers
arxiv_id: 2305.16300
alias: 2305-16300-landmark-attention
type: pointer
format: pointer
sources:
  - id: S1
    title: "Landmark Attention: Random-Access Infinite Context Length for Transformers"
    publisher: arXiv
    authors: "Amirkeivan Mohtashami, Martin Jaggi"
    url: https://arxiv.org/abs/2305.16300
    version_read: "v2 (20 Nov 2023)"
    accessed: 2026-11-12
    license: "arXiv non-exclusive distribution license"
---
# Landmark Attention: Random-Access Infinite Context Length for Transformers

## Summary
[Landmark Attention: Random-Access Infinite Context Length for Transformers](https://arxiv.org/abs/2305.16300) (2023) is a method for very long context that keeps random-access attention, instead of giving up the ability to jump to any earlier token.

What it introduced: a landmark token for each block of the input. Attention is trained to use those landmarks to select relevant blocks, so retrieval happens inside the attention mechanism rather than through a separate retriever. The authors say this can work with specialized data structures and the memory hierarchy, and they report that a fine-tuned LLaMA 7B can handle context lengths over 32k tokens. They also compare with Transformer-XL while retrieving fewer tokens at each step. Code is public.

What it led to: later block- or landmark-based attention schemes for long context, alongside interpolation methods and sparse patterns. Live notes: [2307-03172-lost-in-the-middle](https://iinventedlight.com/library/notes/2307-03172-lost-in-the-middle/), [2308-14508-longbench](https://iinventedlight.com/library/notes/2308-14508-longbench/), and [2310-01889-ring-attention](https://iinventedlight.com/library/notes/2310-01889-ring-attention/). Position Interpolation is a full note in this week's batch F.

Where to read it: https://arxiv.org/abs/2305.16300 (v2, last revised 20 Nov 2023). NeurIPS 2023. Code: https://github.com/epfml/landmark-attention/.

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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
