Paper Reading Notes · arXiv:2609.31093

Block Sparse Attention with Log-Linear Complexity

PISA (Pyramid Sparse Attention) pools keys into a $C\to2\to2\to\cdots$ pyramid and selects coarse-to-fine, cutting the block-selection stage of block-sparse attention from $O(N^2/C)$ to $O(N\log N)$.
Authors: Bohao Tang, Zhen Qin, Yuqi Pan, Zheng Li, Pengfei Liu Affiliations: Shanghai Jiao Tong University · Shanghai Innovation Institute · ByteDance Seed Paper: arXiv:2609.31093v1 [cs.LG] Date: 2026-09-25
Block-sparse attentionLong contextTop-K block selection LogSumExp scoringTriton kernelsO(N log N)
01 · Overview

Overview: the claim and the key numbers

The paper attacks a narrow, load-bearing problem: block-sparse attention saves the attention computation but not the cost of deciding which blocks to keep. The conventional recipe scores every query against all $N/C$ key blocks, so the selection stage costs $O(N^2/C)$ in total — attention itself has become linear while block selection stays quadratic, and at long sequence lengths selection becomes the new bottleneck. PISA replaces the full scan with a pyramid: keys are mean-pooled into $O(\log N)$ levels, and selection walks from the coarsest level down, expanding only the survivors. Routing drops to $O(\log N)$ per query and $O(N\log N)$ over the sequence.

Mechanism
Pyramid Top-Kmean pooling builds $O(\log N)$ key levels; each level scores at most $gK$ candidates and expands the survivors downward
Block score
LogSumExp over child summariesnot the average of child means; the paper gives a Jensen sandwich argument for why it is closer to the true block LSE
Complexity
O(N log N) prefill / O(log N) decodeagainst $O(N^2)$ and $O(N)$ for BSA / NSA / MoBA / HiLS
Selection latency
9.95× faster than BSAat 256K prefill; 5.31× at 128K and 2.86× at 64K
Selection quality
Recall@8 90.95%versus BSA 85.91% on identical queries and keys (paper's Table 7)
Long context
RULER average 62.802.67B at 16K, versus BSA 54.99 (paper's Table 3)
Reading conventions: every number on this page follows the paper. Anything this page derived, reorganised or converted from the paper's configuration is tagged [organized] or [estimated] so it can be told apart from the paper's own figures. Notation follows the paper: $N$ sequence length, $C$ block size, $K$ the block budget, $g$ the branching factor ($g=2$), $\ell$ the level index ($\ell=0$ raw keys, $\ell=1$ leaf blocks), $d$ head dimension. The paper does not link a code release.

The argument in three steps

Problem. Block-sparse attention runs in two stages: pick $K$ key blocks per query, then attend only inside them. Stage two is linear, but stage one must score all $N/C$ block summaries per query, so it stays $O(N^2/C)$ overall. The longer the sequence, the more block selection looks like full attention again.

Method. Pool keys into a fine-to-coarse pyramid ($C$ per group, then 2 per group), then select in the opposite direction: at each level score only the children of blocks kept at the previous level, keep the top $K$, and expand. Candidates per level are bounded by $gK$ and there are $O(\log N)$ levels, giving $O(\log N)$ routing per query. The block score is a LogSumExp over child summaries rather than an average of child means; Appendix A sandwiches it between the mean score and the parent's true raw-key LSE.

Evidence. At 418M / 1.47B / 2.67B, pretrained on 100B tokens at 4K and continued-pretrained on 10B tokens at 16K, language-modelling loss and commonsense reasoning are comparable to BSA, NSA and HiLS; the six-task containment average is the best among sparse methods at all three scales; the RULER average is clearly above BSA. Selection latency overtakes BSA after 32K and is 9.95× faster at 256K.

The other side of the coin: PISA replaces "scan every key block" with "score a fixed ~$gK$ leaf blocks plus a few intermediate candidates". The first grows with $N$, the second is constant — so on short sequences PISA is actually slower. The paper's own numbers show BSA winning from 4K to 16K, with the crossover between 16K and 32K. This is a mechanism built for long context, not a general speedup.
02 · Background

Background: two stages, and the bottleneck in the first

Self-attention grows quadratically with sequence length, which is the hard wall in long-context modelling. Sparse attention lets each query see only part of the keys; the block-sparse variant groups keys and values into contiguous blocks of $C$ tokens, which keeps the sparse computation inside regular tiled kernels instead of turning it into scattered gathers.

The paper formalises block-sparse attention as two stages. Stage one gives each key block a summary vector $\bar{k}_i=f(K_i)$ — mean pooling or a learned projection — and scores it against the query:

$$s_{t,i}=\frac{q_t^{\top}\bar{k}_i}{\sqrt{d}},\qquad i=1,\dots,M,\quad M=\lceil N/C\rceil \tag{1}$$

Stage two attends over the original keys and values inside the selected blocks:

$$o_t=\frac{\sum_{j\in T_t}\exp\!\left(q_t^{\top}k_j/\sqrt{d}\right)v_j}{\sum_{j\in T_t}\exp\!\left(q_t^{\top}k_j/\sqrt{d}\right)},\qquad T_t=\bigcup_{i\in I_t}\{(i-1)C+1,\dots,\min(iC,N)\} \tag{2}$$

Each query reads at most $KC$ keys, so stage two is $O(N)$. Stage one, however, scores $M=N/C$ blocks per query, accumulating $O(N^2/C)$: the attention cost was cut, the selection cost was not.

Where this sits relative to prior work

The paper positions the literature on two axes — trainable or not, and prefill/decode complexity. The table is worth reading line by line, because it names both PISA's niche and its competitors:

Table 1: training settings and computational complexity of sparse attention methods
Table 1: Training settings and computational complexity of selected sparse attention methods. N denotes the sequence length. Complexities include selection and attention computation. ✓ denotes trainable, and × denotes a training-free method. For LLSA [42], which is designed for diffusion models, the listed cost is per attention pass rather than autoregressive prefill. Line by line: HiP (Lee et al., ICLR 2025) is a training-free hierarchical-pruning serving framework and already reaches $O(N\log N)$ / $O(\log N)$ — note the "training-free" column, meaning weights are not updated. HISA (Xu et al., 2026) is training-free and still $O(N^2)$ at prefill. MoBA (Lu et al., NeurIPS 2025), NSA (Yuan et al., ACL 2025) and HiLS (Hu et al., 2026) are trainable but remain $O(N^2)$ at prefill — the selection stage is exactly why. LLSA (Zhou et al., CVPR 2026) already achieves $O(N\log N)$, but it targets diffusion transformers and shows "—" for decode. BSA here means the single-level mean-pooled baseline that PISA is compared against. Report p.2

Read down the columns and the claim is sharp: the only row that is simultaneously trainable, $O(N\log N)$ at prefill and $O(\log N)$ at decode is PISA. Log-linear complexity itself is not new — HiP and LLSA both have it — the contribution is making it an end-to-end trainable language-model attention layer with a decode path that keeps the $\log N$ guarantee.

A convention worth noticing: the BSA baseline is the authors' own re-composition of NSA's selected-attention branch with mean-pooled key summaries, not a verbatim reproduction of a published system. NSA keeps its learned-compression and selected-attention branches; HiLS keeps its learnable landmark routing. All methods share the same data, backbone and attention projections (paper §4.1 and §C.1).
03 · Method

Method: a pyramid of keys, selected coarse-to-fine

3.1 Fine to coarse: building the pyramid

Level 0 is the raw keys ($M_0=N$, one token per block); level 1 is the leaf blocks ($M_1=\lceil N/C\rceil$); above that every $g=2$ adjacent blocks merge:

$$M_{\ell+1}=\left\lceil\frac{M_\ell}{g_\ell}\right\rceil,\qquad g_0=C,\qquad g_\ell=g=2\;(\ell\ge 1) \tag{3}$$

Summaries are mean-pooled from their children, starting from $\bar{k}_i^{(0)}=k_i$:

$$\bar{k}_i^{(\ell+1)}=\frac{1}{|\mathrm{Ch}_\ell(i)|}\sum_{r\in\mathrm{Ch}_\ell(i)}\bar{k}_r^{(\ell)},\qquad \ell\ge 0 \tag{4}$$

Because the merge groups are equally sized at every step, the recursion yields the mean of all original keys in the block. Queries stay token-level throughout; they are never pooled.

3.2 Coarse to fine: narrowing the Top-K

Selection runs in the opposite direction. The coarsest level has a single candidate, and each level only processes the children of the previous level's survivors:

$$A_t^{(L)}=\{1\};\qquad s_t^{(\ell)}=\left[s_{t,i}^{(\ell)}\right]_{i\in A_t^{(\ell)}},\quad I_t^{(\ell)}=\mathrm{SelectK}\!\left(A_t^{(\ell)},s_t^{(\ell)}\right),\quad A_t^{(\ell-1)}=\bigcup_{i\in I_t^{(\ell)}}\mathrm{Ch}_{\ell-1}(i) \tag{5}$$
$$\left|I_t^{(\ell)}\right|\le K,\qquad \left|A_t^{(\ell-1)}\right|\le g\left|I_t^{(\ell)}\right|\le gK \tag{6}$$

After the walk, $I_t^{(1)}$ is the set of original key/value blocks used for attention. The pyramid is $L=O(\log N)$ levels tall and each level is capped at $gK$ candidates, so routing costs $O(\log N)$ per query and $O(N\log N)$ over the sequence — the "log-linear" in the title.

One detail carries a lot of weight: if a level has at most $K$ candidates, they are all retained without scoring. The top levels of the pyramid are therefore nearly free, which is what makes the mechanism cheap in practice and not just asymptotically.

Figure 1: BSA versus PISA block selection
Figure 1: Comparison of two different Top-K selection methods for sparse attention. Top: BSA computes a score for each key block before performing Top-K selection. Bottom: PISA constructs a fine-to-coarse hierarchy of key blocks through mean pooling and expands only the selected candidates from coarse to fine during selection. Intermediate blocks are scored using LSE over their child summaries, while leaf blocks are scored using exact LSE over their original keys. Read the two panels against each other. Top (BSA): the entire $\ell=1$ key strip is hatched as "scored candidate" and the annotation reads "Mean scores computed for all blocks" — cost proportional to block count. Bottom (PISA): in the same $\ell=1$ strip only two blocks are hatched, ringed in orange; the rest are white "skipped computation". Selection starts from the single wide block at the top of the pyramid and narrows downward. The two right-hand brackets name the two scoring modes: LSE over child-block at intermediate levels, LSE over original keys at the leaf level. In the legend, "Selected by Top-K" (orange dashed box) is a routing decision while "Selected KV" (orange filled cells) is what actually gets computed on. Report p.4

💡 Click any image to open the original 300 DPI version; click again or press Esc to close.

04 · Scoring

Scoring: LogSumExp, and why not the mean

Intermediate blocks have no raw keys available, only child summaries. The paper scores them with a LogSumExp over those summaries:

$$s_{t,i}^{(\ell)}=\log\sum_{r\in\mathrm{Ch}_{\ell-1}(i)}\exp\!\left(\frac{q_t^{\top}\bar{k}_r^{(\ell-1)}}{\sqrt{d}}\right),\qquad \ell\ge 1 \tag{7}$$

At the leaf level $\bar{k}_r^{(0)}=k_r$, so this degenerates into the exact LSE over original keys. Each candidate expands at most $g$ intermediate children or $C$ raw keys, so scoring stays bounded.

A Taylor expansion explains the choice. For logits $z_1,\dots,z_m$ with mean $\bar z$ and variance $\mathrm{Var}(z)$:

$$s_{\mathrm{PISA}}=\log\sum_{j=1}^{m}e^{z_j}=\log m+\bar z+\tfrac{1}{2}\mathrm{Var}(z)+\text{higher-order terms} \tag{8}$$

Dropping $\log m$, truncating at first order gives "mean only" and at second order "mean plus half the variance" — exactly the two ablation variants:

$$s_{\mathrm{PISA-1}}=\bar z,\qquad s_{\mathrm{PISA-2}}=\bar z+\tfrac{1}{2}\mathrm{Var}(z) \tag{9}$$

Appendix A then gives a Jensen sandwich. Let block $B$ have $g$ equally sized children $C_1,\dots,C_g$, let $m_j$ be the dot product of the query with child $j$'s summary, and let $F_q(B)$ be the parent's normalised raw-key LSE:

$$\frac{1}{g}\sum_{j=1}^{g}m_j\;\le\;\hat F(B):=\log\!\left(\frac{1}{g}\sum_{j=1}^{g}e^{m_j}\right)\;\le\;F_q(B) \tag{10}$$

The left term is the mean-of-means used by PISA-1, the middle term is PISA's score minus $\log g$, and the right term is the parent's true LSE. In words: taking a LogSumExp over child means sits closer to the true block score than averaging the child means does, because it preserves and amplifies differences between children. It cannot recover variation inside a child; when all logits within a child are equal the bounds meet.

The caveat the paper attaches itself: the comparison is about the numerical error of a block score and, in the paper's words, "does not guarantee more accurate block rankings or recovery of the globally highest-mass leaf blocks" (Appendix A.1). So this is an argument that the score is closer to the truth, not a theorem that selection is better. Selection quality is settled empirically, by the Table 7 diagnostic later on.

4.1 An inconsistency the paper discloses

Following NSA, query heads inside one GQA group share the selected blocks. PISA sums their LSE scores into a single block score:

$$u_{h,t,i}^{(\ell)}=\sum_{h'\in H(h)}s_{h',t,i}^{(\ell)} \tag{11}$$

Appendix A.3 points out that the full-attention reference in the diagnostic instead averages block masses across those heads. Even with exact LSE scores, summing and averaging can rank blocks differently. The paper flags this itself; it is a convention mismatch to keep in mind when reading Table 7, not an error.

05 · Systems

Systems: Triton kernels and the IO ledger

Naively, the level-by-level loop would write and re-read intermediate candidates and give back in memory bandwidth what it saved in FLOPs. The paper's answer is to fuse the intermediate levels into a single kernel, keep candidate indices local to the program, and never materialise a dense query–key score matrix.

Algorithm 1: two-stage block selection for PISA
Algorithm 1: Two-stage block selection for PISA. Walk through it: Stage 1 (lines 1–12) parallelises over (query position, KV head), loads the query vectors once, and walks levels from $\ell=L$ down to $\ell=2$; line 5 computes the LSE score per candidate, line 6 sums scores over the query heads sharing the KV head (Eq. 11), line 8 applies SelectK, line 9 expands the survivors into candidates for the next level. Stage 2 (lines 13–18) switches the parallel axis: it clusters the queries that need a given leaf block's score, splits each cluster into groups of at most $Q_{\text{tile}}$ queries, and in line 15 loads the key block $K_{i,h}^{(1)}$ once to score a whole group — this is the key-block reuse. Finally (lines 19–22) a light kernel applies SelectK per query and KV head. Note the two different loop axes on lines 4 and 14: that split is precisely the division of labour between the two stages. Report p.6

5.1 Why training uses two stages and decoding one

Rather than asserting that the kernels are fast, the paper puts the two designs' IO costs side by side. Per KV head, let $G_Q$ query heads share it, $C$ be the block size and $Q_{\text{tile}}$ the query tile.

Two-stage (training/prefill). Each query is tied to at most $gK$ candidate key blocks, so loading its queries costs $O(NgKG_Qd)$; because query tiles run in parallel, each key block is loaded on average $O(CgK/Q_{\text{tile}})$ times, giving a total key IO of $O(NCgKd/Q_{\text{tile}})$. The two-stage leaf-level Q/K IO is therefore

$$O\!\left(NgKd\left(G_Q+\frac{C}{Q_{\text{tile}}}\right)\right) \tag{12}$$

Single-stage walks straight to the leaf level, loading up to $gK$ original key blocks per query, for an extra $O(NgKCd)$ (Eq. 13). The two-stage design wins whenever

$$G_Q+\frac{C}{Q_{\text{tile}}}

With the implementation's $G_Q=16$, $Q_{\text{tile}}=4$ and $C=64$, this is $16+64/4=32<64$ — the condition holds, so training and prefill use the two-stage kernel.

Decoding flips the conclusion. A decoding cluster contains a single query, so there is no cross-query reuse: the two-stage kernel would load $gKC$ keys and reload the query vectors $gK$ times, costing $O(gK(C+G_Q)d)$, while a single-stage kernel reuses the queries already loaded during intermediate selection and needs only $O(gKCd)$. Hence the fused single-stage selector for decoding, which also avoids separate grouping and final-selection launches.

Why this ledger matters: it explains a design choice that is easy to dismiss as an implementation detail — the same algorithm runs on two different kernel structures for training and decoding, for a reason that is quantifiable rather than intuitive. The decision reduces to one inequality (Eq. 14) that can be re-evaluated when $G_Q$, $Q_{\text{tile}}$ or $C$ change.

5.2 Following the configuration down to actual levels

"$O(\log N)$ levels, at most $gK$ candidates each" is easy to skim past. Substituting the paper's own two training configurations (pretraining at 4K with $C=64$, $K=8$; continued pretraining at 16K with $C=64$, $K=32$) shows what the pyramid actually looks like at realistic lengths:

How the pyramid unfolds under the paper's 4K configuration ($N=4096$, $C=64$, $K=8$, $g=2$) — [estimated] from §3.2, §4.1, §C.1 and Table 5, not a table from the paper
Level $\ell$Tokens per blockCandidates $|A^{(\ell)}|$What happens
$\ell=7$ (coarsest)40961at most $K$, retained without scoring
$\ell=6$20482no scoring
$\ell=5$10244no scoring
$\ell=4$5128exactly $K$ — still no scoring
$\ell=3$2561616 LSE scores, keep 8
$\ell=2$1281616 LSE scores, keep 8
$\ell=1$ (leaf)6416$16\times64$ = 1024 raw keys scored, keep 8 blocks

The pyramid is $L=\log_2(4096/64)+1=7$ levels tall. Only two intermediate levels require scoring (16 candidates each), and the leaf level scores 1024 raw keys to pick 8 blocks — 512 keys attended.

The same pyramid under the 16K continued-pretraining configuration ($N=16384$, $C=64$, $K=32$, $g=2$) — [estimated]
Level $\ell$Tokens per blockCandidates $|A^{(\ell)}|$What happens
$\ell=9$ (coarsest)163841no scoring
$\ell=8$81922no scoring
$\ell=7$40964no scoring
$\ell=6$20488no scoring
$\ell=5$102416no scoring
$\ell=4$51232exactly $K$ — still no scoring
$\ell=3$2566464 candidates scored, keep 32
$\ell=2$1286464 candidates scored, keep 32
$\ell=1$ (leaf)6464$64\times64$ = 4096 raw keys scored, keep 32 blocks

Here $L=9$. The top six levels are entirely free because candidates never exceed $K=32$; two intermediate levels score 64 candidates each; the leaf level scores 4096 raw keys and keeps 32 blocks — 2048 keys attended.

These two tables also explain why BSA wins at short lengths: at 4K the leaf level still scores a fixed $gK\cdot C$ raw keys, while BSA only has to scan $M=N/C$ block summaries. While $N/C

The crossover, [estimated]: setting BSA's $N/C$ block-summary scores equal to PISA's $gKC$ raw-key scores gives $N=gKC^2$. With $g=2$, $K=8$, $C=64$ that is $N\approx 65\text{K}$, so the crossover should be in the 64K region on this arithmetic; the paper measures it between 16K and 32K (Table 4). Same order of magnitude but not equal, because the comparison counts dot products only and ignores BSA's lower kernel constant and PISA's extra intermediate-level and fusion overhead. This is a back-of-envelope estimate by this page, not a paper result.

5.3 Remaining conventions

  • Forced blocks and causal masking: following NSA's default in Flash Linear Attention (Yang & Zhang, 2024), the first, previous and current leaf blocks and their ancestor paths are always retained. During prefill, summaries on the current block's path can contain future keys; those nodes are retained but their scores are not used for ranking, and the attention kernel masks future tokens inside selected blocks separately.
  • Backpropagation: the selected block indices are held fixed in the backward pass — gradients flow through the attention over the selected entries, not through the discrete selection decision.
  • Decode cache: the pyramid stores $O((N/C)d)$ elements per KV head and each level grows by a fixed fraction. Even if every expansion copies the whole buffer, total copying to length $N$ is $O((N/C)d\log N)$, keeping the average decode cost at $O(\log N)$ per generated token.
06 · Experiments

Experiments: language modelling and downstream

Three scales — 418M / 1.47B / 2.67B — share one decoder-only backbone per scale and matched training settings: 100B tokens at sequence length 4096 from scratch, then 10B tokens of 16K continued pretraining. Sparse methods use $C=64$ throughout, with $K=8$ for pretraining and $K=32$ for continued pretraining (CPT). The configuration first:

Table 5: from-scratch training configuration
Table 5: From-scratch training configuration. The essentials: 418M is 24 layers / $d=1024$ / head dim 64; 1.47B is 24 layers / $d=2048$ / head dim 128; 2.67B is 32 layers / $d=2560$ / head dim 128. All three use 32 query heads against 2 KV heads, i.e. a GQA group size of $G_Q=16$ — the number that decides whether the IO inequality of §5.1, $G_Q+C/Q_{\text{tile}}=32$, holds. Pretraining runs 100K steps at sequence length 4096 with peak LR $3\times10^{-4}$, AdamW ($\beta=(0.9,0.95)$, $\epsilon=10^{-8}$, weight decay 0.1), global gradient clipping at 1.0, FSDP with bfloat16 parameters and FP32 reductions, seed 42. The schedule is 1K linear warm-up, a 90K plateau and a 9K square-root decay to 0.1× peak. Report p.19

Settings not in that table: GPT-2 BPE tokenizer (vocabulary 50,257 padded to 50,432), pre-RMSNorm, SiLU-gated feed-forward, no dropout; RoPE applied only to the high-frequency half of each attention head with base 10,000 (raised to 80,000 for continued pretraining); the 10B-token continued-pretraining run warms up to $3\times10^{-5}$ over the first 10% of steps and cosine-decays to $3\times10^{-6}$, restoring model parameters and Adam state, with packed inputs preserving document boundaries and no cross-document attention.

Table 2: language modelling and downstream evaluation
Table 2: Language modeling and downstream evaluation after 100B tokens of pretraining at 4K. Baselines include NSA [36] and HiLS [14]. Loss is the final training loss, and accuracies are reported as percentages. Gray columns show group averages; boldface marks the best sparse loss and group averages at each scale. The table has three blocks: perplexity (WikiText, LAMBADA and their average, lower is better), eight multiple-choice tasks with an Acc-8 average, and six containment tasks (SWDE, SQuAD, FDA, TQA, NQ, DROP) with their average. Containment counts a prediction as correct if it contains any gold answer as a case-insensitive literal substring. Per scale: PISA's loss is below BSA, PISA-1 and PISA-2 in all three rows, and its containment average — 41.77 / 49.83 / 52.14 — is the highest among sparse methods at every scale (bold), while still below Full Attention's 45.15 / 52.13 / 53.01. Report p.9

One point has to be stated according to where the paper's own boldface actually sits, or the table is easy to misread: the bold "best sparse loss" is not in the PISA row — it is in the HiLS row (2.5596 / 2.3084 / 2.2047 at the three scales). The paper's prose is careful to match: it claims PISA has lower loss than PISA-1, PISA-2 and BSA, not lower than every sparse baseline. [organized] from Table 2:

Loss column of the paper's Table 2, scale by scale (values from that table; [organized])
ScalePISABSAPISA-1PISA-2HiLSNSABold in the paper
418M2.56302.56842.56832.56632.55962.5727HiLS
1.47B2.31622.31792.32152.31682.30842.3142HiLS
2.67B2.21512.21842.21792.21522.20472.2098HiLS

PISA's loss advantage over BSA is 0.0054 / 0.0017 / 0.0033 across the three scales (subtracted on this page, [estimated]); it is also consistently below PISA-1 and PISA-2, but every gap is in the third decimal. What PISA does take in bold on this table is the containment average at all three scales, plus the perplexity average (23.04, tied with PISA-2) and the Acc-8 average (50.52) at 418M.

The change of convention after continued pretraining deserves its own warning, because it is an easy trap:

Table 6: downstream results after 16K continued pretraining
Table 6: Training loss and downstream performance for the 1.47B and 2.67B models after 10B tokens of continued pretraining at 16K. Sparse methods, including NSA [36], use C = 64 and K = 32. Loss is the final training loss. Gray columns show group averages; the containment average covers SWDE, SQuAD Completion, and FDA. The block budget does not apply to Full Attention. Two convention gaps to note. ① This table's containment average covers only three tasks (SWDE, SQuAD, FDA), whereas Table 2 covers six (adding TQA, NQ, DROP) — so "52.14" from Table 2 and "66.40" from Table 6 are not the same metric and cannot be compared directly. ② After continued pretraining PISA's containment average (65.33 at 1.47B, 66.40 at 2.67B) is below BSA (66.55 / 68.15), which the paper states plainly. Meanwhile PISA's loss is below BSA (1.7039 / 1.6324) and PISA-1 (1.7042 / 1.6331) at both scales — which is exactly the scope of the paper's sentence. Report p.20
Modelling takeaway: PISA is reliably ahead on the retrieval-style containment tasks during pretraining, and roughly level on loss and perplexity; after continued pretraining BSA overtakes it on containment. The abstract's claim of "better results on retrieval tasks" rests mainly on the RULER results in the next section, not on Table 6.
07 · Long context & efficiency

Long context, selection quality, selection efficiency

7.1 RULER needle-in-a-haystack

Long-context retrieval uses four RULER needle-in-a-haystack families (Hsieh et al., 2024) — single-key, multi-key, multi-query and multi-value — greedily decoded at five lengths from 1K to 16K, on the 2.67B models after 16K continued pretraining.

Table 3: RULER needle-in-a-haystack results
Table 3: RULER needle-in-a-haystack results after 10B tokens of continued pretraining at 16K for the 2.67B models. Sparse methods use C = 64 and K = 32. Scores are accuracies in percent. The gray Avg column averages scores over the four task families at 1K, 2K, 4K, 8K, and 16K, before rounding. Boldface marks the best sparse result in each column. How to read it, and two surprises. Each family has five length columns and the rightmost Avg spans all four families and five lengths. ① The bold entry in Avg is PISA-2 at 62.92, not the full PISA at 62.80 — on this metric the second-order truncation edges out the exact LSE. The difference is small but it does not fall on the side of the full method. ② In the single-key family the bold entries mostly go to NSA (91.67 at 16K against PISA's 71.27); PISA's family advantage is concentrated in multi-key, multi-query and multi-value. ③ All sparse methods degrade sharply at 16K on those three families — the best sparse scores there are only 15.20 (multi-key, NSA), 25.20 (multi-query, PISA-2) and 28.90 (multi-value, NSA), against Full Attention's 23.13 / 34.85 / 57.20. Report p.10

Flattening the 16K column of Table 3 makes the picture clearer (arithmetic mean over the four families, values from that table, [estimated]): PISA 30.86, PISA-2 32.56 and PISA-1 28.09 all beat BSA's 25.90, but all sit below NSA's 39.99 and Full Attention's 53.50. PISA's retrieval edge over BSA holds at 16K; it is not the strongest method in that column.

7.2 Block-selection diagnostic

This section answers whether the pyramid plus LSE actually selects the right blocks. The design is clean: take a 418M full-attention model (100B tokens pretrained), feed every selector the same query and key tensors, let each pick $K=8$ blocks, and compare against a reference set derived from the full-attention weights. All 24 layers, $C=64$, 100 FDA prompts, query positions $\ge512$ only (where more than eight blocks are eligible). The two metrics are the overlap Recall@K and the retained attention mass ratio.

Figure 2: selection quality by query position
Figure 2: Block-selection quality on 100 FDA prompts using identical Full-Attention queries and keys. Curves show mean Recall@8 and attention mass ratio by query position. All selectors and the reference share K = 8 and the forced-block policy; Recall@8 includes forced blocks. Left is Recall@8, right is the attention mass ratio, and the x-axis is query position over 500–2000 tokens. The solid orange line (full PISA) sits on top throughout both panels; blue dash-dot is PISA-2, grey dotted is PISA-1 and yellow dashed is BSA. The ordering of the three LSE/mean curves is the same in both panels: PISA > PISA-2 > PISA-1 ≈ BSA (in the right panel PISA-1 and BSA effectively coincide, with BSA marginally higher). Both curves fall monotonically with query position: the longer the prefix and the more blocks eligible, the harder it is for any selector to hit the blocks full attention cares about. Recall@8 includes the three forced blocks, which is why the curves start near 95%; only the declining part reflects selection ability. Report p.10
Table 7: aggregated selection quality
Table 7: Block-selection quality on 100 FDA prompts using shared Full-Attention queries and keys, with C = 64 and K = 8. Scores are percentages, averaged over query rows with more than eight eligible blocks. Recall@8 includes the three forced blocks. Boldface marks the best result in each column. PISA takes all three bold entries: Recall@8 90.95% (against BSA 85.91%, PISA-1 84.75%, PISA-2 88.24%), captured attention mass 86.47% (BSA 85.67%) and attention mass ratio 99.46% (BSA 98.42%). Two readings: the full LSE clearly beats the first-order PISA-1 (90.95 vs 84.75), so the second-order information — differences between children — is where most of the selection quality comes from; and the mass-ratio column exceeds 98% for every selector, meaning the chosen blocks cover nearly all the mass the reference set covers, which compresses the differences between selectors on that metric. Report p.21

7.3 Selection latency

Finally, efficiency. What is measured is the latency of the selection stage alone: random BF16 queries and keys, batch 1, 32 query heads, 2 KV heads, $d=64$, $C=64$, $K=8$, $g=2$, dot products accumulated in FP32. Timings include mean-summary construction and all selection stages and exclude attention over the selected blocks.

Figure 3: prefill block-selection latency
Figure 3: Prefill block-selection latency from 4K to 256K with C = 64 and K = 8. Timings include mean-summary construction and all selection stages, but exclude attention over the selected blocks. The key-block reuse implementation of PISA uses Q_tile = 4; annotations show speedups over BSA. Complete settings are provided in Appendix B. The crossover is the headline. Yellow dashed is BSA, grey dotted is PISA's per-query fused kernel, solid orange is the key-block reuse implementation ($Q_{\text{tile}}=4$, the paper's Q4). From 4K to 16K BSA is faster (at 16K, 1.461 ms against Q4's 1.581 ms); from 32K Q4 takes over and pulls away, reaching 2.86× / 5.31× / 9.95× at 64K / 128K / 256K. BSA's curve visibly steepens at long lengths (312.96 ms at 256K) — the $O(N^2/C)$ term at work. Key-block reuse gains a steady 1.30×–1.35× over the per-query implementation from 64K to 256K, modest but consistent: that is the payoff from the $G_Q+C/Q_{\text{tile}}=32<64$ inequality of §5.1. Report p.11
Table 4: fixed-length block-selection latency
Table 4: Fixed-length block-selection latency from 4K to 256K. Q1, Q2, and Q4 reuse one leaf-key tile across up to one, two, and four query references, respectively. Boldface marks the lowest latency at each sequence length. Q1/Q2/Q4 differ in how many queries each leaf key tile serves. Bold marks the row winner: 4K, 8K and 16K go to BSA (0.167007 / 0.462596 / 1.461185 ms); 32K through 256K go to Q4 (3.184846 / 6.704480 / 14.452411 / 31.440747 ms). Note also that at 4K, Q4 (0.701181 ms) is slower than per-query (0.573228 ms); the paper explains this directly — at short lengths there are few candidate blocks, so the overhead of organising queries into groups exceeds the reuse benefit, and the trade turns positive from 8K onward. Report p.18
Efficiency takeaway: this is a win-at-length scorecard. Once selection complexity goes from $O(N^2/C)$ to $O(N\log N)$, the benefit only outweighs PISA's fixed extra work when $N$ is large enough; the measured crossover is between 16K and 32K, and at 256K the gap is nearly 10×. Both questions a reader is likely to ask — "is it faster than BSA?" (much faster at long lengths, slower at short ones) and "by how much?" (9.95× on the selection stage; the end-to-end multiple is not measured, see §8.2) — are answered in this section.
08 · Commentary

Commentary: lineage, limits, and what is not disclosed

8.1 Limitations (the paper's own)

The Limitations section is one short paragraph: computational constraints limited the model sizes and pretraining budgets explored, and both factors can substantially affect performance and the relative gains over baselines; within the settings evaluated, the central finding — pyramid block selection reduces selection complexity while keeping performance competitive — holds. No other limitation is self-reported.

8.2 Where the components come from

Separating each component's upstream attribution makes it clear what is inherited and what is this paper's own change:

Component lineage (organised from the paper's inline citations; not a table from the paper; citations follow the paper's own attribution and this page has not re-checked each reference entry)
ComponentUpstream as attributed by the paperChange / integration in this work
Two-stage block-sparse framework (select, then attend inside)General BSA paradigm, attributed to MoBA (Lu et al., 2025) and NSA (Yuan et al., 2025)Keeps the two stages; stage one changes from a flat scan over all blocks to a level-by-level narrowing
Pooled block summaries for selectionQuery-dependent summaries in MoBA (Lu et al., 2025) and InfLLM-V2 (Zhao et al., 2025)Extends a single leaf-level summary into a pyramid of $O(\log N)$ summary levels
Multi-level / coarse-to-fine selectionHiP (Lee et al., ICLR 2025, training-free) repeats selection across levels; LLSA (Zhou et al., CVPR 2026) does hierarchical Top-K for diffusion transformersFirst to make it a trainable language-model attention layer, with an $O(\log N)$ argument for the decode path
Block scoring functionNo direct upstream (BSA/NSA-family methods use summary dot products or means)LogSumExp over child summaries; Appendix A proves the sandwich "mean of means ≤ summary LSE ≤ parent raw-key LSE" and derives the PISA-1 / PISA-2 Taylor variants from it
Shared selection within a GQA groupNSA (Yuan et al., 2025)Kept; the per-head LSE scores are summed (Appendix A.3 notes the diagnostic reference instead averages, so the two can rank blocks differently)
Forced-block policy (first / previous / current) and the decode-stage structureNSA's default implementation in Flash Linear Attention (Yang & Zhang, 2024)Masking and forced-block semantics kept; decoding fuses intermediate and leaf levels into one kernel
Two-stage Triton kernels and key-block reuse for training/prefillThis workStage 1 fuses all intermediate levels with candidate indices staying on-chip; Stage 2 clusters by (KV head, leaf block) and loads each key block once to serve up to 4 queries
Evaluation protocollm-evaluation-harness (Biderman et al., 2023), the BASED / JRT containment implementations (Arora et al., 2024), RULER (Hsieh et al., 2024)Adopted as-is; containment uses three tasks or six depending on the table (see the Table 2 / Table 6 convention gap)

8.3 Not disclosed, worth testing next

8.4 Assessment

What the contribution really is. Quadratic block selection is a real engineering bottleneck in long-context systems, and the paper answers it with a structure that is both simple and analysable: build a pooling pyramid and replace "scan every block" with "narrow level by level". The $O(N\log N)$ complexity itself had already been reached by a training-free method (HiP) and by a diffusion-model method (LLSA), so the incremental contribution is threefold: putting hierarchical selection inside a trainable language-model attention layer, replacing the block score with an LSE backed by a sandwich argument, and working out the IO ledger for training/prefill versus decoding and turning it into two Triton kernels. That third point is the most solid — writing out "substitute $G_Q=16$, $Q_{\text{tile}}=4$, $C=64$ and check whether the inequality holds" is far more informative than the customary claim that a kernel is well optimised.

How strong the evidence is. The division of labour is clear: modelling quality rests on three scales and 100B+10B tokens of training, selection quality on a controlled diagnostic over identical tensors, and selection efficiency on a 4K–256K microbenchmark. Each strand stands on its own, but together they do not add up to "PISA is better across the board." Loss is beaten by HiLS; single-key retrieval is beaten by NSA; the RULER average is beaten by PISA's own PISA-2 variant; containment after continued pretraining is beaten by BSA; selection latency below 16K is beaten by BSA. What holds in every experiment is narrower: the six-task containment average during pretraining (best at all three scales) and selection latency above 32K (2.86× from 64K, 9.95× at 256K). The abstract's phrasing — comparable commonsense reasoning, better retrieval — maps onto exactly those two, and does not overreach. That is an honest abstract.

Where it applies. The value of the mechanism grows with sequence length; below 16K it is outright slower. Its target is long-context prefill and long-sequence decoding. A reader deploying at 4K–16K gets no reason to adopt it from this paper; at 64K and beyond, the fact that selection grows quadratically with length is genuinely removed, and the quality cost at 16K looks acceptable in these experiments.

What is still open. The most important question is: if selection is 10× faster, how much faster is the end-to-end forward pass? That depends on the share of time taken by attention over the selected blocks, and the paper does not measure it, so how much of the benefit is realised remains open. Next is whether the pyramid's memory and copying overhead is really amortised as $O(\log N)$ inside a real training loop, and whether quality holds beyond 64K — both need measurements outside this paper's configuration.

Glossary

Glossary

Abbreviations are also hoverable in the prose via dotted underlines.

Reading glossary (hover the dotted abbreviations in the prose for the same definitions)
TermFull nameOne-line explanation
PISAPyramid Sparse AttentionThis paper's method: a pyramid of key levels plus coarse-to-fine level-by-level Top-K selection.
BSABlock Sparse AttentionThe general family; on this page it means the paper's baseline — single-level Top-K over mean-pooled summaries.
Top-K selection—Keep the $K$ highest-scoring candidate blocks. $K$ is the block budget: 8 for pretraining, 32 for continued pretraining.
LSELogSumExp$\log\sum_j e^{z_j}$ — the denominator of the softmax, and a continuous measure of how much a block matters to a query.
Leaf block—Level 1 of the pyramid: $C$ adjacent raw keys, the unit that actually takes part in attention.
Branching factor $g$—How many blocks of a level merge into one block of the next. Here $g_0=C$ and $g_\ell=2$ for $\ell\ge1$.
GQAGrouped-Query AttentionQuery heads share KV heads (Ainslie et al., 2023). Here, heads in a group share one selected block set.
$G_Q$Query heads per KV head32 query heads over 2 KV heads in this paper, so $G_Q=16$.
$Q_{\text{tile}}$Query tile sizeHow many queries one loaded leaf key block serves in Stage 2; the implementation uses 4.
PISA-1 / PISA-2First- / second-order variantsTaylor truncations of the LSE score: mean only, and mean plus half the variance.
CPTContinued Pre-TrainingAfter 4K pretraining, 10B more tokens extend the length to 16K and the budget to $K=32$.
RoPERotary Position EmbeddingApplied to the high-frequency half of each head only; base raised from 10,000 to 80,000 for continued pretraining.
FSDPFully Sharded Data ParallelUsed with bfloat16 parameters and FP32 reductions.
RULER—Long-context evaluation suite (Hsieh et al., 2024); four needle-in-a-haystack families at 1K–16K here.
ContainmentContainment accuracyCorrect if the generation contains any gold answer as a case-insensitive literal substring; used for retrieval tasks.
Recall@K—Overlap between selected and full-attention reference blocks, forced blocks included. PISA scores 90.95%.
Attention mass ratio—Mass covered by the selected blocks divided by the reference set's mass. PISA scores 99.46%.
Triton—Python-like kernel language for GPUs; both the training/prefill and decoding kernels are written in it.