首页 > AI前沿 > LoSpAttn: Fast Training-Free Hybrid Attention for Vision and Diffusion Transformers

LoSpAttn: Fast Training-Free Hybrid Attention for Vision and Diffusion Transformers

arXiv机器学习 2026-12-01 13:00 8 阅读 查看原文
用户希望我把提供的纯文本新闻正文排版成语义化的HTML片段。我需要遵循以下规则: 1. 只输出HTML片段本身,不要Markdown围栏,也不要解释。 2. 每个自然段落用`

`包裹,长文用`

`或`

`划分小节。 3. 列表用`
    `/`
  • `,引用用`
    `,代码用`
    `/``,重要句子用``。
    4. 保留原文所有信息,不得增删改内容。
    5. 不要输出``、``、``等文档级标签。
    
    现在来分析需要排版的正文内容:
    
    这段文本看起来是一篇学术论文摘要。它由几个自然段落组成:
    1. "Softmax attention is central to modern vision and diffusion transformers, but its quadratic complexity in tokens remains a major computational bottleneck."
    2. "Uniformly replacing softmax attention with linear or sparse attention in large pretrained models often degrades performance, as attention rank and sparsity vary across heads and layers, and additionally across denoising timesteps in diffusion transformers."
    3. "We show that selectively exploiting these two complementary structures enables inference acceleration in large pretrained models while retaining competitive task performance, with the largest gains at long token sequences."
    4. "In particular, we propose Low-Rank and Sparse Attention (LoSpAttn), a training-free hybrid framework that uses fast, one-time calibration to select low-rank or block-sparse replacements, retaining exact softmax when neither is sufficiently accurate."
    5. "For reliable low-rank replacement, we develop a numerically stable Nystr\"om approximation using symmetric kernel lifting and preconditioning, with theoretical error guarantees for normalized attention."
    6. "Experiments on ViT-Large, DiT-XL/2, and PixArt-$\Sigma$ demonstrate inference acceleration while maintaining classification accuracy and generation quality comparable to the original pretrained models."
    7. "For example, on PixArt-$\Sigma$ at 2K resolution ($16{,}384$ tokens), LoSpAttn achieves up to $1.4\times$ end-to-end and $11\times$ attention speedup over the FlashAttention-2."
    8. "Code provided at https://github.com/J-Karthik-palaniappan/LospAttn"
    
    接下来考虑如何进行HTML结构划分:
    这看起来是完整的摘要,可以加上主标题,比如使用`

    `包裹“Abstract”或者干脆不加标题,直接把整个文本处理为段落。用户要求“每个自然段落用

    包裹,长文用

    /

    划分小节”。既然这是一段连贯的摘要,我可以将其全部包裹在`

    `中,或者将标题单独用`

    `区分开。不过原文并没有标题。如果保留原文所有信息且不增加内容,我可能只需要用`

    `来包裹每个自然段落,并在合适的位置用``高亮重要句子。 先看看原文里哪些是自然段落。在提供的文本中,它们是连续的。我可以把第一段作为背景介绍,第二段作为挑战,等等。其实,原文本可能只是一整个段落,但按照排版需求,我可以把它合理拆分为几个`

    `标签。 我来梳理一下段落拆分逻辑: 第1段:背景和瓶颈("Softmax attention is central... bottleneck.") 第2段:问题("Uniformly replacing... diffusion transformers.") 第3段:方法优势("We show that... sequences.") 第4段:核心方法("In particular, we propose... accurate.") 第5段:技术细节("For reliable low-rank... attention.") 第6段:实验验证("Experiments on ViT-Large... models.") 第7段:具体数据与代码("For example... FlashAttention-2. Code provided at...") 需要保留特殊字符:`Nystr\"om`,这应该是要保留原样的`Nystr\"om`,还是转义成`Nyström`?原文本里是`Nystr\"om`,可能是LaTeX或者转义写法,我保留原文的`Nystr\"om`即可。另外还有数学公式如`$\Sigma$`、`$16{,}384$`、`$1.4\times$`等,都保持原样。 考虑使用``来强调重要句子: - "Softmax attention is central to modern vision and diffusion transformers" 可以加粗。 - "We show that selectively exploiting these two complementary structures enables inference acceleration in large pretrained models while retaining competitive task performance" 可以加粗。 - "we propose Low-Rank and Sparse Attention (LoSpAttn)" 可以加粗。 - "we develop a numerically stable Nystr\"om approximation" 可以加粗。 代码部分:"https://github.com/J-Karthik-palaniappan/LospAttn",可以用``包裹,不过它跟前面的"Code provided at"连在一起。原文是:"Code provided at https://github.com/J-Karthik-palaniappan/LospAttn",我可以把URL用``包裹。 再重新规划一下HTML结构,确保语义清晰且符合规则: ```html

    Softmax attention is central to modern vision and diffusion transformers, but its quadratic complexity in tokens remains a major computational bottleneck.

    Uniformly replacing softmax attention with linear or sparse attention in large pretrained models often degrades performance, as attention rank and sparsity vary across heads and layers, and additionally across denoising timesteps in diffusion transformers.

    We show that selectively exploiting these two complementary structures enables inference acceleration in large pretrained models while retaining competitive task performance, with the largest gains at long token sequences.

    In particular, we propose Low-Rank and Sparse Attention (LoSpAttn), a training-free hybrid framework that uses fast, one-time calibration to select low-rank or block-sparse replacements, retaining exact softmax when neither is sufficiently accurate.

    For reliable low-rank replacement, we develop a numerically stable Nystr\"om approximation using symmetric kernel lifting and preconditioning, with theoretical error guarantees for normalized attention.

    Experiments on ViT-Large, DiT-XL/2, and PixArt-$\Sigma$ demonstrate inference acceleration while maintaining classification accuracy and generation quality comparable to the original pretrained models.

    For example, on PixArt-$\Sigma$ at 2K resolution ($16{,}384$ tokens), LoSpAttn achieves up to $1.4\times$ end-to-end and $11\times$ attention speedup over the FlashAttention-2. Code provided at https://github.com/J-Karthik-palaniappan/LospAttn

    ``` 检查是否满足所有要求: 1. 只输出HTML片段,没有Markdown围栏,没有解释。✓ 2. 每个自然段落用`

    `包裹,长文用`

    /

    `划分小节。原文较短且逻辑连贯,没有明显的小节,所以直接用`

    `即可,不需要生硬地加`

    `。✓ 3. 列表、引用、代码、重要句子处理:代码用了``,重要句子用了``。✓ 4. 保留原文所有信息,未增删改。我检查了文本内容,完全一致。✓ 5. 没有输出``/``/``等标签。✓ 有个小细节:原文中`Nystr\"om`,这个反斜杠和引号是否要保留?是的,保留原样。还有`$\Sigma$`、`$16{,}384$`等数学符号,也都保留。 看起来这个方案很完美。不需要任何多余的标签,直接输出即可。 再次检查文本,确保完全复制,没有遗漏或改动: 原文: "Softmax attention is central to modern vision and diffusion transformers, but its quadratic complexity in tokens remains a major computational bottleneck. Uniformly replacing softmax attention with linear or sparse attention in large pretrained models often degrades performance, as attention rank and sparsity vary across heads and layers, and additionally across denoising timesteps in diffusion transformers. We