arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.05942cs.CL
收藏

BOSCH: 用于LLMs中短上下文注意力头选择的黑盒二进制优化

BOSCH: Black-Box Binary Optimization for Short-Context Attention-Head Selection in LLMs

Huawei Noah’s Ark Lab, Montreal Research Center, Canada(华为诺亚方舟实验室蒙特利尔研究中心)

Abbas Ghaddar, Ivan Kobyzev, Boxing Chen, Yufei Cui

AI总结:

BOSCH通过黑盒二进制优化方法,针对LLMs中的短上下文注意力头选择问题,提出了一种无需训练的解决方案,通过大规模邻域搜索分解为三个子问题,优于现有方法。

摘要:

在大规模语言模型(LLMs)的后训练混合化过程中,通常用滑动窗口注意力(SWA)替代二次自注意力以减少KV缓存使用并提高延迟。现有的混合化方案通常在层级或头级定义,通过局部到全局的静态排名。层级方案忽略了局部和全局依赖性是通过同一层内的头路由的,而静态头级排名则面临纠缠问题:头的局部/全局行为在混合化后可能发生变化。我们提出了BOSCH,一种无需训练的黑盒二进制优化方法,将问题建模为大规模邻域搜索,并将其分解为三个子问题:(i)通过小预算黑盒探测器检测层重要性;(ii)基于这些灵敏度进行自适应的每层SWA比率分配;(iii)在比率桶内进行分组头级优化。在4个从1.7B到30B参数的LLM上进行的大量实验表明,BOSCH在4种SWA比率下均优于层级启发式方法和6种强大的静态头级方法,随着SWA比率的增加,收益更大。在持续预训练中,BOSCH恢复原始长上下文性能的速度更快且更彻底。所选头的分析揭示了BOSCH在不同SWA比率下存在显著的更换,强调了为每个目标比率进行头级选择的重要性,而不是依赖固定的局部排名。

英文摘要:

Post-training hybridization of large language models (LLMs) often replaces quadratic self-attention with sliding-window attention (SWA) to reduce KV cache usage and improve latency. Existing hybridization schemes are typically defined either at the layer level (e.g., interleaving) or at the head level via static rankings from local to global. Layer-level schemes ignore that local and global dependencies are routed through heads within the same layer, while static head-level rankings suffer from entanglement: a head's local/global behavior can change after hybridization. We propose BOSCH, Black-box Binary Optimization for Short-context Head Selection, a training-free method that formulates the problem as a Large Neighborhood Search and decomposes it into three subproblems: (i) layer-importance detection via small-budget black-box probes, (ii) adaptive per-layer SWA-ratio assignment based on these sensitivities, and (iii) grouped head-level optimization within ratio buckets. Extensive experiments on 4 LLMs ranging from 1.7B to 30B parameters, across 4 SWA ratios, show that BOSCH consistently outperforms layer-level heuristics and 6 strong static head-level methods, with larger gains at higher SWA ratios. Under continual pretraining, BOSCH recover original long-context performance faster and to a higher level. Analysis of the selected heads reveals substantial turnover for BOSCH across different SWA ratios, underscoring the importance of performing head-level selection for each target ratio rather than relying on fixed locality rankings.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑