An Efficient Hybrid Sparse Attention with CPU-GPU Parallelism for Long-Context Inference

Feiyu Yao, Zhixiong Niu, Xiaqing Li, Yongqiang Xiong, Juan Fang, Qian WangarXiv 2026

TL;DR

Fluxion is an efficient hybrid sparse-attention system designed to accelerate long-context LLM inference when the Key-Value (KV) cache is offloaded to CPU memory. By dynamically predicting head-specific retrieval needs, optimizing block granularity, and scheduling tasks across the CPU and GPU in parallel, Fluxion achieves up to a 3.7× speedup over strong baselines with negligible loss in model accuracy.

What Problem Does This Paper Address?

As the context windows of Large Language Models (LLMs) expand into tens or hundreds of thousands of tokens, the Key-Value (KV) cache accumulated during decoding quickly exhausts available GPU memory (VRAM). A standard remedy is offloading the KV cache to host (CPU) memory. However, accessing this massive cache over relatively slow PCIe lanes creates a severe hardware bottleneck.

Existing sparse attention techniques generally fall into two categories:

  1. GPU-only designs: The GPU handles block selection and fetches the required KV blocks from CPU memory. Performance here remains heavily constrained by PCIe bandwidth.
  2. CPU-GPU hybrid designs: A small subset of critical tokens stays on the GPU, while the CPU computes sparse attention over the remaining host-resident KV cache.

As shown in the paper's architectural breakdown, both paradigms suffer from substantial GPU idle time because the GPU frequently stalls while waiting for PCIe transfers or serial CPU top-k selection. Fluxion addresses this inefficiency by introducing a parallelized, hardware-aware execution strategy that minimizes CPU-side overhead and maximizes CPU-GPU execution overlap.

Figure 1. Two designs for placing block-sparse attention computation within a Transformer layer.

Methods

Fluxion achieves end-to-end efficiency through a co-designed system consisting of three main components:

  • Head-Property Predictor: A lightweight, online neural network (only 0.112M parameters) that classifies attention heads at each decoding step. It identifies "streaming heads" (which only need initial and local tokens already on the GPU) and "retrieval heads" (which require explicit sparse retrieval from the CPU). For retrieval heads, it models how the required KV budget scales with block selection granularity.
  • Granularity-Budget Selector: Instead of using a rigid, fixed block size, this module dynamically calculates the optimal block size (granularity) and KV budget per head group (supporting Grouped-Query Attention, or GQA) to minimize the total volume of data accessed.
  • Priority-Based Dynamic Scheduler: Fluxion treats the CPU and GPU as independent, cooperative workers. Tasks are prioritized based on their expected data access volume and dynamically pulled from a shared queue, allowing low-cost tasks to fill execution gaps and maximizing CPU-GPU overlap.

Datasets

The head-property predictor is trained offline using data derived from LongBench V2.

To evaluate generation quality and decoding efficiency, the authors tested Fluxion across 40 distinct tasks using three major benchmarks:

  • LongBench: For realistic, long-context tasks.
  • L-Eval: For open-ended generation tasks.
  • RULER: A synthetic benchmark used for controlled stress-testing across varying context lengths (from 8K to 128K tokens) and batch sizes.

Evaluations were performed on two prominent open-source models: Llama-3.1-8B-Instruct and Qwen2.5-7B-Instruct.

Key Insights and Ideas

  • Output-Aware Budgeting > Score-Based Budgeting: Traditional sparse attention methods allocate budget by preserving a target fraction of the attention score. However, due to the "attention sink" phenomenon, tokens with high attention scores often have very small value norms, meaning they barely impact the final output. Fluxion budgets based on attention-output deviation, eliminating wasted computation on low-contribution tokens.
  • Heterogeneity of Attention Heads: Not all attention heads require full retrieval. "Streaming heads" can maintain high accuracy using only the initial tokens and a local window of recent tokens, allowing the system to completely bypass CPU-side top-k selection for these heads.
  • Granularity-Budget Coupling: Coarser block sizes reduce CPU-side top-k selection overhead but introduce higher selection error, which in turn requires a larger KV budget to maintain accuracy. Fluxion is the first to explicitly model and dynamically exploit this trade-off at runtime.

Key Results

  • Throughput Gains: Fluxion delivers a 1.5× to 3.7× TPOT (Time Per Output Token) speedup over the strongest fixed sparse hybrid baseline. Performance gains scale prominently with larger batch sizes and longer context lengths.
  • Quality Preservation: The system maintains accuracy remarkably close to full attention (FULL). On LongBench, the average score change relative to FULL is just -0.13 for Qwen and +0.02 for Llama. On L-Eval, the average drops are minor (0.24 and 0.26).
  • Enhanced GPU Utilization: Under a representative 32K-context decoding workload on Qwen, Fluxion slashes the GPU idle ratio from 70.65% down to 45.78%, proving that its priority scheduler successfully overlaps CPU and GPU execution.

Limitations and Future Work

  • Metadata Memory Overhead: Fluxion relies on uncompressed block metadata to perform top-k selection. While significantly smaller than the raw KV cache, this metadata still incurs a non-trivial memory footprint when scaling to massive contexts. Integrating metadata compression techniques is noted as a promising direction for future work.
  • Bandwidth Saturation at Extreme Scale: When context lengths scale excessively (e.g., beyond 128K), CPU local memory and PCIe bandwidth can become completely saturated. This hardware limitation can diminish the parallel efficiency of the CPU-GPU cooperative scheduling mechanism.

Summary updated

BibTeX
@misc{yao2026efficient,
  author = {Feiyu Yao and Zhixiong Niu and Xiaqing Li and Yongqiang Xiong and Juan Fang and Qian Wang},
  title = {{An Efficient Hybrid Sparse Attention with CPU-GPU Parallelism for Long-Context Inference}},
  year = {2026},
  eprint = {2605.07719},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.07719},
}
Figure