Machine learning, like other science and engineering fields, has proofs, experiments and rigorous math, but it also leaves plenty of room for philosophizing about the most fundamental and hard-to-explain things, like why it works in the first place.
I’ve tried to sort this out in my head, with my limited knowledge of the field, and after a few minutes of thinking in the shower I came up with an explanation that may not be rigorous, but is a satisfying start.
Take a classic example: image recognition. Specifically, a 30x30 pixel picture of a cat. Images like this must have some hidden structure that’s hard to describe, because out of the huge set of all possible images (most of which are just noise) we can tell very quickly and accurately which one is a cat and which one isn’t. And if there’s structure, maybe something can learn it.
The problem is that trying to write this structure down as a procedural algorithm is a nightmare. If the difference between pixel 32 and pixel 30 is 67, and the sum of those two pixels is this much… Practically impossible to do by hand.
Impossible to write down, but such an algorithm has to exist, because our brain somehow does it. Millions of years of evolution gave it the right predispositions, and it polished the rest by analyzing the world since birth.
This is where ML comes in. A trained neural network is exactly that kind of algorithm: a finite number of multiplications, additions and conditions. Very long, tangled and hard to analyze, but found by learning from examples, using gradient descent.
That doesn’t mean any structure will do. There are rules that are easy to write in code, but that a network won’t learn from examples alone. For instance: does the SHA-256 hash of the image end with a zero? Changing a single pixel changes the result completely, so the examples tell you nothing about new images. With cats it works, because a slightly altered photo of a cat is still a cat.
So for now, my take is this: the world has structure (it has to, otherwise we couldn’t predict anything). It’s far from random, but still too tangled to put into words. So instead of trying to describe it, we build machines that find it on their own. Why they settle on a general rule instead of just memorizing the examples is, as far as I can tell, still an open question.