Neural Thermodynamic Laws for Large Language Model Training
Ziming Liu, Yizhou Liu, Jeff Gore, Max Tegmark
TL;DR
The paper introduces Neural Thermodynamic Laws (NTL) to connect large language model training dynamics with thermodynamics by modeling the loss landscape as a river-valley structure, decomposed into fast valley dynamics and slow river dynamics via $$\\ell=\\ell_f+\\ell_s$$. A tractable toy model $$\\ell(x,y)=c(y)+\\tfrac{1}{2}a(y)x^2$$ enables exact analysis of SGD/SignGD, revealing how an effective temperature $T\\sim\\eta$ and a heat capacity emerge, and deriving an optimal decay schedule $$\\eta_t\\approx \\frac{\\eta/2}{1+t/t_h}$$ with a characteristic time $t_h$. The framework further relates entropy in fast directions to entropic forces that influence slow dynamics, and draws analogies to Fourier conduction and the second/third laws to explain relaxation and entropic trapping. Empirical validation on GPT-2 small shows the key predictions hold in early training, and the results yield practical guidelines for LR warmup-stable-decay schemes. Overall, NTL provides a mechanistic, physics-inspired lens on LLM training that links loss decomposition, equilibrium/annealing behavior, and optimal LR schedules with thermodynamic principles, suggesting principled directions for future experimentation on larger models.
Abstract
Beyond neural scaling laws, little is known about the laws underlying large language models (LLMs). We introduce Neural Thermodynamic Laws (NTL) -- a new framework that offers fresh insights into LLM training dynamics. On the theoretical side, we demonstrate that key thermodynamic quantities (e.g., temperature, entropy, heat capacity, thermal conduction) and classical thermodynamic principles (e.g., the three laws of thermodynamics and the equipartition theorem) naturally emerge under river-valley loss landscape assumptions. On the practical side, this scientific perspective yields intuitive guidelines for designing learning rate schedules.
