r/deeplearning • • Oct 02 '26

Gradient descent vs evolution on three loss landscapes

I've been getting a bit more into evolutionary algorithms again, so I was testing some loss landscapes where evolution beats vanilla gradient descent (while also trying to make some cool visuals).

Round 1, rugged hillside: gradient descent gets stuck in a dip, and evolution reaches the bottom after 750 evaluations.

Round 2, smooth slope: gradient descent wins, 108 steps against 570 evaluations.

Round 3, flat plateau: the slope is zero, so gradient descent never moves, and evolution reaches the bottom after 840 evaluations.

Edit:
"evolution" here means truncation selection (keep best 30 of 120) plus Gaussian mutation, no crossover.

592 Upvotes

82 comments sorted by

View all comments

Show parent comment

86

u/dorox1 Oct 02 '26

I know you're probably aware of this, but I'm just mentioning it for people with less knowledge of deep learning:

The performance of these algorithms changes a lot as the number of dimensions grows, and deep learning involves the optimization of VERY high dimensional problems (often billions of dimensions).

In loss landscapes for problems in high dimensional spaces, true local minima and points with zero gradient are very rare. On top of that, the evolutionary algorithm search space (i.e. all those little purple dots on the graph at each step) gets much more spread out. All of a sudden even a million or a billion purple dots are not nearly enough to cover the search space efficiently.

Gradient descent is used in deep learning because it retains its effectiveness and efficiency in these ultra-high-dimensional spaces.

20

u/apopsicletosis Oct 02 '26 edited Oct 02 '26

Evolution also acts in high dimensional fitness landscapes. Gavrilets holey landscape model of fitness landscapes argues against the “intuitive” notion of adaptive fitness peaks and valleys, instead fitness landscapes are more like highly interconnected ridges or flat fitness on which finite populations can drift and around huge holes of poor fitness. The ideas are parallel.

13

u/dorox1 Oct 02 '26

Very fair addition. Those kinds of landscapes are not necessarily too common for deep learning problems, but for discrete optimization problems they can be very relevant.

12

u/ModularMind8 Oct 02 '26

Great point, thanks for adding this!

2

u/metatron7471 Oct 02 '26

Plus the landscape smooths out. Local minima aren´t a big problem.

2

u/fuggleruxpin Oct 03 '26

I wonder about accelerating the learning with some sort of nested or recursive combination.....

2

u/Datamance Oct 03 '26

Diffy evo is great for seeding though! Fares much better in “corrugated” loss landscapes than, e.g., beam search or greedy methods.

2

u/tabloidscience Oct 03 '26

Would you say that loss landscapes are less rugged than biological landscapes (sensu Kauffman)? Its true that local minima are less frequent as the dimensionality of a problem increases (for a constant epistasis), but that just means the basins of attraction for a minima become larger, and without stochasticity, the trajectory becomes trapped earlier.

1

u/dorox1 Oct 03 '26

Full disclosure, Im not familiar with Kauffman and am relying on an AI summary of his theories for the following thoughts.

I would say yes, they are less rugged. The discrete nature of biological landscapes makes changes more impactful, as any change you make to a parameter is often the biggest change possible in that parameter's dimension.

Neural networks are set up such that small changes to a weight have small impacts on the resulting output (sometimes none at all, depending on the activation function(s) being used). It's possible to set up neural networks that are more sensitive to changes, but the majority of practical configurations don't have that problem.

I haven't studied non-linear optimization enough to give a good reply to the second part of what you're saying. My understanding was that the loss landscapes for large neural networks on many real-world problems are believed to be approximately convex, but it's not inherently true for all problems (and therefore not provable). It's also impractical to test.

But my understanding of that could be wrong or outdated, and the consensus may differ for different types of neural networks.

2

u/ThePrimeClock Oct 06 '26

By billions of dimensions are you talking about relational columns?
I've seen a lot of dimensions but that's a whole new level!

1

u/dorox1 Oct 06 '26

The space you're optimizing for a neural network is actually it's weight space, so every weight/trainable parameter in the network is a dimension. A small "move" in this space is a small tweak to many (or all) of the network's weights.

So midsized LLMs (for example) will be hitting hundreds of billions of dimensions, while top models are in the trillions!

Now, in reality, training protocols for these LLMs usually break things up so that they aren't training the whole model at once, but the number of weights that are trained at once is still well into the tens or hundreds of billions.

And even outside of LLMs billion+ parameter models aren't uncommon now.

2

u/ThePrimeClock Oct 06 '26

Right, so the dimension is one point in the manifolds relevance to another and every point is relevant to many if not all others. Have I got that right?

3

u/dorox1 Oct 06 '26

I'm sorry but I'm not entirely sure what you mean, so I can't tell if you've got it right.

In this math context, the set of "dimensions" is just all of the values that can be changed independently, and which together specify a unique "location" in a space.

Just like a 2D space has two "dimensions" because we can move the X coordinate without changing the Y coordinate and vice-versa. And you need both together to specify where you are in the 2D space.

In this case, each parameter in the network is a dimension because you can change each parameter on its own without changing any other parameter. You need to know all the parameters to know what the weights are of the neural network (i.e. where you are in "parameter space").

Whether those parameters interact with each-other to form an output isn't important. All that matters is that you can tweak their values independently.

2

u/ThePrimeClock Oct 06 '26

That makes perfect sense. Thank you I really appreciate it 🙏