Papers › Leave No Context Behind: Efficient Infinite Context Transformers with Infini-attention

Leave No Context Behind: Efficient Infinite Context Transformers with Infini-attention

10 Apr 2024arXiv:2404.07143archive 2025-07-28

Tsendsuren Munkhdalai, Manaal Faruqui, Siddharth Gopal

This work introduces an efficient method to scale Transformer-based Large Language Models (LLMs) to infinitely long inputs with bounded memory and computation. A key component in our proposed approach is a new attention technique dubbed Infini-attention. The Infini-attention incorporates a compressive memory into the vanilla attention mechanism and builds in both masked local attention and long-term linear attention mechanisms in a single Transformer block. We demonstrate the effectiveness of our approach on long-context language modeling benchmarks, 1M sequence length passkey context block retrieval and 500K length book summarization tasks with 1B and 8B LLMs. Our approach introduces minimal bounded memory parameters and enables fast streaming inference for LLMs.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2404.07143")

Code

Syntology Ran 15 of 16 code samples harvested from 4 repositories linked to this paper; 1 has no recorded run. Of those that ran: 2 ran · violated contract; 4 ran · our draft was wrong; 4 ran · fixture could not drive it; 5 ran with no contract checked.

By repository: community (archive-listed): 12 samples from 4 repositories, 11 ran; 4 identical to code first harvested elsewhere. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

ArionDas/InfiniGPT mentioned on GitHubpytorch report
Beomi/InfiniTransformer mentioned on GitHubpytorchMIT report
jlamprou/Infini-Attention mentioned on GitHubpytorch report
lucidrains/infini-transformer-pytorch mentioned on GitHubpytorch report
mustafaaljadery/gemma-2b-10m mentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

16 samples harvested; 15 ran; 0 honoured the contract we drafted; 1 has no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

2ran · violated contract
4ran · our draft was wrong
4ran · fixture could not drive it
5ran
1unverified

Licence: 6 of the 16 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 4 repositories linked to this paper, official or community; each sample names its own and says which. Some samples are identical code Syntology first harvested from another repository; for those, this paper's copy is not located and its licence is not recorded. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

repeat_kv Beomi/InfiniTransformer/modeling_gemma.py community (archive-listed) ran · fixture could not drive it fingerprinted MIT (permissive) · 30d7eec482ebf6b1 · report
CompressiveMemory ArionDas/InfiniGPT/src/infini_transformer.py community (archive-listed) ran Apache-2.0 (permissive) · e3e97263839cab4f · report
FeedForward ArionDas/InfiniGPT/src/infini_transformer.py community (archive-listed) ran fingerprinted Apache-2.0 (permissive) · 6190672bce0e4f2a · report
GELU ArionDas/InfiniGPT/src/infini_transformer.py community (archive-listed) ran fingerprinted Apache-2.0 (permissive) · 9fa049dcf996a066 · report
PositionEmbeddings ArionDas/InfiniGPT/src/infini_transformer.py community (archive-listed) ran Apache-2.0 (permissive) · a4a13041dd37b6f2 · report
apply_rotary_pos_emb Beomi/InfiniTransformer/modeling_gemma.py community (archive-listed) ran · our draft was wrong MIT (permissive) · bac65c3dafaec040 · report
apply_rotary_pos_emb jlamprou/Infini-Attention/infiniAttention.py community (archive-listed) ran · fixture could not drive it no licence file found · pointer only · 0fe82a947dc39b42 · report
generate_prompt_landmark jlamprou/Infini-Attention/passkey_retrieval.py community (archive-listed) ran · our draft was wrong fingerprinted no licence file found · pointer only · 943aef7d2bbc32d0 · report
get_mem_space Beomi/InfiniTransformer/gpu_mem_track.py community (archive-listed) ran MIT (permissive) · a01911ff65691be7 · report
retrieve_from_kv_memories lucidrains/infini-transformer-pytorch/infini_transformer_pytorch/infini_transformer.py community (archive-listed) ran · fixture could not drive it MIT (permissive) · 8d5b5a4c9c8d7db0 · report
rotate_half Beomi/InfiniTransformer/modeling_gemma.py community (archive-listed) ran · our draft was wrong fingerprinted MIT (permissive) · b99eea6376d1e212 · report
InfiniTransformer ArionDas/InfiniGPT/src/infini_transformer.py community (archive-listed) unverified Apache-2.0 (permissive) · e59592481467fbed · report
repeat_kv identical code first harvested elsewhere ran · fixture could not drive it fingerprinted licence of this copy not recorded · 3c76e52815c5401d · report
default identical code first harvested elsewhere ran · violated contract fingerprinted licence of this copy not recorded · 99b3563ebc6734ad · report
exists identical code first harvested elsewhere ran · violated contract fingerprinted licence of this copy not recorded · b7c3487f192e31b7 · report
rotate_half identical code first harvested elsewhere ran · our draft was wrong fingerprinted licence of this copy not recorded · e03d53ba9d4f9ae5 · report

Tasks

Language ModelingLanguage ModellingRetrieval

1 archive task tag without a task page not shown.

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Absolute Position EncodingsAdamAttentionBPEDense ConnectionsDropoutLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxTransformer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections