RBS-Attention: Radius-Bounded Sparse Prefill for Long-Context Large Language Models
Original reporting by arXiv (cs.AI)

RBS-Attention refers to a novel, training-free sparse-prefill method designed to significantly accelerate long-context large language model (LLM) inference by efficiently processing lengthy prompts. The 'prefill' stage, where an LLM processes the entire input prompt before generating a response, poses a major computational bottleneck. While sparse block selection can reduce this cost, current methods often fall victim to 'mean dilution'—a failure mode where a block's average relevance (its centroid) can obscure highly relevant tokens amidst many irrelevant ones.
A dual-branch solution
To overcome this, RBS-Attention introduces a sophisticated dual-branch selection mechanism. A 'centroid base branch' reliably captures average relevance, while a complementary 'rescue branch' proactively identifies blocks at risk of underestimation. This rescue branch uniquely leverages the maximum key-block radius and its prompt-, layer-, and head-dependent distribution to pinpoint these critical regions. By independently thresholding and combining the masks from both branches, RBS-Attention ensures that crucial information is retained without disrupting standard block-sparse FlashAttention execution. The results are striking: on H100 GPUs, RBS-Attention achieves a 20.65x speedup for standalone prefill-attention and a 5.97x end-to-end time-to-first-token speedup at 128K context, while maintaining near-dense attention quality, registering 88.65 RULER accuracy against 89.52 for dense attention.
RBS-Attention represents a significant stride in addressing the critical prefill bottleneck plaguing long-context large language models. By intelligently employing a dual-branch selection mechanism, this training-free method delivers substantial speedups—up to 20x for prefill attention alone and nearly 6x end-to-end time-to-first-token—without materially sacrificing accuracy across diverse benchmarks. This demonstrates a robust solution to a pressing technical challenge, making the deployment of truly long-context models both more efficient and economically viable for a wider range of applications.
Expanding LLM Horizons
The implications of such efficiency gains extend far beyond mere computational convenience. Faster and cheaper prefill means that the prohibitive costs and latencies associated with processing vast amounts of information for LLMs can be dramatically reduced. This democratizes access to advanced long-context capabilities, fundamentally altering the landscape for a new generation of AI applications across various industries. Imagine AI assistants capable of instantaneously synthesizing information from entire legal libraries, comprehensive medical records, or extensive code repositories, delivering insights that were previously unfeasible due to the sheer computational overhead. This advancement not only makes existing long-context applications more practical and responsive but also unlocks entirely new use cases where real-time, deep contextual understanding is paramount. RBS-Attention thus sets a new benchmark for optimizing LLM inference, pushing the boundaries of what's achievable with current hardware and paving the way for even more sophisticated and ubiquitous AI systems capable of handling unprecedented scales of information with remarkable speed and precision.
Frequently asked questions
- What performance challenge does RBS-Attention address in large language model inference?
- RBS-Attention addresses the prefill bottleneck in long-context large language model inference. Prefill is the initial step where the entire prompt is processed by self-attention, becoming very costly for extremely long inputs. While sparse block selection aims to reduce this, it can suffer from "mean dilution," where a crucial token's importance is overlooked because its block's average relevance is low. RBS-Attention mitigates this risk by enhancing how relevant blocks are identified.
- How does RBS-Attention improve efficiency for long-context language models during inference?
- RBS-Attention improves efficiency through a training-free, dual-branch sparse prefill method. It utilizes a "centroid base branch" to capture average token relevance and a "rescue branch" to specifically identify blocks containing potentially critical, but otherwise underestimated, tokens using a radius-based mechanism. By selectively processing only the most relevant parts of a long prompt identified by these two branches, it significantly accelerates the initial "prefill" stage of inference while maintaining model quality.
- What are the key performance benefits of using RBS-Attention in large language models?
- RBS-Attention offers significant performance improvements for long-context large language models. It can achieve up to 20.65 times speedup for standalone prefill-attention and a 5.97 times speedup in end-to-end time-to-first-token at 128K context lengths on specific hardware and models. These substantial speed gains are accomplished with minimal degradation in model quality, demonstrating accuracy comparable to more resource-intensive dense attention methods across various evaluation benchmarks.