arXiv:2603.02170cs.LGcs.AI2026-03被引 4

让8位整数注意力在训练中逼近全精度表现

SageBwd: A Trainable Low-bit Attention

  • 提出可训练的INT8注意力,量化六个矩阵乘法
  • 减少每步处理序列长度后,训练性能媲美全精度
  • 揭示梯度误差来源,明确关键稳定机制

低比特注意力(如SageAttention)虽能加速推理,但其在训练中的应用仍不明确。此前我们提出SageBwd,一种可训练的INT8注意力,在保持微调性能的同时量化了七个注意力矩阵乘法中的六个。然而,该方法在预训练阶段始终存在与全精度注意力(FPA)的性能差距。本文通过实验与理论分析发现:(i) 在每步处理大量标记时,QK归一化对训练稳定至关重要;(ii) 量化误差主要源于反向传播中的得分梯度dS;(iii) 降低每步处理的序列长度后,SageBwd在预训练中可达到与FPA相当的性能;(iv) K平滑对训练稳定性依然必要,而Q平滑在预训练中作用有限。

原文摘要 · Abstract (English)

Low-bit attention, such as SageAttention, has emerged as an effective approach for accelerating model inference, but its applicability to training remains poorly understood. In prior work, we introduced SageBwd, a trainable INT8 attention that quantizes six of seven attention matrix multiplications while preserving fine-tuning performance. However, SageBwd exhibited a persistent performance gap to full-precision attention (FPA) during pre-training. In this work, we investigate why this gap occurs and demonstrate that SageBwd matches full-precision attention during pretraining. Through experiments and theoretical analysis, we reach a few important insights and conclusions: (i) QK-norm is necessary for stable training at large tokens per step, (ii) quantization errors primarily arise from the backward-pass score gradient dS, (iii) reducing tokens per step enables SageBwd to match FPA performance in pre-training, and (iv) K-smoothing remains essential for training stability, while Q-smoothing provides limited benefit during pre-training.

低比特计算注意力机制可训练量化模型压缩

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。