Neural network training makes beautiful fractals
sohl-dickstein.github.io
sohl-dickstein.github.io
So I would say the experiment is interesting, but not representative of real world deep learning.
In the experiment, you have a function of 272 variables with a lot of minima and maxima, and at each gradient descent step you take huge steps (due to big lr). So my intuition is that convergence is more a matter of luck rather than hyperparameters.
The reason for high learning rate is that they used full batched training (see the first cell in https://colab.research.google.com/github/Sohl-Dickstein/frac...), and when batch sizes are large, learning rates typically can be large as well. Plus as others said it's more of a toy problem, it would be hard to get such detail on anything non-toy.
Inter dimensionality is the defining feature of fractals.
A multilayer ANN will have compression that may be fractal like. But in theory a feed forward network could be single layer but will a lot more neurons.
I have the feeling this result was due to representation but there are some features that look like riddled basins.
Riddled basins do arise in SNN or spikey neutral networks that have continuous output bs the binary output of ANNs.
But as all PAC learning is just compression that may be the cause also.
I'll be digging into this on the weekend though.
Abstract:
"Some fractals -- for instance those associated with the Mandelbrot and quadratic Julia sets -- are computed by iterating a function, and identifying the boundary between hyperparameters for which the resulting series diverges or remains bounded. Neural network training similarly involves iterating an update function (e.g. repeated steps of gradient descent), can result in convergent or divergent behavior, and can be extremely sensitive to small changes in hyperparameters. Motivated by these similarities, we experimentally examine the boundary between neural network hyperparameters that lead to stable and divergent training. We find that this boundary is fractal over more than ten decades of scale in all tested configurations."
Contains several cool animations zooming in to show the fractal boundary between convergent and divergent training, just like the classic Mandelbrot and Julia set animations.
We've rapidly engineered our way to some very impressive models this past decade, and yet gap in our real understanding of what's going on has widened. There's a large list of very basic questions about LLMs that we haven't answered (or in some cases, really asked). This is not a failing of people researching in this area, it's only that things move so quickly there's not enough time to ponder things like this.
At the same time, the result, unless I'm really misunderstanding, gives me the impression that anything other than grid search hyper parameter optimization is a fools errand. This would give credence to the notion that hyper parameter tuning really is akin to just re-rolling a character sheet until you get one that is over powered.
While it certainly makes for some nice visualizations, the technical insight of this is pretty limited. First of all, this fractal structure emerges at learning rates that are far higher than those used in training actual neural networks nowadays. It's interesting that the training still converges for some combinations and that the (expected) hit-and-miss procedure yields a fractal structure. But if you look closely at the images, you'll see the best hyperparameters are, while close, not at the border. So even if you want to follow the meta-learning approach outlined in the post, your gradient descent has already screwed up before if it ever ends up in this fractal boundary region.
Most of the research is done with simpler models though (because mainly math people do it, and it's hard to prove anything on something as complex as a transformer).
The visualizations only show that at the Border there are a lot of fractals, not in every part of the space. (Although the highest performance is often achieved close to the border.). I would not state hparam search as bad as that..
always thought we now know what the android's dreams were like
To generate an output from an input vector, you just multiply by your 8x8 matrix (getting a new size 8 vector), apply the tanh function to each element (look up a plot of tanh - it just squeezes its inputs to be between -1 and 1), and then multiply by the 8x1 matrix, getting a single value as an output. The elements of the two matrices are the 'weights' of the neural network, and they are updated to push the output we got towards the target.
When we update our weights, we have to decide on a step size - do we make just a little tiny nudge in the right direction, or take a giant step? The plots are showing what happens if we choose different step sizes for the two matrices ("input layer learning rate" is how big of a step we take for the 8x8 matrix, and "output layer learning rate" for the 8x1 matrix).
If your steps are too big, you run into a problem. Imagine trying to find the bottom of a parabola by taking steps in the direction of downward slope - if you take a giant step, you'll pass right over the bottom and land on the opposite slope, maybe even higher than you started! This is the red region of the plots. If you take really really tiny steps, you'll be safe, but it'll take you a long time to reach the bottom. This is the dark blue section. Another way you can take a long time is to take big steps that jump from one slope to the other, but just barely small enough to end up a little lower each time (this is why there's a dark blue stripe near the boundary). The light green region is where you take goldilocks steps - big enough to find the bottom quickly, but small enough to not jump over it.
Not a ML'er so not sure what to make of it, beyond a fascinating connection.
But yes, you are restricted to linear things and you can't make a good photonic cat detector out of that easily. So all the photonic neural networks you may have heard of like https://arxiv.org/abs/2106.11747 wind up sticking some mechanical or electrical nonlinearity somewhere.
I'd be curious to know what the plots would look like with a different randomness/shuffling of each pixel's dataset. I'd guess for the high learning rates it would be too noisy, but you might see fractal behavior at more typical and practical learning rates. You could also do the same with the random initialization of each dataset. This would get at if the chaotic boundary also exists in more practical use cases.
https://proceedings.neurips.cc/paper/1990/file/1543843a4723e...
I imagine the fractal or chaos is still there, but maybe "smoother" and easier for metalearning to deal with?
https://github.com/Sohl-Dickstein/fractal/blob/main/the_boun...
HAL> why yes Dave what did you think I was made of
I recall similar tests being done on paintings by Pollock and of other artists trying to copy his style to determine authenticity[3].
[1]: https://en.wikipedia.org/wiki/Fractal_dimension
[2]: https://mathworld.wolfram.com/Fractal.html
[3]: https://cpb-us-e1.wpmucdn.com/blogs.uoregon.edu/dist/e/12535...
I think it probably stems from the fact that all the fractals, I have seen, for which the dimension can be analytically calculated do show obvious patterns of similarity at different scales.
They point out that the usual measure of fractal dimension, or capacity dimension[2], doesn't consider the physical size of the features and can thus be inaccurate. Instead they suggest using the information dimension[3], which is bounded by the capacity dimension.
[1]: https://doi.org/10.1016/j.chaos.2018.05.008 (full text available on that hub of science)
[2]: https://mathworld.wolfram.com/CapacityDimension.html
[3]: https://mathworld.wolfram.com/InformationDimension.html
https://medium.com/@h.a.papageorgiou/the-reality-of-the-ruli...
> we find intricate structure at every scale
> At every length scale, small changes in the hyperparameters can lead to large changes in training dynamics
This is the definition of Chaos though no? Butterfly flaps its wings, hurricane on other side of the planet...