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 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="2310.01889")

Code

Syntology Ran 13 of 28 code samples harvested from 6 repositories linked to this paper; 15 have no recorded run. Of those that ran: 3 ran · honoured contract; 3 ran · violated contract; 2 ran · our draft was wrong; 3 ran · fixture could not drive it; 2 ran with no contract checked.

By repository: official repository: 3 samples from 1 repository, 1 ran; community (archive-listed): 25 samples from 5 repositories, 12 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

forhaoliu/ringattention officialmentioned on GitHubjaxApache-2.0 report
chengzeyi/paraattention mentioned on GitHubpytorchNOASSERTION report
exists-forall/striped_attention mentioned on GitHubjax report
haonan3/anchorcontext mentioned on GitHubpytorch report
jzhang38/EasyContext mentioned on GitHubpytorch report
sandai-org/magiattention mentioned on GitHubpytorch report
seongho608/ringformer mentioned on GitHubpytorchMIT report
wan-video/wan2.1 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

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

3ran · honoured contract
3ran · violated contract
2ran · our draft was wrong
3ran · fixture could not drive it
2ran
15unverified

Licence: 0 of the 28 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 6 repositories linked to this paper, official or community; each sample names its own and says which. “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.

below_or_on_diag forhaoliu/ringattention/ringattention/ringattention_jax.py official repository ran Apache-2.0 (permissive) · 7f87411d8cd00fb8 · report
ring_attention forhaoliu/ringattention/ringattention/ringattention_jax.py official repository unverified Apache-2.0 (permissive) · b9b682336560ca14 · report
ring_attention_inference forhaoliu/ringattention/ringattention/ringattention_jax_inference.py official repository unverified Apache-2.0 (permissive) · 157e6d4b3de1fc27 · report
calc_same_padding seongho608/ringformer/conformer/conformer.py community (archive-listed) ran · violated contract fingerprinted MIT (permissive) · a41cb31b42e919b1 · report
construct_prompt jzhang38/EasyContext/eval_needle.py community (archive-listed) ran · our draft was wrong Apache-2.0 (permissive) · 2e94fa2078ca5f7c · report
convert_pad_shape seongho608/ringformer/commons.py community (archive-listed) ran · honoured contract MIT (permissive) · 59ae0708b1e8d94b · report
default seongho608/ringformer/conformer/conformer.py community (archive-listed) ran · violated contract fingerprinted MIT (permissive) · 60fff7c3c400d7ff · report
exists seongho608/ringformer/conformer/conformer.py community (archive-listed) ran · violated contract MIT (permissive) · aa5486a3650902d8 · report
get_padding seongho608/ringformer/commons.py community (archive-listed) ran · honoured contract fingerprinted MIT (permissive) · a26f85d7c72ef39a · report
load_haystack jzhang38/EasyContext/eval_needle.py community (archive-listed) ran · honoured contract Apache-2.0 (permissive) · 83526663aea6f3a5 · report
new_decoder_forward haonan3/anchorcontext/anchor_context/ulysses_attn/monkey_patch.py community (archive-listed) ran · our draft was wrong Apache-2.0 (permissive) · 8ba2ad2a8cd08a1e · report
permute_tokens exists-forall/striped_attention/bpt.py community (archive-listed) ran · fixture could not drive it fingerprinted Apache-2.0 (permissive) · 5bc133115aa98fa4 · report
reorder_before_reduce_scatter sandai-org/magiattention/exps/dist_attn/baselines/ring_attn.py community (archive-listed) ran · fixture could not drive it Apache-2.0 (permissive) · 50fa7e0250016b3d · report
unconstrained_rational_quadratic_spline seongho608/ringformer/transforms.py community (archive-listed) ran MIT (permissive) · 70a7614b3b3eb41f · report
unpermute_outputs exists-forall/striped_attention/bpt.py community (archive-listed) ran · fixture could not drive it fingerprinted Apache-2.0 (permissive) · 987eb0efeb759f2b · report
discriminator_loss seongho608/ringformer/losses.py community (archive-listed) unverified MIT (permissive) · 896f7aae82a62114 · report
feature_loss seongho608/ringformer/losses.py community (archive-listed) unverified MIT (permissive) · 24e8b4731dc3e070 · report
generate_cu_seqlens_kv_ag_causal sandai-org/magiattention/exps/dist_attn/baselines/ring_attn.py community (archive-listed) unverified Apache-2.0 (permissive) · 24313489651a82bb · report
intersperse seongho608/ringformer/commons.py community (archive-listed) unverified MIT (permissive) · c01a3efb274ff778 · report
latest_checkpoint_path seongho608/ringformer/utils.py community (archive-listed) unverified MIT (permissive) · 79242eb900957f26 · report
load_checkpoint seongho608/ringformer/utils.py community (archive-listed) unverified MIT (permissive) · 2ad367dd5097b12f · report
phase_loss seongho608/ringformer/losses.py community (archive-listed) unverified MIT (permissive) · 9543346026e2f58e · report
piecewise_rational_quadratic_transform seongho608/ringformer/transforms.py community (archive-listed) unverified MIT (permissive) · ba6cafc4d658c14f · report
ring_attention exists-forall/striped_attention/bpt.py community (archive-listed) unverified Apache-2.0 (permissive) · c486bdb7634db737 · report
scan_checkpoint seongho608/ringformer/utils.py community (archive-listed) unverified MIT (permissive) · 492b11f3eb615458 · report
searchsorted seongho608/ringformer/transforms.py community (archive-listed) unverified MIT (permissive) · e85d747983c4f5d8 · report
stft seongho608/ringformer/stft.py community (archive-listed) unverified MIT (permissive) · 6f15bd47f3cbb1ef · report
weight_norm_modules seongho608/ringformer/attentions.py community (archive-listed) 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