Fuzzy PyTorch: Rapid Numerical Variability Evaluation for Deep Learning Models
Inés Gonzalez-Pepe [email protected], Hiba Akhaddar [email protected], Tristan Glatard [email protected], Yohan Chatelain [email protected] · 2026
Read Fuzzy PyTorch: Rapid Numerical Variability Evaluation for Deep Learning Models by Inés Gonzalez-Pepe [email protected], Hiba Akhaddar [email protected], Tristan Glatard [email protected], Yohan Chatelain [email protected] (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2605-25991.txt.
Introduction
Gonzalez-Pepe, Akhaddar, Glatard and Chatelain measure how floating-point rounding makes deep-learning results wobble. Their Fuzzy PyTorch tool adds stochastic arithmetic to PyTorch through a new library linked to Verificarlo, a numerical analysis compiler. It offers a stochastic rounding mode plus a novel up-down mode. Tests show model performance holds while runtimes fall five to sixty times against Verrou, the leading rival tool. The aim is fast, reliable variability checks with little code change.
Catalog record
| CREATOR | Inés Gonzalez-Pepe [email protected], Hiba Akhaddar [email protected], Tristan Glatard [email protected], Yohan Chatelain [email protected] |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 44478 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2605.25991
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Fuzzy PyTorch: Rapid Numerical Variability Evaluation for Deep Learning Models Inés Gonzalez-Pepe [email protected], Hiba Akhaddar [email protected], Tristan Glatard [email protected], Yohan Chatelain [email protected] Abstract We introduce Fuzzy PyTorch, a framework for rapid evaluation of numerical variability in deep learning (DL) models. As DL is increasingly applied to diverse tasks, understanding variability from floating-point arithmetic is essential to ensure robust and reliable performance. Tools assessing such variability must be scalable, efficient, and integrate seamlessly with existing frameworks while minimizing code modifications. Fuzzy PyTorch enables this by integrating stochastic arithmetic into PyTorch through Probabilistic Rounding with Instruction Set Management, a novel library interfacing with Verificarlo, a numerical analysis compiler. The library offers stochastic rounding mode and a novel mode; up-down rounding. Comparative evaluations show Fuzzy PyTorch maintains model performance and achieves runtime reductions of 5 × 5\times to 60 × 60\times versus Verrou, a state-of-the-art tool. We further demonstrate scalability by running models from 1 to 341 million parameters, confirming applicability across small and large DL architectures. Overall, Fuzzy PyTorch provides an efficient, scalable, and practical solution for assessing numerical variability in deep learning, enabling researchers and practitioners to quantify and manage floating-point uncertainty without compromising performance or computational efficiency. 1 Introduction Many scientific domains have increasingly adopted deep learning (DL) models for computational analysis. However, these models often rely on numerical computations that are sensitive to variations in floating-point precision and rounding modes. Understanding numerical variability in DL models is therefore essential for ensuring reliable and reproducible outcomes. This is particularly critical in high-stakes applications such as medical imaging ( 18 ; 26 ; 49 ) , remote sensing ( 48 ) , and scientific simulations ( 10 ) . Meanwhile, the importance of numerical variability is beginning to gain industry-wide recognition. For example, variability analysis is now supported in Amazon Web Services’ (AWS) Neuron SDK ( 3 ) , AWS Trainium chips, AMD MI300 GPUs, Tesla D1s and Blackwell architecture NVIDIA GPUs ( 20 ) . This reflects a growing demand for tools and frameworks that enable low-level control over numerical behavior in AI systems. Although exact methods such as interval arithmetic ( 31 ) , symbolic execution ( 46 ) , and formal verification ( 5 ) exist to evaluate numerical accuracy, these approaches often require extensive modifications to the codebase and do not scale efficiently to complex deep learning workloads. Instead, we adopt stochastic arithmetic, a technique that introduces controlled random perturbations to floating-point operations. This enables statistical estimation of the numerical variability without modifying the underlying model architecture, making it more practical for large-scale applications. Stochastic arithmetic encompasses various techniques, including Monte Carlo Arithmetic (MCA) ( 43 ) , CESTAC ( 8 ) and Stochastic Rounding ( 24 ) . To leverage stochastic arithmetic, researchers have developed tools such as Verificarlo ( 17 ) , Verrou ( 23 ) , the stochastic rounding library by Fasi and Mikaitis ( 22 ) and CADNA ( 34 ) . While stochastic arithmetic has been widely explored in numerical analysis, it remains underused in deep learning, despite recent studies demonstrating its potential to assess uncertainty in neural network training and inference ( 21 ; 35 ; 4 ; 2 ) . A major practical challenge of stochastic arithmetic is the need to run programs multiple times, typically 10 times or more, to obtain stable statistical estimates of their variability. However, currently available stochastic arithmetic tools, especially Verrou, one of the more accessible stochastic arithmetic frameworks for DL, introduce slowdowns of 10× to 1000× on DL models with only a few million parameters. In such settings, collecting enough samples takes days or weeks, even with parallelization, and scaling these analyses to modern large language models becomes effectively infeasible. For numerical variability research to keep pace with rapidly growing DL architectures, it is therefore essential to develop tools that introduce minimal computational overhead. This motivates the design goals of Fuzzy PyTorch, which prioritizes speed and scalability so that numerical variability studies remain tractable even on increasingly large models. Fuzzy PyTorch integrates stochastic arithmetic, more specifically Monte Carlo Arithmetic (MCA), into the PyTorch framework through a novel library named P robabilistic R ounding with I nstruction S et M anagement (PRISM). PRISM implements two modes: stochastic rounding (SR) and Up-Down rounding (UD). SR bypasses exact operations and therefore preserves exact values by probabilistically rounding values based on their proximity to representable floating-point numbers. Meanwhile, UD is a newly proposed rounding mode that is faster at the level of individual operations, as it randomly rounds up or down with equal probability. Both modes are optimized using vectorized CPU instructions through the Highway library ( 27 ) , minimizing computational overhead. Fuzzy PyTorch seamlessly integrates with PyTorch by extending the Verificarlo compiler, providing a fast, practical framework for numerical variability analysis in deep learning. By integrating directly with the PyTorch execution pipeline and avoiding the major bottlenecks present in traditional approaches, such as the strict serialization in Verrou or the lack of vectorized support in CADNA and standard MCA, Fuzzy PyTorch enables full-scale analyses that were previously computationally prohibitive. Compared to state-of-the-art tools, Fuzzy PyTorch achieves similar numerical-error characteristics but with markedly lower runtime, allowing researchers to evaluate numerical variability across full DL workflows. This efficiency makes large-scale, systematic studies of floating-point behavior feasible, directly supporting research on reproducibility, robustness, and numerical uncertainty in modern neural networks and helping advance reproducible and principled DL research. This work proposes three main contributions: 1. PRISM: We introduce PRISM, which implements fast probabilistic rounding methods for the systematic analysis of floating-point errors. 2. Stochastic arithmetic in PyTorch: We seamlessly integrate stochastic arithmetic into PyTorch, enabling efficient and transparent instrumentation of deep learning operations. 3. Comparative evaluation with Verrou: We perform a comprehensive evaluation against Verrou, a state-of-the-art tool for numerical variability analysis, showcasing the enhanced performance and flexibility of Fuzzy PyTorch on use cases ranging from digit classification with MNIST ( 37 ) , whole brain MRI segmentation with the FastSurfer neuroimaging model ( 30 ) , and Parkinson’s classification from speech data with the WavLM model ( 11 ) . The remainder of this paper is structured as follows: Section 2 details the design and implementation of Fuzzy Pytorch, including the UD rounding mode, the PRISM library implementation and PyTorch instrumentation. Section 3 presents results validating numerical accuracy and demonstrating 5–60× runtime speedups over Verrou. Section 4 concludes with discussion of limitations and future directions. Supplementary material, including additional information on existing rounding modes, use cases, the algorithm for probabilistic rounding and further statistical analysis of the harmonic series, is provided in the Appendix. 2 Fuzzy Pytorch Design and Implementation Fuzzy Pytorch implements a new rounding mode, Up-Down rounding (subsection 2.1 ), a faster alternative to stochastic rounding implemented in the PRISM library (subsection 2.2 ). The PRISM library implements the SR and UD rounding modes and the modifications to the Verificarlo compiler for compiling PyTorch with the PRISM library. 2.1 Up-Down Rounding The Up-Down Rounding (UD) technique rounds the result of an already rounded floating-point operation to the next or previous floating-point number with equal probabilities. Although UD rounding does not preserve exact floating-point operations, it produces results similar to SR rounding on large code bases, while