Efficient AI

SageBwd: A Trainable Low-bit Attention

JJintao ZhangMMarco ChenHHaoxu WangKKai JiangIIon StoicaJJoseph E. GonzalezJJianfei ChenJJun Zhu
Published
March 2, 2026
Authors
8
Word Count
5,317
Code
Includes code

SageBwd enables trainable INT8 attention matching full-precision performance through careful backward pass design.

Abstract

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.

Key Takeaways

  • 1

    SageBwd achieves full-precision attention performance during pre-training by keeping gradient dP in FP16 precision.

  • 2

    The dS tensor in backward pass is most vulnerable to quantization error due to its tiny magnitude scaling with sequence length.

  • 3

    QK-norm stabilization and reduced tokens-per-step enable SageBwd to match full-precision attention in large-scale pre-training.

Limitations

  • SageBwd exhibited persistent performance gap to full-precision attention during pre-training in prior work.

  • Reducing tokens-per-step to match full-precision performance may impact training efficiency and throughput.

Keywords

SageAttentionINT8 attentionattention matrix multiplicationsfine-tuning performancefull-precision attentionQK-normquantization errorsbackward-pass score gradienttokens per stepK-smoothingQ-smoothing

More in Efficient AI

View all
SageBwd: A Trainable Low-bit Attention | Paperchime