Pourquoi l'entraînement des Transformers en basse précision échoue : Une analyse sur l'attention Flash
Why Low-Precision Transformer Training Fails: An Analysis on Flash Attention
October 5, 2025
papers.authors: Haiquan Qiu, Quanming Yao
cs.AI
papers.abstract
La quête d’efficacité computationnelle a favorisé l’adoption de formats de faible précision pour l’entraînement des modèles de transformateurs. Cependant, ces avancées sont souvent entravées par des instabilités d’entraînement notoires. Cet article propose la première explication mécaniste d’un cas d’échec ancien et non résolu, où l’entraînement avec l’attention flash en faible précision conduit à des explosions catastrophiques de la perte. Notre analyse approfondie révèle que cet échec n’est pas un artefact aléatoire, mais est causé par deux phénomènes imbriqués : l’émergence de représentations de faible rang similaires au sein du mécanisme d’attention et l’effet cumulatif des erreurs d’arrondi biaisées inhérentes à l’arithmétique de faible précision. Nous démontrons comment ces facteurs créent un cercle vicieux d’accumulation d’erreurs qui corrompt les mises à jour des poids, finissant par déstabiliser la dynamique d’entraînement. Pour valider nos conclusions, nous introduisons une modification minimale de l’attention flash qui atténue le biais des erreurs d’arrondi. Ce changement simple stabilise le processus d’entraînement, confirmant notre analyse et offrant une solution pratique à ce problème persistant.
English
The pursuit of computational efficiency has driven the adoption of
low-precision formats for training transformer models. However, this progress
is often hindered by notorious training instabilities. This paper provides the
first mechanistic explanation for a long-standing and unresolved failure case
where training with flash attention in low-precision settings leads to
catastrophic loss explosions. Our in-depth analysis reveals that the failure is
not a random artifact but caused by two intertwined phenomena: the emergence of
similar low-rank representations within the attention mechanism and the
compounding effect of biased rounding errors inherent in low-precision
arithmetic. We demonstrate how these factors create a vicious cycle of error
accumulation that corrupts weight updates, ultimately derailing the training
dynamics. To validate our findings, we introduce a minimal modification to the
flash attention that mitigates the bias in rounding errors. This simple change
stabilizes the training process, confirming our analysis and offering a
practical solution to this persistent problem.