Gebt mir FP32 oder gebt mir den Tod? Herausforderungen und Lösungen für reproduzierbare Schlussfolgerungen
Give Me FP32 or Give Me Death? Challenges and Solutions for Reproducible Reasoning
June 11, 2025
Autoren: Jiayi Yuan, Hao Li, Xinheng Ding, Wenya Xie, Yu-Jhe Li, Wentian Zhao, Kun Wan, Jing Shi, Xia Hu, Zirui Liu
cs.AI
Zusammenfassung
Große Sprachmodelle (LLMs) sind mittlerweile in verschiedenen Bereichen unverzichtbar und haben beeindruckende Leistungen gezeigt. Der Fortschritt beruht jedoch auf der Voraussetzung, dass Benchmark-Ergebnisse sowohl genau als auch reproduzierbar sind. Wir zeigen, dass die Reproduzierbarkeit der Leistung von LLMs fragil ist: Änderungen der Systemkonfiguration, wie z. B. die Batch-Größe bei der Auswertung, die Anzahl der GPUs und die GPU-Version, können signifikante Unterschiede in den generierten Antworten hervorrufen. Dieses Problem ist besonders ausgeprägt bei Modellen, die auf logischem Schlussfolgern basieren, bei denen geringfügige Rundungsunterschiede in frühen Tokens zu divergenten Gedankenketten führen können, was letztendlich die Genauigkeit beeinflusst. Beispielsweise kann ein Modell wie DeepSeek-R1-Distill-Qwen-7B unter bfloat16-Präzision mit Greedy-Decoding eine Variation der Genauigkeit von bis zu 9 % und eine Differenz von 9.000 Tokens in der Antwortlänge aufweisen, bedingt durch Unterschiede in der GPU-Anzahl, dem GPU-Typ und der Batch-Größe bei der Auswertung. Wir führen die Ursache dieser Variabilität auf die nicht-assoziative Natur der Gleitkommaarithmetik bei begrenzter numerischer Präzision zurück. Diese Arbeit stellt die erste systematische Untersuchung dar, wie numerische Präzision die Reproduzierbarkeit bei der Inferenz von LLMs beeinflusst. Durch sorgfältig kontrollierte Experimente über verschiedene Hardware-, Software- und Präzisionseinstellungen hinweg quantifizieren wir, wann und wie sich Modellausgaben unterscheiden. Unsere Analyse zeigt, dass die Gleitkommapräzision – obwohl entscheidend für die Reproduzierbarkeit – in der Evaluierungspraxis oft vernachlässigt wird. Inspiriert davon entwickeln wir eine leichtgewichtige Inferenz-Pipeline, genannt LayerCast, die Gewichte in 16-Bit-Präzision speichert, aber alle Berechnungen in FP32 durchführt, wodurch Speichereffizienz und numerische Stabilität in Einklang gebracht werden. Der Code ist verfügbar unter https://github.com/nanomaoli/llm_reproducibility.
English
Large Language Models (LLMs) are now integral across various domains and have
demonstrated impressive performance. Progress, however, rests on the premise
that benchmark scores are both accurate and reproducible. We demonstrate that
the reproducibility of LLM performance is fragile: changing system
configuration such as evaluation batch size, GPU count, and GPU version can
introduce significant difference in the generated responses. This issue is
especially pronounced in reasoning models, where minor rounding differences in
early tokens can cascade into divergent chains of thought, ultimately affecting
accuracy. For instance, under bfloat16 precision with greedy decoding, a
reasoning model like DeepSeek-R1-Distill-Qwen-7B can exhibit up to 9% variation
in accuracy and 9,000 tokens difference in response length due to differences
in GPU count, type, and evaluation batch size. We trace the root cause of this
variability to the non-associative nature of floating-point arithmetic under
limited numerical precision. This work presents the first systematic
investigation into how numerical precision affects reproducibility in LLM
inference. Through carefully controlled experiments across various hardware,
software, and precision settings, we quantify when and how model outputs
diverge. Our analysis reveals that floating-point precision -- while critical
for reproducibility -- is often neglected in evaluation practices. Inspired by
this, we develop a lightweight inference pipeline, dubbed LayerCast, that
stores weights in 16-bit precision but performs all computations in FP32,
balancing memory efficiency with numerical stability. Code is available at
https://github.com/nanomaoli/llm_reproducibility.