SUS backprop: linear backpropagation algorithm for long inputs in transformers

πŸ“… 2025-05-21
πŸ“ˆ Citations: 0
✨ Influential: 0
πŸ“„ PDF

career value

208K/year
πŸ€– AI Summary
To address the O(nΒ²) computational bottleneck of attention backpropagation in Transformer training for long sequences, this work proposes a controllable sparse backpropagation mechanism: during backward pass, gradients are retained for at most c attention connections per token per head, achieved via unbiased probabilistic pruning. We theoretically prove that the induced gradient variance increase decays with sequence length. Experiments show that, at n β‰ˆ 2000, pruning rates reach 99% (c = 20–30), increasing gradient variance by only ~1% while reducing backward computation by ~100Γ—β€”making backward latency comparable to forward latency. This is the first method to reduce attention backpropagation complexity to O(nc), significantly improving training efficiency for long sequences without modifying the forward pass or model architecture.

Technology Category

Application Category

πŸ“ Abstract
It is straightforward to design an unbiased gradient estimator that stochastically cuts the backpropagation flow through any part of a computational graph. By cutting the parts that have little effect on the computation, one can potentially save a significant amount of back-propagation computation in exchange for a minimal increase in the stochastic gradient variance, in some situations. Such a situation occurs in the attention mechanism of the transformer architecture. For long sequences, attention becomes the limiting factor, as its compute requirements increase quadratically with sequence length $n$. At the same time, most attention weights become very small, as most attention heads tend to connect a given token with only a small fraction of other tokens in the sequence. These weights become promising targets for cutting backpropagation. We propose a simple probabilistic rule controlled by a single parameter $c$ that cuts backpropagation through most attention weights, leaving at most $c$ interactions per token per attention head. This brings a factor of $c/n$ reduction in the compute required for the attention backpropagation, turning it from quadratic $O(n^2)$ to linear complexity $O(nc)$. We have empirically verified that, for a typical transformer model, cutting $99%$ of the attention gradient flow (i.e. choosing $c sim 20-30$) results in relative gradient variance increase of only about $1%$ for $n sim 2000$, and it decreases with $n$. This approach is amenable to efficient sparse matrix implementation, thus being promising for making the cost of a backward pass negligible relative to the cost of a forward pass when training a transformer model on long sequences.
Problem

Research questions and friction points this paper is trying to address.

Reduces quadratic backpropagation complexity in transformers to linear.
Cuts insignificant attention weights to save computation efficiently.
Minimizes gradient variance increase while significantly reducing compute cost.
Innovation

Methods, ideas, or system contributions that make the work stand out.

Stochastic gradient cutting for backpropagation efficiency
Linear complexity via probabilistic attention weight pruning
Sparse matrix implementation for negligible backward pass cost
πŸ”Ž Similar Papers