Gradient Descent Should Not Work, and Yet It Does

3 min read

Geoffrey Hinton won the Nobel Prize in 2024 for his work on AI. But decades earlier, he had dismissed the very method that trains nearly every modern neural network: gradient descent. His worry was simple and reasonable. Training looks like walking downhill on a curved surface, and a surface has valleys. Start in the wrong place and you get stuck in a local valley, far from the best solution. If that picture were the whole story, gradient descent should not work. And yet it works unbelievably well. This video asks what Hinton was missing, and what is wrong with the picture.

The video runs a real experiment on Meta's Llama 3.2, a large language model with 1.2 billion parameters. Feed it the capital of France is, and it gives a probability for every next token in its 128,256-token vocabulary. Paris gets 0.39. The next most likely token, a, gets 0.084. Training means pushing that 0.39 higher. To do that you need a way to score the model, a loss. One option is simple: one minus the probability of the right answer. At a probability of 1.0 that gives 0, at 0.9 it gives 0.1, at 0.8 it gives 0.2. The loss the field actually uses is cross entropy, the negative logarithm of the probability. At 1.0 it gives 0, at 0.9 it gives 0.105, at 0.8 it gives 0.223, almost the same when the model is confident, but it shoots up as confidence falls, punishing wrong answers harder.

Cross entropy loss by confidence
loss at p=1.00losscross entropy at p=0.90.1losscross entropy at p=0.80.2losscross entropy at p=0.390.9loss
Data from the sources listed below.

For the Paris example the loss is 0.94. Now pick one parameter out of the 1.2 billion. It sits in the final layer, currently at 0.007. Decrease it by 0.01 and the Paris probability slips from 0.3916 to 0.3901. Increase it by 0.01 and it rises to 0.3930. Test more values and you get a smooth curve with a sweet spot near 1.61, where the loss is lowest. So why not tune every parameter this way, one at a time? Because the parameters interact. Set the first to 1.61, tune a second to its best value of 1.76, and go back to the first: its best value has moved to 1.11. Each parameter changes the curve of the others.

That is the real lesson. You cannot learn by tuning one parameter at a time, because all 1.2 billion of them are coupled. The loss surface is 1.2 billion dimensional, and no one can explore it by testing combinations. Gradient descent works by a different trick: it computes the slope of the loss with respect to every parameter at once, and steps downhill in all directions together. That is how one algorithm trains neural networks with billions of parameters. That is how modern models learn: not by testing values one by one, but by following all the slopes at once. The valley picture is not wrong, exactly, but it is a picture of two parameters. In a billion dimensions, the geometry is stranger than a surface, and that strangeness is part of why the method works.

Try this

bash
python -c "import math; [print(p, round(-math.log(p), 3)) for p in [1.0, 0.9, 0.8, 0.39]]"

Sources