AI for Everyone: How Machines Learn (Part 2)

The different types of AI learning
How machines learn: a journey through the different types of artificial learning
Matteo 5 min

Remember the lunch with friends I told you about in the previous article? Well, while we were ordering coffee (yes, we made it all the way to coffee), Claudia, who’s a teacher, asked an interesting question: “But how exactly does AI learn? I mean, it’s not like it can raise its hand and ask questions like my students do.”

And here we are, ready to explore the wonderful (and sometimes confusing) world of artificial learning. Because if there’s one thing more interesting than an artificial intelligence, it’s understanding how that intelligence learns.

Machine Learning: When Computers Go to School

Machine Learning is a bit like sending a computer to school, except that instead of textbooks and tests, we give it tons of data and algorithms. It’s as if, instead of explaining to someone how to recognize a cat, we showed them thousands of cat photos until they learned to recognize them on their own.

Have you ever taught a child what a giraffe is? You don’t explain the proportions of its neck or the layout of its spots. You show them pictures and say “this is a giraffe” until they learn to recognize one. Machine Learning works more or less like that, just with far more examples and far more math (but don’t worry, we’ll let the computer handle the math).

Deep Learning: The Layers of the Learning Cake

If Machine Learning is like sending a computer to school, Deep Learning is like sending it to university. But a very peculiar university, organized in levels (or “layers”, as the nerds say) stacked on top of each other like a mille-feuille.

Think about how your brain recognizes a face: first it sees the basic shapes (eyes, nose, mouth), then how those shapes are arranged, then whether they form a happy or sad expression, and finally “hey, that’s Uncle Joe!” Deep Learning works in a similar way, with each layer handling a different level of abstraction.

Supervised Learning: Learning with Training Wheels

Supervised Learning is like learning to ride a bike with training wheels. At first, we give the computer both the data and the correct answers. “This is a photo of a cat” → CAT, “This is a photo of a dog” → DOG, and so on. The computer learns by comparing its answers with the correct ones, just like a child learning from their mistakes (except the computer is much faster and doesn’t burst into tears when it gets something wrong).

Unsupervised Learning: Taking Off the Training Wheels

In Unsupervised Learning, on the other hand, we take off the training wheels. We give the computer a pile of data without saying what it is and ask it to find patterns and structures. It’s like leaving a child in a room full of toys and watching how they organize them: by color, by size, by type… The computer does the same thing, just with data instead of toys.

Reinforcement Learning: The Digital Carrot and Stick

Reinforcement Learning is probably the most fun type of learning to explain, because it’s basically like training a dog. Except that instead of treats and praise, we use positive and negative numbers.

The other day I was teaching my dog not to jump on the couch (mission impossible, I know). Every time he stays on the floor, reward. Every time he climbs onto the couch, a telling-off. Reinforcement Learning works the same way: the computer tries to do something, gets a “reward” if it does well and a “punishment” if it does badly, and little by little it learns what the best behavior is.

Transfer Learning: Recycling Knowledge

Transfer Learning is like going to university after high school. You don’t start over by learning the alphabet, right? You start from what you already know and build on top of it. In the same way, instead of training an AI from scratch every time, we can take a model already trained on one task and “retrain” it for a similar task.

That’s what happens when companies take a model like GPT and specialize it for their specific purposes. It’s a bit like taking a chef who’s an expert in Italian cuisine and teaching them to make sushi: they don’t have to learn from scratch how to use a knife or turn on the stove, they just need to adapt their skills to a new kind of cooking.

Conclusion: Learning Is Never Linear

The most fascinating thing about all these types of learning is that they often mirror the way we humans learn. Sometimes we need a teacher to guide us (Supervised Learning), other times we explore and discover things on our own (Unsupervised Learning), and very often we learn from our mistakes (Reinforcement Learning).

The next time someone asks you “but how does AI learn?”, you’ll be able to answer that it learns a bit like all of us: with a mix of direct instruction, exploration, and trial and error. It just does it much, much faster and without ever complaining about homework.

P.S. In the next article we’ll talk about neural networks and attention mechanisms. And no, they have nothing to do with fishing nets or trouble concentrating. But that’s another story…


Useful resources

Copiato