Improving Matrix Exponential for Generative AI Flows: A Taylor-Based Approach Beyond Paterson--Stockmeyer
Jorge Sastre, Daniel Faronbi, José Miguel Alonso, Peter Traver, Javier Ibáñez, Nuria Lloret
TL;DR
This paper targets the bottleneck of computing the matrix exponential in large-scale generative flows. It introduces a Taylor-based algorithm with dynamic selection of the Taylor degree and scaling parameter, underpinned by sharp error bounds for nonnormal matrices and advanced polynomial evaluation formulas that outperform Paterson-Stockmeyer. Through MATLAB benchmarks and PyTorch Glow experiments, it demonstrates substantial training speedups (3.9x–9.7x) and meaningful inference latency reductions, validating a portable, library-independent solution for high-throughput generative modeling. The approach combines theoretical error guarantees with practical, scalable implementations, making high-order Taylor approximations viable for real-world flow-based architectures.
Abstract
The matrix exponential is a fundamental operator in scientific computing and system simulation, with applications ranging from control theory and quantum mechanics to modern generative machine learning. While Padé approximants combined with scaling and squaring have long served as the standard, recent Taylor-based methods, which utilize polynomial evaluation schemes that surpass the classical Paterson--Stockmeyer technique, offer superior accuracy and reduced computational complexity. This paper presents an optimized Taylor-based algorithm for the matrix exponential, specifically designed for the high-throughput requirements of generative AI flows. We provide a rigorous error analysis and develop a dynamic selection strategy for the Taylor order and scaling factor to minimize computational effort under a prescribed error tolerance. Extensive numerical experiments demonstrate that our approach provides significant acceleration and maintains high numerical stability compared to existing state-of-the-art implementations. These results establish the proposed method as a highly efficient tool for large-scale generative modeling.
