Modern large language models increasingly require long contexts for reasoning and multi-document tasks, but attention's quadratic complexity creates a severe computational bottleneck. We present Block Sparse Flash Attention (BSFA), a drop-in replacement that accelerates long-context inference while preserving model quality. Unlike methods that predict importance before computing scores, BSFA computes exact query-key similarities to select the top-k most important value blocks for each query. By comparing per-block maximum scores against calibrated thresholds, we skip approximately 50% of the computation and memory transfers for pruned blocks. Our training-free approach requires only a one-time threshold calibration on a small dataset to learn the per-layer and per-head attention score distributions. We provide a CUDA kernel implementation that can be used as a drop-in replacement for FlashAttention. On Llama-3.1-8B, BSFA achieves up to 1.13x end-to-end speedup on LongBench with only a 1.1% accuracy drop, and up to 1.24x on Needle-in-a-Haystack retrieval at a 1% accuracy drop. The attention kernel itself accelerates by up to 1.38x. We compare BSFA against five recent sparse attention baselines (SpargeAttention, MInference, FlexPrefill, XAttention, and BLASST), and verify the method on Qwen2.5-7B and on A6000 and H100 GPUs. The implementation is available at https://github.com/Danielohayon/Block-Sparse-Flash-Attention.
DNN-aided Read-voltage Threshold Optimization for MLC Flash Memory with Finite Block Length
Nanjing University of Science and Technology(南京理工大学);Nanjing University of Posts and Telecommunications(南京邮电大学);Singapore University of Technology and Design(新加坡科技设计大学)
Efficiently Dispatching Flash Attention For Partially Filled Attention Masks
University of Tübingen(蒂宾根大学);Tübingen AI Center(蒂宾根人工智能中心);ELLIS Institute Tübingen(ELLIS蒂宾根研究所);Max Planck Institute for Intelligent Systems(马克斯·普朗克智能系统研究所)
Fast Reconstruction of Exact Maxwell Dynamics from Sparse Data
Department of Computer Science, Georgetown University(乔治城大学计算机科学系);Department of Mathematics, Georgetown University(乔治城大学数学系);Department of Mathematics and Statistics, Old Dominion University(老 Dominion 大学数学与统计学系);School of Data Science, Old Dominion University(老 Dominion 大学数据科学学院);Institute Industrial IT, Department of Computer Science and Automation, OWL University of Applied Sciences and Arts(OWL 应用科学与艺术大学工业IT研究所)
Pattern-Coupled Sparse Bayesian Learning for Recovery of Block-Sparse Signals
University of Electronic Science and Technology of China(电子科技大学);Stevens Institute of Technology(史蒂文斯理工学院);Schlumberger-Doll Research Center(斯伦贝谢多尔研究中心)
Center for Security Theory and Algorithmic Research(安全理论与算法研究中心);International Institute of Information Technology - Hyderabad(海得拉巴国际信息技术研究所);Facebook(脸书);Parallel Computing Lab(并行计算实验室);Intel Labs(英特尔实验室)
Community detection in the sparse hypergraph stochastic block model
University of Washington(华盛顿大学);University of California, San Diego(加州大学圣地亚哥分校)
本文研究了稀疏随机超图中的社团检测问题。Angelini et al.(2015)证明了在由超图随机块模型生成的稀疏超图中,社区检测的模型参数存在一个尖锐的阈值。我们解决了两个块的情况下的猜想的积极的一部分:在阈值以上,有一个谱算法,渐近几乎肯定构建一个分区的超图与真正的分区。我们的方法是Massoulié(2014)为稀疏随机图开发的方法的随机超图的推广。