Hugging Face Papers ↗ · 2026-11-24
Factorized Context Attention: From Emulated to Native Grid Probing
Media reports Hugging Face Papers Source language: Chinese
FCA, a training-free block-sparse attention, matches grid probing accuracy while being ~10x faster, improving long video/text tasks by 9‑14 points.
Full text
Factorized Context Attention: From Emulated to Native Grid Probing
Mohamed Eltahir Affiliation: King Abdullah University of Science and Technology (KAUST), Thuwal, Saudi Arabia Manar Eyad Affiliation: King Abdullah University of Science and Technology (KAUST), Thuwal, Saudi Arabia Yara Alzahrani Affiliation: King Abdullah University of Science and Technology (KAUST), Thuwal, Saudi Arabia Fatimah Albesher Affiliation: King Abdullah University of Science and Technology (KAUST), Thuwal, Saudi Arabia Duaa M. Tahir Affiliation: King Abdullah University of Science and Technology (KAUST), Thuwal, Saudi Arabia Tanveer Hussain Affiliation: Department of Computer Science, Edge Hill University, Ormskirk, England Naeemullah Khan Email: {mohamed.hamid, manar.ali, yara.zahrani, fatema.besher}@kaust.edu.sa{duaa.tahir, naeemullah.khan}@kaust.edu.sa, hussaint@edgehill.ac.uk Affiliation: King Abdullah University of Science and Technology (KAUST), Thuwal, Saudi Arabia
Abstract
Models read a book, an hour of video, or an image in one forward pass. As the context grows, this pass slows down, loses accuracy, and stops at the context window. Sparse attention is efficient, but keeps the other two limitations. Grid probing, a recent training-free method, recovers the accuracy and extends the reach by asking a frozen model the same question about short local and strided spans of the input, but every question repeats the whole computation, since each span is encoded again. Our insight is that grid probing is emulated attention, an attention pattern reproduced from outside the model through prompts, since each probe only restricts which part of the input the question can see. We introduce Factorized Context Attention (FCA), a training-free block-sparse attention that runs the same pattern natively, as the attention of the model itself. FCA encodes the input once into a KV cache, reads all spans as masked sequences in one batched forward, and uses a stair position schedule to keep every span inside the trained position range. Across long video understanding, long-context text inference and image grounding, FCA matches the accuracy and the reach of grid probing at a fraction of its cost. It gains about 10 points over the single pass on long video and 9 to 14 points on long novels, finds needles in videos of over a thousand frames and in texts four times the length of the window, and answers a later question about the same input in as little as a tenth of the time of grid probing. Native attention thus keeps what emulated attention gains without its cost, all with existing frozen language and vision-language models.
††footnotetext: ∗Equal contribution. †Corresponding author. ‡Principal investigator.
Code: https://github.com/mohammad2012191/FCA
1 Introduction
Figure 1: Emulated against native attention. (a) Grid probing builds the grid outside the frozen model and calls the model once per span. (b) FCA passes the input once and selects the spans inside the model with masked attention.
Models answer questions about a book or a long video by reading the whole input in a single forward pass, which we call the monolithic read. As the input grows, the monolithic read slows down, since its attention cost is quadratic, loses accuracy well before it reaches the context window [16, 29, 24, 9], and stops at the window. Sparse attention [41, 19] and cached serving [21] make the read faster, but neither restores its accuracy or lets it read past the window.
A recent line of training-free methods, which we refer to as grid probing, reads the input differently [11, 10, 12]. Grid probing places the blocks of the input on a hypothetical K×KK{\times}K grid, asks a frozen model the same question about each row (a local span) and each column (a strided span), and pools the 2K2K answers into one answer that reflects the whole input. Because every span is short, each read stays within the range that the model handles well, which reduces the noise of long contexts and extends the reach beyond the window. Short spans also keep the key-value cache small and manageable while matching or exceeding the accuracy of the monolithic read. This comes, however, at a significant cost in speed and computation, as every span is a separate prompt that is encoded again for every question and is not reused.
Our key observation is that grid probing is attention in disguise. Each probe only decides which span of the input the question may attend to, which is exactly what an attention mask does. We therefore call grid probing emulated attention, since it reproduces an attention pattern from outside the model, one prompt at a time, and we call the same pattern run inside the attention layers of the model native attention. Figure 1 contrasts the two. Emulated attention needs only the outputs of a model, so it runs on closed models and holds a single span in memory, whereas native attention encodes the input once and reuses that encoding for every span and every question.
We introduce Factorized Context Attention (FCA, Fig. 2), a training-free block-sparse attention pattern that runs grid probing as native attention. FCA encodes the input once and stores its keys and values. It then answers each request with 2K2K masked sequences in one batched forward, each attending to one local or strided span, at positions that keep every span contiguous inside the trained range. FCA thereby inherits the accuracy, the reach and the evidence map of grid probing, while being faster and cacheable.
Across long video, long text and single images, FCA matches the accuracy of grid probing at a fraction of its time, and it gains most over the monolithic read where the input strains the model, by about 10 points on long video and 9 to 14 points on long novels. FCA also finds needles in videos of over a thousand frames and in texts four times the window, which the monolithic read cannot reach.
The main contributions of this work are summarized as follows:
•
We introduce the distinction between emulated attention, an attention pattern reproduced from outside a model through prompts, and native attention, the same pattern run inside its attention layers, and we characterize when each is the better choice.
•
We propose Factorized Context Attention, a training-free block-sparse attention pattern that runs grid probing natively from a single encoding of the input.
•
We show that FCA reproduces the local probes of grid probing up to a shift of positions, and that it keeps the s1.5s^{1.5} encoding cost of grid probing while paying it once instead of for every question.
2 Related Work
A model that reads a long context in a single pass is slow, loses accuracy as the context grows, and stops at its window. Prior work addresses this problem along three lines. The first makes the attention of the pass cheaper, the second avoids encoding the same context twice, and the third avoids reading the whole context at once.
Cheaper attention.
The first line reduces the cost of attention over a long context, with methods of two categories, (i) trained patterns, which build a sparse pattern into the model, and (ii) training-free methods, which change how a frozen model reads. In the first category, the Sparse Transformer restricts each position to a window of preceding positions and to positions at a fixed interval [5], axial attention attends along one axis of a multidimensional input at a time [15], Longformer and BigBird combine sliding windows with global tokens, with random connections in BigBird [4, 47], and recent models route each query to a subset of the context, MoBA and NSA to blocks through a block-scoring gate [26, 46] and DeepSeek-V3.2 to tokens through a learned indexer [23]. All of these patterns are part of the architecture. The model must be trained from scratch or fine-tuned with the pattern, so none of them can be applied post hoc to a frozen model. They also keep a single pass over the whole context, so they still stop at the context window. In the second category, sparse prefills approximate the monolithic read with fewer attention computations [18, 41, 19], so they keep its window limit and its accuracy loss. Streaming methods read past the window with a sliding window and a memory [40, 39], but they drop distant context or retrieve it heuristically. Position interpolation stretches the window with little or no fine-tuning [30], but it still needs one long monolithic read, whose attention cost grows with the square of the context. Efficient kernels are orthogonal to both categories, since they compute the same attention with less memory traffic [7, 6] or compile arbitrary block masks [8].
Post Black- Encode Past Evid.
Method hoc box once window map
Monolithic, prefix cache ✓\checkmark ✓\checkmark ✓\checkmark ×\times ×\times
Trained fixed patterns [5, 15] ×\times ×\times ✓\checkmark ×\times ×\times
Trained sparse attn. [26, 46] ×\times ×\times ✓\checkmark ×\times ×\times
Sparse prefill [41, 19] ✓\checkmark ×\times ✓\checkmark ×\times ×\times
Parallel encoding [31, 44] ✓\checkmark ×\times ✓\checkmark ✓\checkmark ×\times
Grid probing [11, 12], emulated ✓\checkmark ✓\checkmark ×\times ✓\checkmark ✓\checkmark
FCA (ours), native ✓\checkmark ×\times ✓\checkmark ✓\checkmark ✓\checkmark
Table 1: Positioning. Grid probing emulates an attention pattern through prompts, and FCA runs the same pattern natively. Post hoc means the method applies to a frozen model with no training. Black-box means the read needs only the model’s next-token scores. Encode once means one encoding serves every question on a context. Past window means reading contexts longer than the model’s window.
Encoding context once.
The second line leaves attention as it is and removes repeated work. Serving systems avoid encoding a shared context again for every question by caching its keys and values [21] and batching many queries over it [20]. Parallel encoding goes further. It encodes every context alone and lets one query attend to all of them at once [31, 44, 27]. No cached block has seen any other, and accuracy drops unless the cache is repaired, by recomputing tokens [45, 17], by an anchor block [1], by calibrating the attention [44], or by fine-tuning [27]. In all of these methods one query still attends to every cached block, so its attention span grows with the context and the quality of the answer depends on how well the cache is repaired. This line saves time on later questions, but each question is still one read over the whole context.
Reading in short spans.
The third line, grid probing, addresses the accuracy loss and the window limit directly, because it never lets one query read the whole context. Grid probing places the input on a K×KK{\times}K grid, asks a frozen model the same question about each row and each column, and combines the 2K2K answers. GridProbe applies it to the frames of a video and selects frames for a second pass [11], AnswerMap to the bands of an image, to map where an answer comes from [10], and Periscope to the chunks of a long text, which it reads past the window [12]. All three run at the prompt level, as emulated attention in our terms, so they read any model through its next-token scores and hold the memory of one probe. Their limitation is cost. Every probe is a separate forward pass over its own copy of its span, so the input is encoded twice for every question, no encoding is reused from one question to the next, and every later question costs as much as the first.
The three lines are complementary, and a fast factorized read needs one thing from each, the bounded local and strided spans of grid probing, the single encoding of cached serving, and a block-sparse pattern that a frozen model can run on standard kernels. Table 1 compares the approaches, and Sec. 3 builds FCA from these three parts.
3 Methodology
An attention pattern decides, for every query token, which keys it may attend to and at which positions. In every attention layer, the output at a query position tt is
ot=∑t′∈𝒜(t)softmaxt′∈𝒜(t)(qt⊤kt′d)vt′,o_{t}=\sum_{t^{\prime}\in\mathcal{A}(t)}\operatorname*{softmax}_{t^{\prime}\in\mathcal{A}(t)}\Bigl(\frac{q_{t}^{\top}k_{t^{\prime}}}{\sqrt{d}}\Bigr)\,v_{t^{\prime}}, (1)
where qtq_{t}, kt′k_{t^{\prime}}, and vt′v_{t^{\prime}} are the layer’s query, key, and value vectors, dd is the head dimension, and 𝒜(t)\mathcal{A}(t) is the set of positions that tt may attend to. The monolithic read uses the causal set 𝒜(t)={t′≤t}\mathcal{A}(t)=\{t^{\prime}\leq t\} over the whole sequence. Any other pattern can be realized on a frozen model in two ways. Emulated attention realizes the pattern from outside the model. It builds one prompt for each set, holding only the tokens that the query may attend to, and runs the model on every prompt with its ordinary causal attention. Native attention realizes the pattern inside the model. It keeps one encoding of the input and restricts 𝒜(t)\mathcal{A}(t) and the positions directly. Section 3.1 presents grid probing as emulated attention, Sec. 3.2 presents FCA, which runs the same pattern natively, Sec. 3.3 gives the positions that the native pattern needs, and Sec. 3.4 compares the two.
3.1 Emulated attention: grid probing
Let θ\theta be a frozen decoder-only model and xx a context of ss tokens, split into NN blocks x1,…,xNx_{1},\dots,x_{N}. For text a block is a chunk of cc tokens, and for video it is one frame. We set K=⌈N⌉K{=}\lceil\sqrt{N}\,\rceil and index the blocks as a K×KK{\times}K grid, block x(i−1)K+jx_{(i-1)K+j} at cell (i,j)(i,j), with cells beyond NN left empty. The ii-th local span and the jj-th strided span are
ℒi\displaystyle\mathcal{L}_{i} =(x(i−1)K+1,…,xiK),\displaystyle=\bigl(x_{(i-1)K+1},\dots,x_{iK}\bigr), (2)
𝒮j\displaystyle\mathcal{S}_{j} =(xj,xj+K,…,xj+(K−1)K),\displaystyle=\bigl(x_{j},\,x_{j+K},\dots,x_{j+(K-1)K}\bigr),
each KK blocks in reading order. A local span covers a stretch of consecutive blocks, and a strided span samples the whole context. Every block lies in exactly one local and one strided span.
A request rr is the question with its answer options, and pp is the fixed prompt that precedes the context. For a span TT, a probe reads the model’s next-token distribution after the sequence (p,T,r)(p,T,r). For options 𝒴\mathcal{Y} and an abstain option y¯\bar{y}, the probe score of option yy is its log-odds against abstaining [12],
ℓ(y∣T)=logpθ(y∣p,T,r)−logpθ(y¯∣p,T,r),\ell(y\mid T)=\log p_{\theta}(y\mid p,T,r)-\log p_{\theta}(\bar{y}\mid p,T,r), (3)
so a span without evidence scores every option low. We write Li(y)=ℓ(y∣ℒi)L_{i}(y){=}\ell(y\mid\mathcal{L}_{i}) and Sj(y)=ℓ(y∣𝒮j)S_{j}(y){=}\ell(y\mid\mathcal{S}_{j}). The pooled score and the evidence map are
score(y)\displaystyle\mathrm{score}(y) =maxiLi(y)+maxjSj(y),\displaystyle=\max_{i}L_{i}(y)+\max_{j}S_{j}(y), (4)
M[i,j]\displaystyle M[i,j] =maxy∈𝒴(Li(y)+Sj(y)).\displaystyle=\max_{y\in\mathcal{Y}}\bigl(L_{i}(y)+S_{j}(y)\bigr).
An option scores high only when some local span and some strided span both support it, and every block is scored by the two spans it lies in. The direct read-out answers argmaxyscore(y)\argmax_{y}\mathrm{score}(y). The select read-out reads the KK blocks with the highest cells of MM, in their original order, with the request, and answers or generates from that read, which encodes the chosen blocks again as one short sequence. Open-ended questions use the same read with the options Yes and No, whether the span contains the answer [12], and the select read-out then generates the answer from the blocks with the highest cells.
Grid probing computes each ℓ(⋅∣T)\ell(\cdot\mid T) with a separate forward pass over the prompt (p,T,r)(p,T,r). Inside that prompt the request attends to TT and to no other part of the context, and TT sits at consecutive positions after pp, so the 2K2K prompts emulate 2K2K attention sets with the ordinary causal attention of the model. The price is that every probe encodes its span again, for every request.
Figure 2: One layer of FCA. (a) The chunked context is reshaped into a K×KK{\times}K grid, whose rows are local spans and whose columns are strided spans, and its keys and values are stored once. A request reads each span as a masked context, in 2K2K sequences that run in one batch and whose scores are pooled into the answer. (b) The resulting attention pattern for K=4K{=}4.
3.2 Native attention: Factorized Context Attention
FCA computes the same 2K2K probes inside the model (Fig. 2). It splits the work of grid probing into two steps with two attention sets. The first step encodes the context once, and the second step answers each request from that encoding. Let 𝒫\mathcal{P} be the tokens of pp, and identify a span with the set of its tokens.
Step 1, encoding the context once. Every block lies in one local span, its row of the grid, and in one strided span, its column. FCA encodes each block together with the earlier blocks of its row. Each prompt token attends causally within 𝒫\mathcal{P}, and each token tt of a block in ℒi\mathcal{L}_{i} attends to the prompt and to the earlier tokens of its own local span,
𝒜enc(t)=𝒫∪{t′∈ℒi:t′≤t}.\mathcal{A}_{\mathrm{enc}}(t)=\mathcal{P}\cup\{t^{\prime}\in\mathcal{L}_{i}:t^{\prime}\leq t\}. (5)
The KK rows are encoded in one batched pass, and the keys and values of every layer are stored. This store is the only encoding of the context.
Step 2, answering a request. A request is answered by 2K2K short sequences, one for each span T∈{ℒ1,…,ℒK,𝒮1,…,𝒮K}T\in\{\mathcal{L}_{1},\dots,\mathcal{L}_{K},\mathcal{S}_{1},\dots,\mathcal{S}_{K}\}, which run in one batch. The sequence for TT gathers the stored keys and values of the blocks of TT and appends a copy rTr_{T} of the request. Each token uu of rTr_{T} attends to the prompt, to the gathered blocks of TT, and to the earlier tokens of rTr_{T},
𝒜T(u)=𝒫∪T∪{u′∈rT:u′≤u}.\mathcal{A}_{T}(u)=\mathcal{P}\cup T\cup\{u^{\prime}\in r_{T}:u^{\prime}\leq u\}. (6)
In a strided sequence, the request attends to all blocks of the span together, but each block was encoded with the earlier blocks of its row, not with the other blocks of its column. This is the one approximation of FCA, and Sec. 5 measures it. The model runs only over the request tokens (2K2K copies of |r||r| tokens, one per span) and reads the score ℓ(⋅∣T)\ell(\cdot\mid T) at the last token of rTr_{T}, as grid probing does. The stored keys and values of the spans are read and never changed, and the keys and values of the request copies are discarded once the scores are read. The next request is appended to the same store in the same way, so the context is encoded once for all requests.
3.3 Stair positions
In emulated attention every prompt places its span directly after pp, so every span reads as contiguous text at small positions. In native attention the positions are fixed once, at encoding, and every sequence sees a block at the position it was encoded at. With rotary position encodings [35], attention depends on the distance between positions, so the positions must make every local and every strided span read as contiguous text. Two simple assignments fail. Placing every block at the start of the context gives all blocks of a span the same positions, so the model loses their order. Placing every block at its position in the document keeps each local span contiguous, but a strided span then jumps across the whole document, and the late spans of a long context fall beyond the trained window. Stair positions place the first token of the block at cell (i,j)(i,j) at
π(i,j)=|p|+(i+j−2)σ,\pi(i,j)=|p|+(i+j-2)\,\sigma, (7)
where σ\sigma is the length in tokens of the longest block, and the tokens of the block follow consecutively. A step along a row, from (i,j)(i,j) to (i,j+1)(i,j{+}1), and a step along a column, from (i,j)(i,j) to (i+1,j)(i{+}1,j), both add σ\sigma, so every row and every column reads as contiguous text, and each block sits at the same position in its row and in its column. The copy rTr_{T} starts after the last block of its span. The largest position is about 2Kσ≈2sc2K\sigma\approx 2\sqrt{sc}, so a novel of 750k tokens in blocks of 500 tokens needs about 39k positions, inside the window of both text models we use. In a window of WW positions the stair positions therefore fit a context of up to W2/(4c)W^{2}/(4c) tokens, where the monolithic read fits WW.
Figure 3: Accuracy against time, one panel per model. Time is the mean per question, where a read that reuses its encoding of a context (FCA, the monolithic and XAttention) pays for that encoding once. The dashed link gives the speed-up of FCA over the emulated read.
3.4 Properties and trade-offs
Property Emulated Native
Accuracy, reach, map same probes same probes∗
Time, first question slower or similar similar or faster
Time, later questions as the first reuses encoding
New input encodes all again new rows only
Memory one span the whole input
Model access outputs only attention layers
Table 2: Emulated attention (grid probing) against native attention (FCA). Bold marks the better side where the two differ. ∗The strided spans of FCA are approximate (Sec. 3.2).
Every sequence of FCA is an ordinary sequence over a KV cache with a padding mask, so FCA runs on standard attention kernels [6]. Emulated and native attention compute the same probes and differ in how they pay for them (Tab. 2). Native attention gains two things from encoding the context once, in rows that do not depend on each other. First, the encoding is reused by every request, so its cost, which grows as s1.5s^{1.5} as in grid probing [12], is paid once. Second, new input becomes new rows of the grid, which are encoded at a cost that does not depend on what is already stored. Native attention pays for these gains in two ways. It keeps the encoding of the whole context in memory, as the monolithic read does, where emulated attention holds one span, and it needs the attention layers of the model, where emulated attention needs only its outputs. Emulated attention therefore suits closed models, tight memory budgets and single questions over inputs too large to keep, and native attention suits open models, inputs near or beyond the window, and repeated questions about one input.
Both kinds of attention share one property that the monolithic read lacks. Their rows and their span sequences do not depend on each other, so the work and, for native attention, the store can be divided among devices, unlike a causal pass over the whole context. Theoretically, with enough devices, the limit that remains is the position range of the model, which bounds the context at W2/(4c)W^{2}/(4c) tokens.
4 Experiments
InternVL3.5-2B Qwen3-VL-2B Qwen3-VL-8B
Acc. (%) ↑\uparrow TFLOPs ↓\downarrow TTFT (s) ↓\downarrow Acc. (%) ↑\uparrow TFLOPs ↓\downarrow TTFT (s) ↓\downarrow Acc. (%) ↑\uparrow TFLOPs ↓\downarrow TTFT (s) ↓\downarrow
Method LVB V-MME First Later Cold Warm LVB V-MME First Later Cold Warm LVB V-MME First Later Cold Warm
Monolithic 46.4 44.8 463 463 3.67 3.67 56.2 47.1 868 868 6.40 6.40 62.7 58.7 2574 2574 12.45 12.45
Monolithic, cached 46.6 44.8 463 9 3.83 0.09 56.2 47.3 868 12.1 7.06 0.14 62.6 58.9 2574 36 13.11 0.26
XAttention [41], cached 45.8 42.8 247 9 3.65 0.09 55.7 46.4 486 12.1 7.07 0.13 62.2 58.1 1663 36 12.37 0.27
GridProbe [11] 56.1 46.8 521 521 7.62 7.62 55.1 46.7 298 298 4.53 4.53 60.2 55.8 1070 1070 8.57 8.57
FCA, direct 50.8 44.8 229 80 3.43 0.62 51.7 44.8 191 76 2.87 0.59 55.8 51.8 741 359 5.88 1.66
FCA, select 56.3 45.8 341 192 4.45 1.72 56.3 47.3 378 262 5.05 2.60 62.5 56.2 1358 977 9.35 5.69
Table 3: Long-video QA. Accuracy (%) on LongVideoBench (LVB) and Video-MME long (V-MME), 144 frames, and cost per LVB question on one A100: language-model TFLOPs by GridProbe’s count and time to first token, for the first and a later question on a video. Cached reads keep a prefix cache. Bold marks the best and underline the second-best accuracy per model.
4.1 Setup
We compare three reads of the same frozen model, with the same prompt and read-out, the monolithic read as the reference, grid probing as the emulated read, and FCA as the native read. The emulated read is Periscope for text [12], GridProbe for video [11], and the strips of AnswerMap for single images [10]. XAttention [41] and Token Sparse Attention [19], two training-free sparse prefills of the monolithic read, serve as further references. Text experiments use Qwen3-4B [42] and Llama-3.1-8B [14] on InfiniteBench En.MC [48], 229 questions over novels with a median length of 150k tokens, and on SCBench [22], with blocks of c=500c{=}500 tokens. Video experiments use InternVL3.5-2B [36], Qwen3-VL-2B and 8B [2] on LongVideoBench [38] and the long split of Video-MME [13], with 144 uniformly sampled frames on a 12×1212{\times}12 grid, as in GridProbe. Image experiments follow AnswerMap with Qwen3-VL-4B on RefCOCOg [28] and TextVQA [34]. We report accuracy, the time to first token for the first question on a context (cold) and for later ones (warm), and peak GPU memory, all on one A100 80GB with FlashAttention-2 [6]. We compare with grid probing directly, since its papers already compare it with the other training-free approaches, frame selection, agentic and streaming methods on video [11] and retrieval, agent, parallel-encoding and context-memory methods on text [12], and a read that matches grid probing inherits these comparisons. Appendix gives the full setup.
4.2 Accuracy and cost
This section tests whether FCA keeps the accuracy of grid probing at a lower cost. Figure 3 shows the trade-off behind all results. Grid probing buys its accuracy with time, and the monolithic read buys its speed with accuracy once the context exceeds the range that the model reads well. FCA matches grid probing on accuracy at a fraction of its time.
On video (Tab. 3), the gain of FCA follows how much the context strains the model. InternVL3.5-2B writes every frame as 256 tokens, so 144 frames nearly fill its window and its monolithic read loses accuracy. There FCA recovers the full accuracy of GridProbe, about 10 points above the monolithic read on LongVideoBench, in less than half the time of GridProbe. Qwen3-VL reads frames near their native resolution, well inside its window, so its monolithic read stays accurate. FCA matches it on LongVideoBench, where GridProbe trails by 1 to 2 points, and only on Video-MME with Qwen3-VL-8B do both probing reads fall about 3 points behind, while both stay faster than the monolithic read on a first question. XAttention keeps the accuracy of the monolithic read but saves little time, because the vision encoder dominates the cost of a video read.
Long text shows the same pattern (Tab. 4). The select read-out of FCA stays within about a point of Periscope and 9 to 14 points above the monolithic read, and the one larger gap, in the direct read-out of Qwen3-4B, comes from the strided spans (Sec. 5). The gain appears even on novels that fit the window, because every sequence of FCA attends to only about sc\sqrt{sc} tokens, the range in which these models are accurate [16, 24]. It widens on the novels beyond the window, where the monolithic read sees only a prefix and falls to 45.5 and 64.0 while FCA stays at 70.5 and 80.0. XAttention and Token Sparse Attention add speed but not accuracy.
The speed of FCA comes from encoding each novel once. Its first request is already faster than the monolithic prefill, since its encoding attends within spans, and every later request takes a tenth to a seventh of the time of Periscope. A cached monolithic read answers a later request faster still, at its lower accuracy, and FCA generates tokens at the rate of the monolithic read.
Accuracy ↑\uparrow TTFT (s) ↓\downarrow TPOT Mem.
Method In-win. All Cold Warm (ms) (GB)
Qwen3-4B, window 262k
Monolithic 70.3 65.5 42.2 42.2 44.0 49.2
Monolithic, cached 70.3 65.1 41.9 0.4 44.2 49.3
XAttention [41], cached 71.4 65.9 23.7 0.4 44.1 67.4
Token Sparse Attn. [19] 68.1 63.8 37.9 37.9 45.4 67.3
Periscope [12], direct 80.0 79.5 18.8 18.8 – 11.7
Periscope [12], select 81.6 80.3 19.3 19.3 44.1 11.7
FCA, direct 77.3 75.1 14.3 2.3 – 42.6
FCA, select 81.1 79.0 14.8 2.9 43.8 42.6
Llama-3.1-8B, window 131k
Monolithic 74.7 67.7 19.8 19.8 33.7 36.8
Monolithic, cached 74.7 67.7 19.6 0.2 33.3 36.9
XAttention [41], cached 74.7 67.7 13.7 0.2 31.8 48.2
Token Sparse Attn. [19] 74.7 68.1 20.5 20.5 33.0 48.1
Periscope [12], direct 81.0 80.8 16.6 16.6 – 19.9
Periscope [12], select 77.2 79.5 17.2 17.2 32.2 19.9
FCA, direct 81.0 80.3 9.8 1.1 – 41.8
FCA, select 77.2 79.0 10.4 1.7 31.4 41.8
Table 4: Long-text QA on InfiniteBench En.MC. Accuracy (%) on all 229 questions and inside the window, and cost per request inside the window, on one A100. Bold marks the best and underline the second-best accuracy per column.
4.3 Reach beyond the window
This section tests whether FCA reads inputs that the monolithic read cannot hold.
Accuracy (%) by frames ↑\uparrow Time (s)
Method 144 256 576 1,024 2,025 1,024
InternVL3.5-2B, window 40,960
Monolithic, 144 frames∗ 75.9 69.0 65.5 62.1 58.6 3.4
GridProbe [11] 93.1 89.7 93.1 82.8 79.3 43.2
FCA (ours) 93.1 86.2 86.2 82.8 75.9 26.0
Qwen3-VL-2B
Monolithic read 93.9 90.9 90.9 87.9 90.9 22.2
GridProbe [11] 100.0 100.0 97.0 93.9 97.0 22.5
FCA (ours) 97.0 100.0 100.0 93.9 97.0 21.6
Table 5: Needle in a long video. Accuracy (%) on a question about one image placed as a frame of a Video-MME long video, and seconds per question at 1,024 frames, with the select read-out. Bold marks the best per model. ∗Reads 144 frames at every length, the most its window holds.

Figure 4: Needles by length and depth. Accuracy (%) of the monolithic read and of FCA, three needles per cell, with a dashed line at the window. (a) Text needles with Qwen3-4B, by context tokens. (b) Video needles with InternVL3.5-2B, by frames, over all needles. (c) Median time to first token of the first request on a text, with dotted lines at the windows. Hollow markers read only the window.
On video, an image from TextVQA [34] replaces one frame of a Video-MME long video, and the model answers a question about that image (Tabs. 5 and 4). InternVL3.5-2B fits at most 158 frames in its window, so its monolithic read samples 144 frames uniformly at every length, and these frames contain the needle less and less often. Its accuracy falls by about 17 points from 144 to 2,025 frames, while FCA stays within one or two needles of GridProbe at about 60% of its time. Qwen3-VL-2B shrinks its frames to fit, so its monolithic read degrades more gently and stays below FCA.
On text, a sentence that pairs a word with a seven-digit number is inserted into the En.MC novels, cut to 32k to 512k tokens, following RULER [16] (Tabs. 6 and 4). The monolithic read loses every needle beyond the prefix it keeps, while FCA finds nearly all of them in contexts up to four times the window, and answers two to three times faster where both reads hold the whole context. Inside the window both reads find almost every needle, with the monolithic read slightly ahead.
Match (%) ↑\uparrow TTFT (s) ↓\downarrow
Method In-window Beyond 128k 256k 512k
Qwen3-4B, window 262k
Monolithic read 97.7 45.5 31.7 112.4 113.5∗
FCA (ours) 95.5 100.0 10.7 30.6 66.4
Llama-3.1-8B, window 131k
Monolithic read 97.0 36.4 31.3 31.9∗ 33.0∗
FCA (ours) 93.9 98.5 13.5 34.7 73.4
Table 6: Needle in a haystack. String match (%) of 165 needles in contexts of 32k to 512k tokens, and median time to first token of the first request on a context, with the select read-out of FCA. Bold marks the higher accuracy per model. ∗Reads only the prefix that fits the window.
Qwen3-4B Llama-3.1-8B
Method QA MC Time QA MC Time
Monolithic, prefix cache 22.2 69.9 1.40 32.2 74.2 0.94
XAttention [41], prefix cache 19.2 69.9 1.56 32.1 74.2 0.93
Periscope [12], select 31.1 79.0 28.08 36.5 81.2 36.86
FCA (ours), select 31.5 76.4 5.69 35.6 79.9 5.12
Table 7: Multi-turn conversations on SCBench. Token F1 (%) on En.QA, accuracy (%) on En.MC, over all turns, and seconds per later En.QA turn to the full answer.
Agreement, RefCOCOg Pointing Deletion Time (s)
Method Encodes NSS ↑\uparrow AUC ↑\uparrow Dist. ↓\downarrow rr ↑\uparrow In box (%) ↑\uparrow Changed (%) ↑\uparrow First Later
Random map – −-0.05 0.485 0.189 0.049 24.8 3.8 – –
Image centre – – – 0.189 – 40.5 – – –
AnswerMap strips [10], K=8K{=}8 16 1.32 0.826 0.130 0.664 68.5 53.4 0.289 0.289
AnswerMap strips, grids 3 and 5 16 1.54 0.853 0.122 0.711 71.0 53.1 0.384 0.384
FCA bands, K=8K{=}8 1 1.38 0.777 0.118 0.731 71.5 42.5 0.217 0.143
FCA bands, grids 3 and 5 1 1.49 0.824 0.121 0.728 75.5 38.8 0.279 0.206
Table 9: Single images in AnswerMap’s protocol. Qwen3-VL-4B with the image at 512 pixels. Agreement of the map with the point the model generates on 800 RefCOCOg expressions, map expectations inside the target box on 400, and TextVQA answers that change when the map’s top 8 of 64 cells are blanked. Encodes counts image encodings per map. Time is seconds per map on 50 images and one A100, for the first question on an image and for a later question on it.
Spans Qwen Llama
Local only 6 14
Strided only 46 40
Both (default) 22 21
(a) Answers changed vs. Periscope
Encode Qwen Llama
Block alone 68.6 63.8
Local span (default) 75.1 80.3
Local and strided 78.2 79.5
(b) Encoding, direct acc.
Positions Qwen Llama
Document 72.1 48.0
Stair (default) 75.1 80.3
(c) Positions, direct acc.
Table 10: Ablations on En.MC. Each panel changes one part of FCA, on all 229 questions, with accuracy in %. Panel (a) counts the answers out of 229 that differ from Periscope. Qwen is Qwen3-4B and Llama is Llama-3.1-8B.
Match (%) by turn ↑\uparrow Seconds ↓\downarrow
Method All 1–4 5–8 9–12 13–16 Encode Turn
Llama-3.1-8B, window 131k
Monolithic 53.1 93.8 50.0 37.5 31.2 18.7 19.8
FCA (ours) 98.4 100.0 100.0 93.8 100.0 3.3 13.5
Qwen3-4B, window 262k
Monolithic 76.6 96.9 93.8 75.0 40.6 86.2 87.4
Periscope [12] 100.0 100.0 100.0 100.0 100.0 – 70.7
FCA (ours) 95.3 93.8 96.9 90.6 100.0 2.7 13.6
Table 8: Conversations with long turns. 8 conversations of 16 turns, each turn adding 32k tokens, up to 524k tokens. String match (%) of the select read-out over all turns and by turn. Encode is the seconds spent on encoding and Turn the seconds of the whole turn, both in turns 13 to 16. Periscope has no separate encoding.
4.4 Many questions on one input
This section tests whether the single encoding pays off when several questions are asked about one input, as on Video-MME with three questions per video and on LongVideoBench with about two.
On video, a later question reads the stored frames instead of encoding them again (Tab. 3), and takes a quarter to two thirds of the time of GridProbe. On text, SCBench [22] asks up to five questions about one novel, open-ended or with four options (Tab. 7). FCA keeps the accuracy of Periscope on open questions and stays within about three points of it on multiple choice, well above the monolithic read on both, and answers each later turn five to seven times faster than Periscope. A cached monolithic read remains the fastest per turn. When every turn adds new input, FCA encodes only that input, at a cost and an accuracy that stay flat where the monolithic read has lost the early turns and Periscope is five times slower (Tab. 8).
4.5 Evidence localization
This section tests whether the map of FCA finds the evidence. On single images, AnswerMap [10] asks a yes or no question about each row and column band of an image, each band shown as its own image, while FCA asks the same questions over one encoding of the whole image (Tab. 9). At K=8K{=}8 the map of FCA agrees with the point the model generates about as closely as the strips of AnswerMap (NSS 1.38 against 1.32) and lands in the target box for 71.5% of the expressions against 68.5%, from one encoding instead of 16 and in half the time for a later map. Blanking its top cells changes 42.5% of the answers, against 53.4% for the strips and 3.8% for a random map, so the map of FCA stays competitive with the strips and localizes the evidence at a fraction of their cost.
5 Ablation Study
We ablate FCA on En.MC, changing one part at a time and reporting the direct read-out, which is the output of the probes alone (Tab. 10). Table 10(a) locates the one approximation of FCA. The local spans change only 6 and 14 of the 229 answers of Periscope, while the strided spans change 46 and 40, because a strided span reads blocks that were encoded within their local spans. Table 10(b) shows how much the encoding of a block matters. Encoding a block within its local span instead of alone adds 6 to 16 points, and encoding the strided spans in their own pass as well removes the approximation and adds 3 points on Qwen3-4B, at twice the encoding cost. Table 10(c) shows that stair positions are essential. With document positions the late spans fall outside the trained position range, and Llama-3.1-8B loses 32 points. The select read-out reads the chosen blocks again and recovers most of the loss of the strided spans (Tab. 4).
6 Conclusion and Limitations
We showed that grid probing is emulated attention, an attention pattern reproduced from outside the model through prompts, and introduced FCA, which runs the same pattern natively from a single encoding of the input. Across video, text and images, FCA keeps the accuracy, the reach and the evidence maps of grid probing and answers every later request in a fraction of its time, with existing frozen models. FCA has three limitations. It needs the attention layers of an open model, it keeps the encoding of the whole input in memory, and its strided probes approximate their emulated counterparts, so emulated attention remains the better choice for closed models and tight memory budgets. Future work can train a model with the pattern, run other prompting strategies natively, and emulate other training-free attention patterns through prompts. The independent rows also allow a store that grows with a stream, is divided among devices, or is queried as an index.
Acknowledgments
We are grateful to the KAUST Academy for its generous support, and especially to Prof. Sultan Albarakati, who made this work possible. For computer time, this research used Ibex managed by the Supercomputing Core Laboratory at King Abdullah University of Science & Technology (KAUST) in Thuwal, Saudi Arabia.
References
[1] Shantanu Acharya, Fei Jia, and Boris Ginsburg. Star attention: Efficient LLM inference over long sequences. arXiv preprint arXiv:2411.17116, 2024.
[2] Shuai Bai, Yuxuan Cai, Ruizhe Chen, Keqin Chen, Xionghui Chen, Zesen Cheng, Lianghao Deng, Wei Ding, Chang Gao, Chunjiang Ge, et al. Qwen3-VL technical report. arXiv preprint arXiv:2511.21631, 2025a.
[3] Yushi Bai, Shangqing Tu, Jiajie Zhang, Hao Peng, Xiaozhi Wang, Xin Lv, Shulin Cao, Jiazheng Xu, Lei Hou, Yuxiao Dong, Jie Tang, and Juanzi Li. LongBench v2: Towards deeper understanding and reasoning on realistic long-context multitasks. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 3639–3664, 2025b.
[4] Iz Beltagy, Matthew E. Peters, and Arman Cohan. Longformer: The long-document transformer. arXiv preprint arXiv:2004.05150, 2020.
[5] Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers. arXiv preprint arXiv:1904.10509, 2019.
[6] Tri Dao. FlashAttention-2: Faster attention with better parallelism and work partitioning. In ICLR, 2024.
[7] Tri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra, and Christopher Ré. FlashAttention: Fast and memory-efficient exact attention with IO-awareness. In NeurIPS, 2022.
[8] Juechu Dong, Boyuan Feng, Driss Guessous, Yanbo Liang, and Horace He. Flex
Images from the source
![Figure 8: Evidence maps of FCA. (a, b) Map of a needle question, M[i,j]M[i,j] the sum of the Yes log-odds of local span ℒi\mathcal{L}_{i} and strided span 𝒮j\mathcal{S}_{j}, cell (i,j)(i,j) being block 23(i−1)+j23(i{-}1){+}j. (c, d) Map of a LongVideoBench question, the product of the row and column confidences, cell (i,j)(i,j) being frame 12(i−1)+j12(i{-}1){+}j. Outlined cells are read again by the select read-out.](https://arxiv.org/html/2611.32423v1/fig_maps.png)