SparseEngine:稀疏优先推理引擎

·

研究论文 · 2026/10/09

长上下文LLM智能体积累的交互历史会加重KV缓存内存和注意力计算的负担。尽管稀疏注意力能降低这些成本,但异构的缓存表示和工作流阻碍了与现有推理引擎的集成,而先前的稀疏服务抽象仅支持特定布局或工作流。我们提出SparseEngine,一个从底层构建的稀疏优先推理引擎,其共享生命周期契约让每种方法控制其KV表示和计算,同时与通用服务基础设施协调状态转换。SparseEngine支持四大类共15种方法,并通过Chain Cache实现跨请求状态管理,从保留的历史中恢复KV驱逐方法,以及可控的Prefix-Cache Pruning,在保留逻辑前缀匹配的同时从选定的历史区域移除KV。在保持方法质量的同时,SparseEngine在KV驱逐下提供超过10倍的吞吐量,在匹配并发下比vLLM解码快2.5倍以上,在智能体基准测试上实现超过2倍的端到端加速。代码见https://github.com/CURRENTF/SparseEngine。

该工作通过稀疏优先的设计解决了长上下文LLM智能体推理中的KV缓存和注意力计算瓶颈,显著提升了吞吐量和解码速度,并提供了对多种稀疏方法的统一支持,对高效推理系统研究具有重要价值。

Long-context LLM agents accumulate interaction histories that strain KV-cache memory and attention computation. Although sparse attention reduces these costs, heterogeneous cache representations and workflows hinder integration with existing inference engines, while prior sparse-serving abstractions support only specific layouts or workflows. We present SparseEngine, a ground-up, sparse-first inference engine whose shared lifecycle contract lets each method control its KV representation and computation while coordinating state transitions with common serving infrastructure. SparseEngine supports 15 methods across four categories and enables cross-request state management through Chain Cache, which resumes KV-eviction methods from retained history, and controllable Prefix-Cache Pruning, which removes KV from selected history regions while preserving logical-prefix matching. While maintaining method quality, SparseEngine delivers over 10x higher throughput with KV eviction, over 2.5x faster decoding at matched concurrency than vLLM, and over 2x end-to-end speedup on agent benchmarks. The code is available at https://github.com/CURRENTF/SparseEngine.

阅读原文

参与讨论