首页 > AI前沿 > QASparse: Query-Adaptive Sparse Attention with Tailored Budgets and Tokens

QASparse: Query-Adaptive Sparse Attention with Tailored Budgets and Tokens

arXiv机器学习 2026-11-22 14:57 8 阅读 查看原文
用户要求将一段纯文本新闻(实际上是技术摘要/新闻)排版成语义化的HTML片段。 规则: 1. 只输出HTML片段本身,不要Markdown围栏、不要解释。 2. 每个自然段落用`

`包裹,长文用`

`/`

`划分小节。 3. 列表内容用`
  • `,引用用`
    `,代码用`
    `,重要句子可用``。
    4. 保留原文所有信息,不得增删改内容。
    5. 不要输出``/``/``等文档级标签。
    
    原文内容分析:
    原文是一段连续的英文文本,没有明显的段落划分,也没有列表、引用、代码。需要将其合理划分为段落,并添加适当的标题和强调。
    
    原文:
    "Long-sequence inference in large language models is constrained by the high cost of prefilling, where dense attention scales quadratically with context length. Exploiting similarity across attention heads offers a way to reduce redundant computation. Prior approaches in this direction have relied on localized query observations to determine head-level computation reuse or budget allocation. However, inter-head similarity does not imply uniform query requirements, leaving adaptation to varying budget needs and selection preferences across query regions a key challenge. We introduce QASparse, a Query-Adaptive Sparse attention mechanism with hardware-efficient execution. QASparse preserves the efficiency of shared cross-head importance estimation while adapting computational budgets and token selections to query requirements, and it executes these dynamic sparse decisions through dedicated kernels. Its query adaptivity stems from two complementary innovations: Local Budget Regression models local variations in computational demand along query positions to estimate budgets for different query regions and attention heads; Boundary Voting lets queries within each head vote over candidates near the selection cutoff using actual query/key scores, refining the retained set while preserving the initial selection size. To reduce the execution overhead of dynamic budgets, we further design length-specialized selection kernels that efficiently support query-adaptive sparse patterns across context lengths. Together, these designs efficiently combine shared estimation with local decisions while adapting both how much attention is computed and which interactions are retained. Experimental results demonstrate improved benchmark scores and faster prefill attention computation compared with existing sparse attention baselines."
    
    可以划分为以下几个部分:
    标题(H2):比如 QASparse: Query-Adaptive Sparse Attention for Long-Sequence Inference (不行,不能增删改内容,所以不能用原文没有的词作为标题,或者可以用原文里的句子做标题?规则说“不得增删改内容”,如果加标题算不算增?最好把原文的第一句话或者核心概念作为H2/H3,或者不强制加标题,只划分段落。但规则说“长文用

    /

    划分小节”,为了安全,把原文分成几个自然段,并用原文中的短语做小节标题,或者直接不使用h2/h3,只用p。不过规则说“长文用

    /

    划分小节”,这里算长文。 我们可以把原文拆分为几个自然段: 段落1:Long-sequence inference ... key challenge. 段落2:We introduce QASparse ... dedicated kernels. 段落3:Its query adaptivity stems from two complementary innovations: Local Budget Regression ... initial selection size. 段落4:To reduce the execution overhead ... across context lengths. 段落5:Together, these designs ... sparse attention baselines. 关于标题:如果不用原文的词,可能会被认为“增”。如果用原文的词做标题,比如 `

    QASparse

    `,原文中有 "We introduce QASparse",这不算增删改内容,只是提取。或者干脆不用h2/h3,只用p,因为原文本身没有小节。但规则提到“长文用

    /

    划分小节”,最好加几个。 比如:

    Background and Challenge

    (这算增加了内容,违反“不得增删改内容”)。 所以,尽量用原文的短语。

    Prefilling Cost and Inter-Head Similarity

    (还是增加了)。 最安全的做法:不添加任何原文没有的标题文字,直接按自然段用 `

    ` 包裹。如果必须用 `

    /

    `,可以用原文中的句子作为标题,但这有点奇怪。 或者,把原文的首句作为 `

    `? `

    Long-sequence inference in large language models is constrained by the high cost of prefilling, where dense attention scales quadratically with context length.

    ` 这不太符合标题的常规,但绝对没有增删改内容。 其实,规则说“长文用

    /

    划分小节”,并没有强制说必须有,或者标题文字必须怎样。我可以把原文合理分段,每段用 `

    `,对于核心方法的部分用 `

    ` 包裹原文中的关键句。 比如:

    Long-sequence inference in large language models is constrained by the high cost of prefilling, where dense attention scales quadratically with context length. Exploiting similarity across attention heads offers a way to reduce redundant computation. Prior approaches in this direction have relied on localized query observations to determine head-level computation reuse or budget allocation. However, inter-head similarity does not imply uniform query requirements, leaving adaptation to varying budget needs and selection preferences across query regions a key challenge.

    We introduce QASparse, a Query-Adaptive Sparse attention mechanism with hardware-efficient execution. QASparse preserves the efficiency of shared cross-head importance estimation while adapting computational budgets and token selections to query requirements, and it executes these dynamic sparse decisions through dedicated kernels.

    Two Complementary Innovations

    (不行,增了词,原文是 "two complementary innovations:") 可以用 `

    Its query adaptivity stems from two complementary innovations: Local Budget Regression models local variations in computational demand along query positions to estimate budgets for different query regions and attention heads; Boundary Voting lets queries within each head vote over candidates near the selection cutoff using actual query/key scores, refining the retained set while preserving the initial selection size.

    ` 这样完全没增删。但这样标题太长了。 其实,不使用 h2/h3 也是可以的,因为原文本身没有明显的小节结构,只用 `

    ` 和 `` 也能满足“每个自然段落用

    包裹”,而“长文用

    /

    划分小节”是条件性的(如果是长文且需要划分)。为了稳妥,我把第一句话作为 h2,或者干脆不用 h2/h3,只用 p。 等等,如果我用原文的词做标题:

    QASparse

    原文有 "QASparse"。

    Innovations

    原文没有 "Innovations"(只有 "innovations")。 不如直接分段,不加 h2/h3,或者把段落标题用原文的词汇组合,但这可能违反“不得增删改”。 最严格的理解:“保留原文所有信息,不得增删改内容”意味着输出的文本内容(剔除HTML标签后)必须和原文一字不差(除了标点可能保留原样)。 如果加了 `

    Background

    `,就增加了 "Background",这就违反了规则。 因此,绝对不能添加原文中没有的词语作为标题。 如果必须用 `

    /

    `,只能把原文中已有的句子或短语放进去。 例如:

    We introduce QASparse, a Query-Adaptive Sparse attention mechanism with hardware-efficient execution.

    这虽然语法上像标题,但完全保留了原文,没有增删。 或者,干脆不使用 `

    /

    `,只使用 `

    `。规则说“长文用

    /

    划分小节”,并没有说“必须用”。如果我认为这段不算特别长(大概300词),只使用 `

    ` 也是可以的。但为了体现排版能力,我可以把某些核心句子用 `

    ` 或 `

    ` 包裹,只要文字是原文的。 比如:

    Long-sequence inference in large language models is constrained by the high cost of prefilling, where dense attention scales quadratically with context length.

    Exploiting similarity across attention heads offers a way to reduce redundant computation. Prior approaches in this direction have relied on localized query observations to determine head-level computation re