Loading
Gradient descent is not a metaphor for rolling downhill. It is rolling downhill.
Gradient descent is not a metaphor for rolling downhill.
It is rolling downhill. The mathematics are identical. A ball in a gravitational field follows the negative gradient of potential energy with respect to position — it moves in the direction of steepest descent, at a rate proportional to the local gradient, until it reaches a minimum where the gradient is zero. A neural network performing gradient descent follows the negative gradient of the loss function with respect to the weight values — it moves in the direction of steepest descent through weight space, at a rate proportional to the learning rate, until it reaches a minimum where the gradient is zero.
These are not similar processes. They are the same process — the same differential equation, the same convergence conditions, the same failure modes — instantiated in different physical substrates. The connection is not a convenient analogy that helps the intuition. It is a mathematical identity with real implications for how we should think about training, optimization, and the behavior of large models under conditions that existing engineering intuition has no clean framework for.
The equations, placed side by side:
Newtonian dynamics: x_{t+1} = x_t − γ · ∇_x V(x)
Gradient descent: w_{t+1} = w_t − η · ∇_w L(w)x and w are positions in their respective spaces. V and L are the energy fields being minimized. γ and η are the viscosity and learning rate — both control how aggressively the system chases the local gradient. The only thing that differs between these two lines is what the symbols point to in the physical world.
The same landscape can converge, crawl, or overshoot depending on the optimizer’s dynamics.
In classical mechanics, a particle moves through physical space. Its state is its position. The forces acting on it are the gradients of the potential energy field. Equilibrium is a point where the gradient of potential energy is zero — a minimum where the system is stable.
In machine learning, a model moves through weight space during training. Its state is the vector of all weight values — hundreds of millions of numbers for a large model, billions for the largest. The forces acting on it are the gradients of the loss function. Convergence is a point where the gradient of the loss is zero — a minimum where the model's predictions are locally optimal.
| Physics | Machine Learning |
|---|---|
| Potential energy | Loss function |
| Force | Gradient |
| Position | Weight values |
| Friction / viscosity | Learning rate |
| Momentum | Gradient momentum |
| Thermal fluctuation | Batch noise |
| Local energy minimum | Overfit solution |
| Global minimum | Optimal generalization |
Each entry in this table is not an analogy. It is a structural equivalence between two domains that are taught in separate departments and rarely put in direct conversation.
To make it concrete: imagine a single training step. A ball sits on a hillside. It measures the slope at its current position — the gradient of the terrain. It rolls a small distance in the downhill direction, proportional to the slope and slowed by friction. It stops, measures again, rolls again. That is gradient descent. The hillside is the loss function. The ball's position is the current weight vector. The friction is the learning rate. The valley it finds — if it finds one — is the trained model. Every time you run backpropagation and apply an optimizer step, you are performing one roll down this hill in a space with hundreds of millions of dimensions. The physics is identical. The geometry is just harder to visualize.
Learning rate plays the role of friction or viscosity in the physical system. A very small learning rate is high friction: the optimizer moves slowly, takes small steps, is unlikely to overshoot a minimum but may take prohibitively long to find one. A very large learning rate is low friction: the optimizer moves fast, overshoots minima, oscillates, and can diverge entirely. Finding the right learning rate is finding the right viscosity for the landscape — a property of the medium, not just of the objective function.
Gradient momentum is literal momentum: the optimizer accumulates velocity from previous steps and carries it forward. In hilly terrain, this helps a ball roll past shallow valleys and reach deeper ones. In optimization, momentum helps the optimizer escape sharp, narrow minima — solutions that fit the training data tightly but generalize poorly — and reach broader, flatter minima that tend to generalize better.
Key claim: These are not analogies. They are the same mathematical object viewed from two disciplines that haven't finished talking to each other yet.
Stochastic gradient descent, where the gradient is computed on a random subset of training data rather than the whole dataset, introduces noise into the force estimate at every step. This is thermal fluctuation — the same mechanism that allows a molecule to escape a local energy well despite having less energy than the height of the barrier. Batch noise is not a defect to be eliminated. It is a thermodynamic resource. It allows the optimizer to explore the loss landscape rather than falling into the nearest minimum, and the minima found with noise tend to be flatter and generalize better — which is the machine learning analog of thermodynamic stability.
"Neurons that fire together wire together." Donald Hebb proposed this as the biological basis of learning in 1949: when two neurons fire in close temporal proximity, the synapse connecting them is strengthened. Experience carves grooves in the network. Frequently traveled paths become easier to travel.
This is Ohm's law applied to biology. Current flows along paths of least resistance. Paths that carry more current develop lower resistance over time. The brain is an electrical network that physically rewires itself based on which pathways carry the most current — synaptic weight is electrical conductance, and the plasticity rule is a conductance update rule driven by co-activity.
Backpropagation — the algorithm that trains artificial neural networks — is a formalization of this principle extended to multi-layer systems. Credit for a correct output is assigned backward through the network, layer by layer, to the weights that contributed to it. Weights that contributed positively to correct predictions are strengthened. Weights that contributed negatively are weakened. The network becomes better at the task by reinforcing the pathways that produce correct outputs and attenuating those that don't.
The biological and artificial versions are not identical. Hebb's rule is local: a synapse updates based on the activity of the two neurons it directly connects, without needing information from anywhere else in the network. Backpropagation is non-local: credit propagates through the entire network using information about the output error, which requires global knowledge of the network's state. This is one of the active research questions in computational neuroscience — how does the brain approximate the credit assignment that backpropagation computes globally, using only local information? Several plausible mechanisms have been proposed, none definitively confirmed.
But the underlying principle connecting both is the same: reinforce what works, attenuate what doesn't, measured by a signal that encodes success. Both systems discover the structure of their input by strengthening the pathways that carry the regularities and weakening those that carry the noise.
In 1948, Claude Shannon defined the entropy of a probability distribution as H = −Σ p log p. In 1877, Ludwig Boltzmann defined the entropy of a thermodynamic system as S = −k Σ p log p, where k is Boltzmann's constant. Shannon acknowledged the connection explicitly and debated with colleagues whether to call it entropy at all, since the word already belonged to thermodynamics. John von Neumann reportedly told him: "Call it entropy. No one knows what entropy really is, so in a debate you will always have the advantage."
The two quantities are the same mathematical expression. The only difference is the constant of proportionality and the physical interpretation of the probabilities. Information and physical entropy are the same thing, measured in different units, developed in different contexts, not yet fully integrated into a single framework.
What this means for neural networks: a randomly initialized network has high entropy — its weight distribution is maximally uncertain, and its outputs are close to random. A trained network has low entropy — its weights have organized into a structured pattern that captures the regularities of the training data. Training is a thermodynamic process. It reduces the entropy of the weight distribution by injecting information — the training signal — into the system against the direction of natural disorder.
This reframing makes several training phenomena more intuitive. Overfitting is too much entropy reduction — the model has compressed itself to match the training data's specific instances, including their noise, not just the underlying distribution. Regularization is an entropy floor — a constraint that prevents the weights from becoming too organized, too specifically adapted to what was seen rather than what will be seen. Dropout introduces entropy back into the network during training by randomly zeroing activations, preventing any single pathway from becoming too dominant and forcing the network to learn redundant representations.
The energy source that drives entropy reduction during training is the training signal — the discrepancy between the model's predictions and the correct outputs. In thermodynamics, entropy reduction requires work, and work requires an energy gradient. In training, the model's error is that gradient, and the optimizer follows it. The system cools from high entropy toward low entropy, and what it cools into is a compressed model of the world it was trained to predict.
Neural networks do not improve gradually and uniformly. They undergo phase transitions — discontinuous changes in capability that happen at specific scales and specific points during training, without smooth interpolation between the states on either side of the threshold.
Water does not gradually become ice. At 0°C, at standard pressure, something changes all at once. The molecular structure reorganizes, latent heat is released, and the material's properties shift discontinuously. Below the Curie temperature, a ferromagnet develops spontaneous magnetization — the magnetic moments of individual atoms align collectively — and above it the material has no net magnetic moment. The transition is sharp, scale-dependent, and unpredictable from within either phase.
Language models do the same thing. Below a certain parameter count, the model cannot reliably perform multi-step arithmetic. Above a threshold, the capability appears and improves rapidly. Below a certain training compute budget, the model cannot maintain coreference across long contexts. Above the threshold, the capability is present. These are not gradual improvements that become significant at some point. They are phase transitions — absent below the threshold, present above it, with a crossing that is sharp enough that models ten percent below and ten percent above look qualitatively different on the affected capability.
Researchers at Anthropic and DeepMind have documented dozens of these transitions across different capabilities, and the pattern is consistent. The mathematics governing these transitions — percolation theory, renormalization group methods from statistical mechanics — are the same ones used to study physical phase transitions. The model at the critical scale is analogous to a material at its critical temperature: properties that were absent below the threshold appear all at once, driven by the same underlying mathematics of collective behavior in large interacting systems.
If neural networks are physical systems — not metaphorically but structurally, in the sense that they obey the same equations, exhibit the same phenomena, and are governed by the same mathematics — then the intuitions of physicists are as relevant as the intuitions of engineers to the people building them.
Physicists think in stability and instability, conservation laws and symmetry-breaking, phase diagrams and critical points, scaling laws and universality classes. These are not decorative concepts imported for analogy. They are the correct technical vocabulary for what actually happens when you scale a neural network, when you adjust the learning rate schedule, when you add momentum, when you change the noise in the gradient estimate, when you cross a critical scale threshold.
This reframing has three concrete payoffs:
Better diagnostic intuition. Loss curves are energy curves. An oscillating loss is a system with insufficient viscosity — lower the learning rate. A loss that plateaus early is a system trapped in a local minimum — add noise (larger batch variance) or momentum to escape it. The failure mode vocabulary of physics maps directly onto optimizer failure modes, and it's more precise than "the training is unstable."
New architecture design directions. Physical systems have known stability conditions and symmetry properties that constrain their behavior. Applying these to weight space — asking which network architectures correspond to energy-stable systems — is an underexplored direction. Residual connections, for example, can be interpreted as discretized differential equations; that interpretation directly motivated Neural ODEs and a class of architectures designed by solving, not guessing.
Simulation-based learning. If a physics engine is already modeling the same mathematics that governs training, using physics simulations as training environments — where the reward signal is a physical quantity, and the agent learns through gradient-based optimization over the same energy landscape — collapses the distinction between simulating a system and learning to control it.
The most interesting advances of the next decade are likely to come from people fluent in both fields — who can read a paper on renormalization group theory and a paper on neural scaling laws and see the same problem described twice in different vocabularies.
Neural networks are not computational tools that happen to behave like physical systems. They are dynamical systems — governed by the same equations, subject to the same stability conditions, exhibiting the same phase transitions — that run on silicon instead of matter. The boundary between physics and machine learning is not a disciplinary line. It is a historical accident. The same equations were always on both sides of it.
More to read
The most interesting things in the universe were never designed. They emerged.
Fixed time, deterministic seeds, a toroidal world, and the spatial hash that lets two thousand particles remain an experiment.
Every control, four guided experiments, deterministic sharing, saved discoveries, screenshots, JSON, CSV, mobile use, and troubleshooting.