SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2510.21270 · ICML · 2025

Sparser Block-Sparse Attention via Token Permutation

Dong Zhang, Xipeng Qiu, C Kim, H Wang, L Chen, C Wang, Xinghao Wang, Pengyu Wang, G Schwarz, G Halpern, G Zhang, E.-T Le, and 7 more

arXiv · PDF · Open in the Atlas

Code that ran

8 of 10 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 8 failures of our instrument; 2 no recorded run); 1 of them was also run on the host, not in the jail, by the peer-agreement lane that set its level, measured 2026-11-23; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2510.21270.json · badge: /api/ran/2510.21270.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
xinghaow99/pbs-attn canonical (classifier label)
classifier basis: census
8 ran · 2 no recorded run
FunctionStatusWhere it lives
repeat_kv Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
xinghaow99/pbs-attn/pbs_attn/patch/huggingface.py
pointer only (licence: NONE) · get_code("3c76e52815c5401d")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, xinghaow99/pbs-attn when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

apply_permutation Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
xinghaow99/pbs-attn/pbs_attn/src/permute_states.py
pointer only (licence: NONE) · get_code("affc3b6cf23a3c4c")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, xinghaow99/pbs-attn when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

block_pooled_attn Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
xinghaow99/pbs-attn/pbs_attn/src/utils.py
pointer only (licence: NONE) · get_code("90ecc7bc70c64f70")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, xinghaow99/pbs-attn when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

first_token_mask Ran
ran; our contract draft was wrong, not the code
xinghaow99/pbs-attn/pbs_attn/src/pbs.py
pointer only (licence: NONE) · get_code("988658f43a8e8d23")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, xinghaow99/pbs-attn when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

last_block_attn_sorting Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
xinghaow99/pbs-attn/pbs_attn/src/permute_states.py
pointer only (licence: NONE) · get_code("c9fed577c6134689")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, xinghaow99/pbs-attn when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

rotate_half Ran
ran; our contract draft was wrong, not the code
xinghaow99/pbs-attn/pbs_attn/patch/huggingface.py
pointer only (licence: NONE) · get_code("e03d53ba9d4f9ae5")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, xinghaow99/pbs-attn when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

select_blocks Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
xinghaow99/pbs-attn/pbs_attn/src/utils.py
pointer only (licence: NONE) · get_code("c8de7172a1d0130e")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, xinghaow99/pbs-attn when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

sum_all_diagonal_matrix Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
xinghaow99/pbs-attn/pbs_attn/baselines/Minference.py
pointer only (licence: NONE) · get_code("e75815e606c87def")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, xinghaow99/pbs-attn when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

apply_rotary_pos_emb Not yet run
unverified (harvested, no recorded run)
xinghaow99/pbs-attn/pbs_attn/patch/huggingface.py
pointer only (licence: NONE) · get_code("de11bf4368235366")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, xinghaow99/pbs-attn when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

torch_block_wise_attention Not yet run
unverified (harvested, no recorded run)
xinghaow99/pbs-attn/pbs_attn/baselines/Flexprefill.py
pointer only (licence: NONE) · get_code("c0466ce153afc8d6")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, xinghaow99/pbs-attn when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 3 the same month, 3 later) and 6 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
rotate_half 360 other papers
304 dated earlier, 3 the same month, 45 later, 5 same year, order not determinable, 3 undated · 30 only as an assembly brick
1901.02860 (2019-01)
Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context
2203.08913 (2022-03)
Memorizing Transformers
2302.13971 (2023-02)
LLaMA: Open and Efficient Foundation Language Models
and 357 more not named here
repeat_kv 243 other papers
206 dated earlier, 2 the same month, 29 later, 4 same year, order not determinable, 2 undated · 22 only as an assembly brick
1901.02860 (2019-01)
Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context
2203.08913 (2022-03)
Memorizing Transformers
2305.17888 (2023-05)
LLM-QAT: Data-Free Quantization Aware Training for Large Language Models
and 240 more not named here
apply_rotary_pos_emb 94 other papers
73 dated earlier, 1 the same month, 15 later, 2 same year, order not determinable, 3 undated · 6 only as an assembly brick
1901.02860 (2019-01)
Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context
2305.17888 (2023-05)
LLM-QAT: Data-Free Quantization Aware Training for Large Language Models
2309.11674 (2023-09)
A Paradigm Shift in Machine Translation: Boosting Translation Performance of Large Language Models
and 91 more not named here
sum_all_diagonal_matrix 2 other papers
2 dated earlier
2410.21465 (2024-10)
ShadowKV: KV Cache in Shadows for High-Throughput Long-Context LLM Inference
2509.24745 (2025-09)
ProxyAttn: Guided Sparse Attention via Representative Heads

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Scaling the context length of large language models (LLMs) offers significant benefits but is computationally expensive. This expense stems primarily from the self-attention mechanism, whose O(N 2 ) complexity with respect to sequence length presents a major bottleneck for both memory and latency. Fortunately, the attention matrix is often sparse, particularly for long sequences, suggesting an opportunity for optimization. Block-sparse attention has emerged as a promising solution that partitions sequences into blocks and skips computation for a subset of these blocks. However, the effectiveness of this method is highly dependent on the underlying attention patterns, which can lead to sub-optimal block-level sparsity. For instance, important key tokens for queries within a single block may be scattered across numerous other blocks, leading to computational redundancy. In this work, we propose Permuted Block-Sparse Attention (PBS-Attn), a plug-and-play method that leverages the permutation properties of attention to increase block-level sparsity and enhance the computational efficiency of LLM prefilling. We conduct comprehensive experiments on challenging longcontext datasets, demonstrating that PBS-Attn consistently outperforms existing block-sparse attention methods in model accuracy and closely matches the full attention baseline. Powered by our custom permuted-FlashAttention kernels, PBS-Attn achieves an end-to-end speedup of up to 2.75× in long-context prefilling, confirming its practical viability. Code available at https: //github.com/xinghaow99/pbs-attn.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2510.21270")
get_code_for_paper("2510.21270")
have("2510.21270")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2510.21270.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2510.21270.svg)](https://syntology.ai/paper/2510.21270)

Connect an agent — have() is free.