- Zhendong Yu: Sun Yat-sen University, PMI Lab, School of Physics, Guangzhou 510275, People's Republic of China.
- Haiping Huang: Sun Yat-sen University, PMI Lab, School of Physics, Guangzhou 510275, People's Republic of China.
Generative diffusion models apply the concept of Langevin dynamics in physics to machine learning, attracting a lot of interest from engineering, statistics, and physics, but a complete picture of inherent mechanisms is still lacking. In this paper, we provide a transparent physics analysis of diffusion models, formulating the fluctuation theorem, entropy production, equilibrium measure, and Franz-Parisi potential to understand the dynamic process and intrinsic phase transitions. Our analysis is rooted in a path integral representation of both forward and backward dynamics, and in treating the reverse diffusion generative process as a statistical inference, where the time-dependent state variables serve as a quenched disorder akin to that in spin glass theory. Our study thus links stochastic thermodynamics, statistical inference and geometry-based analysis together to yield a coherent picture of how the generative diffusion models work.