Papers › Ring Attention with Blockwise Transformers for Near-Infinite Context

Ring Attention with Blockwise Transformers for Near-Infinite Context

3 Oct 2023arXiv:2310.01889archive 2025-07-28

Hao liu, Matei Zaharia, Pieter Abbeel

Transformers have emerged as the architecture of choice for many state-of-the-art AI models, showcasing exceptional performance across a wide range of AI applications. However, the memory demands imposed by Transformers limit their ability to handle long sequences, thereby posing challenges in utilizing videos, actions, and other long-form sequences and modalities in complex environments. We present a novel approach, Ring Attention with Blockwise Transformers (Ring Attention), which leverages blockwise computation of self-attention and feedforward to distribute long sequences across multiple devices while fully overlapping the communication of key-value blocks with the computation of blockwise attention. Our approach enables training and inference of sequences that are up to device count times longer than those achievable by prior memory-efficient Transformers, without resorting to approximations or incurring additional communication and computation overheads. Extensive experiments on language modeling and reinforcement learning tasks demonstrate the effectiveness of our approach in allowing millions of tokens context size and improving performance.

PaperPDFCodeCode Syntology ran

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

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

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 28 code samples harvested from 6 repositories linked to this paper: 20 ran (of which 0 constructed an object rather than computing a result; 14 with no instrument failure: 3 honoured, 3 violated, 8 with no contract checked; 6 where Syntology's instrument failed) · 8 unverified. Where Syntology's instrument failed: 3 where our contract draft was wrong; 3 where the contract check could not run; failures of Syntology's instrument, not of the code.

By repository: official repository: 3 samples from 1 repository, 1 ran (1 with no instrument failure; 0 where Syntology's instrument failed); community (archive-listed): 25 samples from 5 repositories, 19 ran (13 with no instrument failure; 6 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

No sample is linked to this paper from 1 of its repositories that Syntology harvested for other papers:

Levels written between 2026-09-22 and 2026-09-26 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed. 2 of the 20 samples that ran have no recorded date.

forhaoliu/ringattention officialmentioned on GitHubjaxApache-2.0Syntology: 3 samples, 1 ran (0 instrument-failed) · 2 unverified report
chengzeyi/paraattention mentioned on GitHubpytorchNOASSERTIONSyntology: not harvested report
exists-forall/striped_attention mentioned on GitHubjaxSyntology: 3 samples, 2 ran (2 instrument-failed) · 1 unverified report
haonan3/anchorcontext mentioned on GitHubpytorchSyntology: 1 sample, 1 ran (1 instrument-failed) · 0 unverified report
jzhang38/EasyContext mentioned on GitHubpytorchSyntology: 2 samples, 2 ran (1 instrument-failed) · 0 unverified report
sandai-org/magiattention mentioned on GitHubpytorchSyntology: 2 samples, 1 ran (1 instrument-failed) · 1 unverified report
seongho608/ringformer mentioned on GitHubpytorchMITSyntology: 17 samples, 13 ran (1 instrument-failed) · 4 unverified report
wan-video/wan2.1 mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to VACE: All-in-One Video Creation and Editing (arXiv:2503.07598; that paper's own run record: 11 ran (of which 5 constructed an object rather than computing a result; 9 with no instrument failure: 0 honoured, 1 violated, 8 with no contract checked; 2 where Syntology's instrument failed) · 8 unverified); nothing checks that they implement this paper's method. 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.

A paper named beside a repository with no sample linked to this paper is shown with that paper's own run record, not this paper's: “ran” means executed on a synthesized input, not that the code is correct, and “where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Papers are listed in arXiv-id order, at most three per repository.

Code Syntology ran Syntology

28 samples harvested: 20 ran (of which 0 constructed an object rather than computing a result; 14 with no instrument failure: 3 honoured, 3 violated, 8 with no contract checked; 6 where Syntology's instrument failed) · 8 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page last changed ; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

3ran · honoured contract
3ran · violated contract
3ran · our draft was wrong
3ran; the contract check could not run
8ran
8unverified

Licence: 9 of the 28 samples are pointer only, meaning Syntology does not serve that copy's text. For 9 of them, this paper's copy is under a permissive licence and cleared, but the stored copy of the same code that Syntology serves is not; the licence label's tooltip gives Syntology's recorded reason. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 6 repositories linked to this paper, official or community; the list below is grouped by repository, each group headed by its name and what it is to the paper. “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. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (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 are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. 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 six 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; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. 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.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity. A census tag appears when Syntology's census ran implementations with that name on one shared input per bucket: it gives how many were compared, from how many papers, and how many distinct outputs they produced, and names this sample's bucket when this sample was one of them.

forhaoliu/ringattention official repository 3 samples, 1 ran (0 instrument-failed) · 2 unverified
below_or_on_diag ringattention/ringattention_jax.py ran Apache-2.0 (permissive) · 7f87411d8cd00fb8 · report fixture: signature r:ArrayImpl/0/int, r_blk_size:ArrayImpl/0/int, c:ArrayImpl/0/int, c_blk_size:ArrayImpl/0/int, causal_block_size:ArrayImpl/0/int · returned ArrayImpl · level recorded 2026-09-24
ring_attention ringattention/ringattention_jax.py unverified Apache-2.0 (permissive) · b9b682336560ca14 · report
ring_attention_inference ringattention/ringattention_jax_inference.py unverified Apache-2.0 (permissive) · 157e6d4b3de1fc27 · report
exists-forall/striped_attention community (archive-listed) 3 samples, 2 ran (2 instrument-failed) · 1 unverified
permute_tokens bpt.py ran; the contract check could not run (RAISES) · metamorphic tier: invariant fingerprinted Apache-2.0 (permissive) · 5bc133115aa98fa4 · report fixture: signature attention_type:str/0/str, tokens:Tensor/2/float, num_devices:int/0/int · returned Tensor · level recorded 2026-09-22
unpermute_outputs bpt.py ran; the contract check could not run (RAISES) · metamorphic tier: invariant fingerprinted Apache-2.0 (permissive) · 987eb0efeb759f2b · report fixture: signature attention_type:str/0/str, outputs:Tensor/3/float, num_devices:int/0/int · returned Tensor · level recorded 2026-09-22
ring_attention bpt.py unverified Apache-2.0 (permissive) · c486bdb7634db737 · report
haonan3/anchorcontext community (archive-listed) 1 sample, 1 ran (1 instrument-failed) · 0 unverified
new_decoder_forward anchor_context/ulysses_attn/monkey_patch.py ran · our draft was wrong Apache-2.0 (permissive) · 8ba2ad2a8cd08a1e · report fixture: signature self:callable/0/?, hidden_states:Tensor/3/float, attention_mask:Tensor/4/float, position_ids:Tensor/2/int, past_key_value:NoneType/0/?, output_attentions:bool/0/bool, use_cache:bool/0/bool, cache_position:Tensor/1/int, global_position_ids:NoneType/0/?, flex_mask:NoneType/0/? · returned tuple · level recorded 2026-09-22
jzhang38/EasyContext community (archive-listed) 2 samples, 2 ran (1 instrument-failed) · 0 unverified
construct_prompt in 24 papers eval_needle.py ran · our draft was wrong Apache-2.0 (permissive) · 2e94fa2078ca5f7c · report fixture: signature tokenized_haystack:list/1/int, tokenized_prefix:list/1/int, tokenized_postfix:list/1/int, tokenized_needle:list/1/int, context_length:int/0/int, tokenized_distractor_list:list/1/list, depth:float/0/float · returned list · level recorded 2026-09-22
load_haystack eval_needle.py ran · honoured contract Apache-2.0 (permissive) · 83526663aea6f3a5 · report fixture: signature args:Args/0/?, accelerator:MinimalAccelerator/0/?, tokenizer:MinimalTokenizer/0/? · returned list · level recorded 2026-09-22
sandai-org/magiattention community (archive-listed) 2 samples, 1 ran (1 instrument-failed) · 1 unverified
reorder_before_reduce_scatter exps/dist_attn/baselines/ring_attn.py ran; the contract check could not run (RAISES) · metamorphic tier: invariant Apache-2.0 (permissive) · 50fa7e0250016b3d · report fixture: signature input:Tensor/3/float, total_indices:Tensor/1/int · returned Tensor · level recorded 2026-09-22
generate_cu_seqlens_kv_ag_causal exps/dist_attn/baselines/ring_attn.py unverified Apache-2.0 (permissive) · 24313489651a82bb · report
seongho608/ringformer community (archive-listed) 17 samples, 13 ran (1 instrument-failed) · 4 unverified
calc_same_padding in 5 papers conformer/conformer.py ran · violated contract fingerprinted MIT (permissive) · a41cb31b42e919b1 · report fixture: signature kernel_size:int/0/int · returned tuple · level recorded 2026-09-22
convert_pad_shape in 15 papers commons.py ran · honoured contract MIT (permissive) here; the stored copy is pointer only · 59ae0708b1e8d94b · report fixture: signature pad_shape:list/1/list · returned list · level recorded 2026-09-22
default in 430 papers conformer/conformer.py ran · violated contract fingerprinted MIT (permissive) here; the stored copy is pointer only · 60fff7c3c400d7ff · report fixture: signature val:int/0/int, d:int/0/int · returned int · level recorded, date not recorded
discriminator_loss in 38 papers losses.py ran MIT (permissive) here; the stored copy is pointer only · 896f7aae82a62114 · report fixture: signature disc_real_outputs:list/1/Tensor, disc_generated_outputs:list/1/Tensor · returned tuple · level recorded 2026-09-26
exists in 528 papers
census: 5 implementations from 103 papers, 1 distinct output on one shared input this sample: bucket 1 of 1, arg 1: rank 1, kind int, dtype int64
conformer/conformer.py ran · violated contract MIT (permissive) here; the stored copy is pointer only · aa5486a3650902d8 · report fixture: signature val:Tensor/1/int · returned bool · level recorded, date not recorded
feature_loss in 27 papers losses.py ran MIT (permissive) here; the stored copy is pointer only · 24e8b4731dc3e070 · report fixture: signature fmap_r:list/1/list, fmap_g:list/1/list · returned Tensor · level recorded 2026-09-26
get_padding in 84 papers commons.py ran · honoured contract fingerprinted MIT (permissive) here; the stored copy is pointer only · a26f85d7c72ef39a · report fixture: signature kernel_size:int/0/int, dilation:int/0/int · returned int · level recorded 2026-09-22
intersperse in 14 papers commons.py ran · our draft was wrong fingerprinted MIT (permissive) here; the stored copy is pointer only · c01a3efb274ff778 · report fixture: signature lst:list/1/int, item:int/0/int · returned list · level recorded 2026-09-26
latest_checkpoint_path in 9 papers utils.py ran fingerprinted MIT (permissive) · 79242eb900957f26 · report fixture: signature dir_path:str/0/str, regex:str/0/str · returned str · level recorded 2026-09-24
load_checkpoint in 277 papers utils.py ran MIT (permissive) · 2ad367dd5097b12f · report fixture: signature checkpoint_path:str/0/str, models:callable/0/?, optimizer:Adam/0/? · returned tuple · level recorded 2026-09-25
phase_loss losses.py ran MIT (permissive) · 9543346026e2f58e · report fixture: signature x_fft:Tensor/2/complex, g_fft:Tensor/2/complex, reduction:str/0/str · returned Tensor · level recorded 2026-09-25
scan_checkpoint in 13 papers utils.py ran fingerprinted MIT (permissive) · 492b11f3eb615458 · report fixture: signature dir_path:str/0/str, regex:str/0/str · returned list · level recorded 2026-09-24
unconstrained_rational_quadratic_spline in 8 papers transforms.py ran MIT (permissive) here; the stored copy is pointer only · 70a7614b3b3eb41f · report fixture: signature inputs:Tensor/1/float, unnormalized_widths:Tensor/2/float, unnormalized_heights:Tensor/2/float, unnormalized_derivatives:Tensor/2/float, inverse:bool/0/bool, tails:str/0/str, tail_bound:float/0/float, min_bin_width:float/0/float, min_bin_height:float/0/float, min_derivative:float/0/float · returned tuple · level recorded 2026-09-24
piecewise_rational_quadratic_transform in 8 papers transforms.py unverified MIT (permissive) here; the stored copy is pointer only · ba6cafc4d658c14f · report
searchsorted in 9 papers transforms.py unverified MIT (permissive) · e85d747983c4f5d8 · report
stft in 21 papers stft.py unverified MIT (permissive) · 6f15bd47f3cbb1ef · report
weight_norm_modules attentions.py unverified MIT (permissive) · 0c0b5a033fe98758 · report

Tasks

Language ModelingLanguage Modelling

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

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