Finding a few relevant keys can require examining many candidates. DoSA’s authors exploit a difference between calculating a candidate’s exact score and establishing that it cannot enter the winning set. A bound can sometimes answer the second question early. Whether that saves time depends on the expense of computing the bound as well as how many candidates it rules out.
An indexer speedup has a smaller scope than an end-to-end one
DoSA’s report distinguishes the complete indexer’s speed from time to the first output token. It gives maximum indexer speedups of 2.74 times against SGLang and 1.69 times against LiteTopK in the tested workloads. Other operations still contribute to the complete request. Even if the indexer becomes substantially faster, the visible speedup can be smaller when tokenization, other network layers or data movement occupy much of the time. Keeping the baseline name and the boundary of the timer with each number prevents a component result from becoming a system-wide claim.
How DoSA Certifies What Can Be Ignored
DoSA introduces a certificate-based framework that determines—without full computation—which key candidates can be safely rejected. Instead of scoring every key with every head, it establishes bounds on the final score using three components: a seed threshold, upper and lower projections from head activations, and geometric constraints derived from activation patterns. For positive heads, which add to the score, DoSA computes an upper bound on their contribution using nonnegative projections of dot products—this projection minimizes residual error and provides a tightest possible estimate. For negative heads, which subtract from the score, the method aggregates only a subset of their contributions, knowing that omitting more negative terms can only increase the bound. These bounds are combined to form a composite score estimate for each key, allowing early rejection when the candidate falls below the seed threshold.
The system operates in two phases: screening and refinement. Each group shares a fixed set of weights and auxiliary rows, reducing redundant computation. During this phase, only seed keys generate exact scores used to establish per-query thresholds. These thresholds remain constant throughout the screening process, enabling efficient parallel evaluation. A key is rejected if its estimated score falls below the threshold derived from the seed. Survivors are then passed into a refinement stage where full-head scoring occurs only for candidates that survive multiple bounds.
To avoid redundant memory access, DoSA reuses key data across queries through shared streams. Within a group of four queries, keys that survive at least two independent bounds and fall within a common visible range are routed to a shared stream. This reduces both memory bandwidth and total arithmetic operations. The remaining candidates use per-query streams but benefit from reduced key transfers. After refinement, each score is filtered against its query’s original threshold. Only scores above this threshold are written to output records—these records store compact monotone codes with exact key IDs, minimizing HBM traffic.
Design for Efficiency and Exactness
The architecture ensures that no valid token is lost during screening. This certification preserves exact selection while reducing computation. The GPU implementation groups queries and shares key loads efficiently, enabling high throughput with minimal idle cycles. Across English, Chinese, and code workloads, the system reduces full-head arithmetic by up to 60% in screening and cuts writeback traffic significantly. In end-to-end evaluations on GLM-5.2 and DeepSeek-V3.2, time-to-first-token improves by up to 1.94 times and 1.50 times respectively—without altering the model’s behavior or selection logic. The design balances conditional computation with strict guarantees of correctness, making it a practical step toward scalable sparse attention that operates without sacrificing fidelity.
The Core Condition of DoSA: When Screening Can Certify Exclusion
This guarantee comes through a mathematical certificate derived from bounds on head projections and residual contributions. The method establishes that for each query, a lower bound on the winning score (from a seed set of candidates) defines a threshold. For any key not meeting this threshold, a certificate proves it cannot be among the top-K selected keys, even if its full score is unknown. This certificate relies on nonnegative head projections and activation-informed aggregation to upper-bound positive contributions and bound negative head effects. The condition holds pointwise across data-dependent support, meaning that for any input configuration, if the certificate evaluates to zero or below at a key, that key cannot win. Crucially, this does not require full score computation—only the bounds are evaluated during screening.
Speedup Across Context Lengths and Workloads
The speedup in end-to-end inference time (time-to-first-token) reached up to 1.94 times over SGLang and 1.50 times over LiteTopK for GLM-5.2, and similarly improved performance on DeepSeek-V3.2. These gains were most pronounced at longer contexts, where the number of keys each query must evaluate grows significantly. In contrast, increasing prefill chunk size (e.g., from 4K to 32K) had a smaller effect on speedup, suggesting that DoSA’s benefit stems primarily from reducing work along the long key dimension rather than from batching efficiency.
The method was tested across three domains: English books, Chinese texts, and code samples drawn from InfiniteBench. For each domain, the system maintained exact selection—meaning that only the true top-K candidates were selected, with no false positives or negatives. The GPU implementation achieved up to 2.74 times faster complete-Indexer performance compared to SGLang and 1.69 times over LiteTopK. This acceleration was sustained across all input types, indicating robustness in diverse linguistic and structural patterns.
Computational Efficiency Gains
The results of DoSA must be interpreted as computational efficiency gains, not improvements in model accuracy or task performance. The paper does not claim that generated text is more accurate or contextually richer; rather, it shows that the underlying indexing process—where models decide which past tokens to attend to—is faster and less memory-intensive. The observed speedups are measured in time-to-first-token and complete-Indexer execution, not in downstream task success rates.
The gains are conditional on the strength of the certificate bounds. In short contexts or when bounds are loose, screening may not yield sufficient savings to offset its own computational cost. Similarly, if the initial seed set fails to provide a tight lower bound on the winning score, the certificate’s power weakens, and more keys must be processed fully. This means that DoSA performs best in long-context scenarios where screening can reliably eliminate large portions of the key space.
Another limitation is that while DoSA avoids full-score computation for excluded keys, it still scans every key during screening. Thus, the total number of key evaluations per query remains high, but the arithmetic and memory traffic from full-head scoring are reduced. This tradeoff is reflected in the analysis: screening reduces score evaluation, while dense intermediate results still consume HBM bandwidth—though DoSA mitigates this through compact writeback.
This means that even if a key is correctly rejected or retained, the final generated text might differ slightly due to differences in score computation paths. However, this does not undermine the method’s computational value—it simply highlights that efficiency and exactness are separate concerns.
In sum, DoSA demonstrates that sparse attention can be made faster without sacrificing selection accuracy by using mathematical bounds to certify what can be ignored. The results show clear performance improvements under realistic workloads, especially as context length increases. But readers must understand that these gains reflect optimization of the indexing pipeline—not a shift in model behavior or output quality.
The Boundary of What Can Be Certified in Sparse Attention
DoSA establishes a clear boundary: it can certify exclusion only when the negative head contributions are sufficiently bounded and their aggregate behavior is predictable from activation patterns. This boundary hinges on whether the seed activation patterns provide enough signal to lower-bound the omitted negative contributions. If the model’s attention heads exhibit consistent, measurable cancellation across keys—especially in deep layers—the certificate becomes tight and reliable. However, when activation patterns vary widely or are sparse, the bounds become loose, and the certification fails to exclude candidates with high probability. The evidence shows that removing negative aggregation increases candidate survival from 2.65% to 95.06%, demonstrating that negative head contributions are essential for effective pruning. This suggests a hard boundary: without activation-informed support, even in layers where geometric separation is present, the certificate cannot reliably reject most keys.
A Comparison Between Screening and Sparse Writeback in Practice
The ablation study reveals a critical distinction between screening (early rejection based on certificate bounds) and sparse writeback (delayed, selective storage of key values). This suggests that screening is more effective at reducing work in the early stages of indexing, where candidate selection occurs before full scoring begins. Sparse writeback, by contrast, reduces memory bandwidth and write operations later in the process but does not eliminate the need to evaluate many keys. The difference in performance between these two components shows that screening provides a stronger reduction in computational load because it eliminates candidates before they are even considered for full evaluation. A competing explanation might argue that sparse writeback is more efficient due to reduced memory pressure, but the data show that screening reduces the number of keys evaluated at each layer, which directly impacts indexing time.
Score Geometry Across Layers
Despite strong evidence that pruning effectiveness increases with layer depth—where most keys lie far below the Top-K boundary—the exact mechanism by which score geometry evolves across layers remains underexplored. In particular, it is not clear whether this geometric shift arises from changes in head activation patterns or from deeper model structures that amplify or suppress attention weights differently. Yet this pattern could be explained by either structural changes in the model or by differences in query geometry across layers. A test to distinguish between these would require analyzing head activation distributions at each layer independently—specifically whether negative contributions become more predictable and aligned with positive projections as depth increases. Conversely, if activation patterns remain random or uncorrelated across layers, then the improvement may stem from other factors like query length or indexing frequency rather than intrinsic model geometry. This open question remains unresolved because current analysis focuses on aggregate pruning rates and does not isolate the role of per-head activation dynamics.
Pruning by Per-Key Bounds: A Mechanism Beyond Block-Level Aggregation
Classical document retrieval systems like MaxScore and WAND rely on block-level upper bounds to skip scoring entire document segments—only if every key in a block is known to fall below a threshold. These methods are efficient because they avoid processing irrelevant content en masse, but their bounds are inherently loose: a block-level bound must cover all keys within it, even those that are far below the top-k cutoff. This leads to over-rejection or inefficient pruning when individual keys have very different relevance scores.
DoSA applies this same principle—pruning through upper bounds—but instead of working at the level of entire key blocks, it operates on a per-key basis using geometric and activation-aware reasoning. Rather than requiring that all keys in a group be bounded below a threshold, DoSA computes tighter, key-specific bounds by analyzing how query heads interact with negative head projections and positive head contributions. This allows the system to reject individual keys before full scoring, even when they are located within a broader context where some other keys remain competitive.
A key insight emerges from this shift: in traditional block-level pruning, a candidate might be rejected because its entire block is below threshold—even if one key inside that block has a strong signal. In contrast, DoSA’s per-key bounds exploit the structure of activation patterns across heads. For example, if a negative head consistently suppresses certain keys (e.g., via large negative projections), and this suppression can be quantified through activation frequencies, then those keys can be safely excluded without needing full multi-head computation.
WAND would reject every key in these blocks, assuming the block-level bound is sufficient. But if one key per block has a high positive projection from a specific head, and that head’s activation pattern is known to be rare or weak, then DoSA can compute a tighter, per-key upper bound based on that head’s behavior—allowing it to reject most keys while preserving the one with strong signal.
In Scenario B, keys are distributed more sparsely. DoSA, however, uses activation-informed aggregation to estimate the negative contribution of each key—based on how frequently heads activate in response to query patterns—and can confidently reject the majority of keys that fall below a dynamically derived threshold.
This contrast reveals a critical difference: WAND’s pruning is conservative and uniform across blocks, while DoSA’s is adaptive and sensitive to local activation geometry. The former may miss opportunities for early rejection due to its block-level constraints; the latter leverages query-specific head behavior to identify which keys can be safely ignored. This mechanism is especially effective in long-context settings where key density grows exponentially—because each new key must be evaluated against a growing set of potential candidates.
The experiment behind this insight comes from DoSA’s certificate component ablation, where removing negative aggregation leads to a candidate survival rate jumping from 2.65% to 95.06%. This shows that without the negative head contributions—used to form tight per-key bounds—the system loses its ability to reject most keys early. The result is not just faster indexing; it’s a shift in how attention selection works: instead of evaluating every key, the model uses geometric reasoning to certify which ones can be ignored with mathematical certainty.
This mechanism underscores that sparse attention does not require full scoring for all candidates—it only needs sufficient evidence to reject each one. And that evidence comes not from global thresholds, but from local activation patterns and head-level interactions.
A Hypothetical Scenario to Understand DoSA’s Indexer Speedup
Imagine a language model processing a user query about a software bug in Python. Two different indexing strategies are applied: one using standard dense attention (called “Dense”), and another using DoSA’s sparse attention method with a certified threshold mechanism (“DoSA”). Both systems evaluate all keys during the initial indexer phase, but DoSA only computes full scores for candidates that remain eligible based on mathematical bounds derived from activation patterns. The timer measures only the time taken by the indexer to produce its first output token—the moment when the model begins generating text—while the complete indexer speed is tracked separately as the total time spent computing and filtering candidate keys.
In this setup, the observed results could vary depending on how tightly the screening bounds are set. This shows a clear speedup because the majority of keys are ruled out without full scoring.
In Outcome B, however, the bounds are too loose—perhaps due to a poorly tuned activation estimate. This illustrates a critical limitation: even if the indexer itself runs faster, the full request time depends on other operations like tokenization and data movement. If these dominate the timeline, the visible speedup can be small or negligible.
These two outcomes highlight how DoSA’s performance is not system-wide but conditional. The gain in indexer speed—up to 2.74 times over SGLang—is real and measurable in isolated computation, but it does not automatically translate into faster end-to-end response times. This distinction is vital because the full request includes tokenization, memory transfers, and processing through subsequent layers of the model.
Why Screening Must Be Paired with Efficient Execution
The core insight from DoSA’s design is that sparse attention doesn’t just skip scoring—it intelligently decides when to compute it. The method uses activation-informed bounds to prove that certain keys can be safely rejected before full evaluation. This reduces redundant work, especially in long contexts where dense scoring becomes computationally expensive. However, if the screening step itself takes too much time—especially with short inputs or weak bounds—it may not pay off.
For instance, in a short query like “What is 2+2?” (just 6 tokens), the pruning mechanism might require evaluating many keys because the bounds are too loose to rule out candidates. In such cases, DoSA’s indexer speedup could be offset by the cost of screening, leading to no net gain in TTFT. Here, the cumulative benefit from reduced head evaluations and compact writeback becomes visible.
Moreover, DoSA’s design avoids the trade-offs seen in other methods. Dense attention eliminates scoring entirely but keeps full intermediate results in high-bandwidth memory (HBM), which slows down data movement. In contrast, LiteTopK reduces score traffic through fusion but still performs full multihead computations. DoSA removes this remaining work by combining screening with exact selection—only scores that pass the certificate are written back and used for final decisions.
Still, the evidence does not prove improved model accuracy or better task performance. The speedups reflect computational efficiency, not intelligence gains. In practice, the real-world impact of DoSA depends on input length, domain (e.g., code vs. natural language), and how well activation patterns can inform pruning decisions.
The DoSA results demonstrate progress in one component—but the full picture requires measuring not just indexer speed, but also where time is actually spent across the entire request pipeline.


