通过模拟更多注意力头提升模型性能,不增加参数量
SAS: Simulated Attention Score
- 用低维表示投影到高维,模拟更多注意力头
- 在多个数据集上显著优于多头/分组查询注意力
- 适合追求性能但受限于参数量的场景
注意力机制是Transformer的核心组件。现有方法包括多头注意力(MHA)、多查询注意力、分组查询注意力等。我们分析发现,当每头隐状态维度足够大时,增加注意力头数量可提升性能。因此,在参数开销极小的前提下,同时增加头数和每头隐状态维度,可实现显著性能提升。受此启发,我们提出模拟注意力得分(SAS),在保持紧凑模型规模的同时,模拟更大的注意力头数和更高的每头特征维度。该方法通过将低维头表示投影至高维空间,有效提升注意力容量而不增加参数量。进一步地,我们将模拟策略扩展至键和查询嵌入的特征维度,增强表达能力,同时维持原始模型大小。为控制参数成本,还提出了参数高效注意力聚合(PEAA)。在多种数据集和任务上的全面实验表明,SAS方法显著优于不同注意力变体。
原文摘要 · Abstract (English)
The attention mechanism is a core component of the Transformer architecture. Various methods have been developed to compute attention scores, including multi-head attention (MHA), multi-query attention, group-query attention and so on. We further analyze the MHA and observe that its performance improves as the number of attention heads increases, provided the hidden size per head remains sufficiently large. Therefore, increasing both the head count and hidden size per head with minimal parameter overhead can lead to significant performance gains at a low cost. Motivated by this insight, we introduce Simulated Attention Score (SAS), which maintains a compact model size while simulating a larger number of attention heads and hidden feature dimension per head. This is achieved by projecting a low-dimensional head representation into a higher-dimensional space, effectively increasing attention capacity without increasing parameter count. Beyond the head representations, we further extend the simulation approach to feature dimension of the key and query embeddings, enhancing expressiveness by mimicking the behavior of a larger model while preserving the original model size. To control the parameter cost, we also propose Parameter-Efficient Attention Aggregation (PEAA). Comprehensive experiments on a variety of datasets and tasks demonstrate the effectiveness of the proposed SAS method, achieving significant improvements over different attention variants.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。