Two Ways to Make a Machine Smart
Write every rule yourself, or show the machine examples and let it learn. What machine learning means.
A quick note on how we teach here. You won't find equations or numbers in this series, and that is on purpose. The goal is understanding, not arithmetic, so every idea is explained in plain words and simple pictures. When you want the math later, the rest of Internals Decoded is ready for you.
Welcome back. So far we have built machines that can follow recipes, spot patterns, and even guess what might come next. Those ideas gave us a compass. Now we reach a fork in the road. How do we actually put that guessing power into a machine? There are two very different paths, and the one you choose matters a great deal.
The whole idea is this: you can either write down every rule by hand, or you can show the machine many examples and let it work out the rules on its own. That second way, the one where the machine learns from examples instead of following a written rulebook, is what people mean by machine learning.
The rulebook approach
Imagine you are teaching a kitchen helper to sort your mail. You hand them a clear, simple recipe. If the envelope has a window and a printed barcode, put it in the bills pile. If it is handwritten and has a stamp from another country, put it in the personal pile. Every situation gets a tidy if this, then that instruction. As long as your mail never surprises you, this works beautifully.
A machine can follow a set of hand written rules in exactly the same way. For tidy problems, this approach is enough. A program that checks whether an invoice number has the right number of characters and starts with a letter is a small box of rules. You can write every condition yourself because the pattern is simple and does not change much. For a long time, that was how people tried to make machines do clever things. They sat down and described the world one careful sentence at a time.
When rules run out
Now picture a different task. You want to teach a child what a cat is. You might start listing rules: a cat has four legs, fur, whiskers, and pointy ears. But a rabbit fits that description too. So you add more rules. A cat says meow. Except a quiet cat doesn't. A cat chases mice. Except your neighbor's cat is too lazy for that. No matter how many rules you write, you keep finding a cat that breaks one of them, or a rabbit that slips through the cracks.
The real world is full of messy, shape shifting patterns. Recognizing a face, understanding a spoken sentence, or telling a cat from a slipper in a dark photograph is not a tidy problem. If you tried to write a rulebook for those, you would never finish. The world just has too many exceptions.
Learning from examples
When a child first meets cats, you do not give them a rulebook. You simply point. You point at a real cat and say "cat". You point at a picture of a cat and say "cat". You point at a dog and say "no, that's a dog." After many, many examples, something clicks. The child just knows. They have not memorized a list of if then rules in words. Their brain has quietly built its own pattern from the examples.
Machines can do the same thing. Instead of writing rules, we show the machine a huge pile of examples. Here is a cat, here is not a cat. Here is a happy customer review, here is a frustrated one. The machine looks at all of them and, little by little, adjusts its inner settings, like tiny dials, until it can tell them apart. Nobody tells it exactly what whiskers are or what tone of voice sounds angry. It discovers those patterns on its own, from the examples.
This is why a phone can recognize your face even when you wear glasses or a hat, or stand in dim light. No programmer sat down and wrote a rule for "how much shadow is too much." Apple's security guide says the face unlock on its phones was trained on an enormous collection of face images from a wide range of people, including pictures taken with invisible infrared light. From all those examples, it learned what stays the same about a face. Those phones can even unlock in total darkness, because they shine their own invisible light at your face.
Wait, did we not say a computer only ever follows instructions? It still does. With machine learning, the instructions people write are a recipe for learning: look at an example, make a guess, compare it with the right answer, adjust a little, repeat. People write that learning recipe and choose the examples. The rules for spotting a cat are what the machine ends up with, and nobody wrote those.
Which way to choose
Learning from examples is powerful, but it has costs. It needs a great many examples. It can pick up the wrong pattern, like a sorter that decides snow means wolf. And it is hard to explain afterwards: even the people who build these machines often cannot say exactly why one gave a particular answer.
Rules have the opposite strengths. They are predictable and easy to check, because you can read every one of them. That is why jobs like working out the tax on a bill are written as plain rules. Nobody wants a tax that is only usually right.
Many real products mix the two. Gmail is one: Google's post on how Gmail blocks spam explains that systems which learned from examples work alongside rules written by hand.
A name for this idea
That is the whole shift. You stop writing rules by hand. You start showing examples. The machine builds its own pattern from what it sees. People call this approach machine learning. The name says exactly what it means. The machine learns from examples, instead of being told exactly what to do. Everything else you will hear about, like training and parameters, is the detail of how that learning happens, and we will meet each of them.
Where this is heading
So there are two ways to make a machine smart. You can spell out every rule yourself, which works well when the job is tidy and has to be exactly right. Or you can give it a mountain of examples and let it learn the pattern, which is what lets us tackle the messy real world. Machine learning is the second path.
But what does "learn from an example" actually look like, moment to moment, inside the machine? To find out, we will watch a machine slowly change its mind as it sees a new picture or reads a new sentence.
Test yourself
For each job, would you write rules or show examples, and why? Adding up a shopping bill. Naming a bird from a photo. Checking that a password is long enough.
Answer: Adding up a shopping bill: write rules. The steps are tidy, they must be exactly right every time, and anyone can check them. Naming a bird from a photo: show examples. Birds come in endless poses, lights and angles, so no rulebook could cover them, but a machine shown many bird photos with the right names attached can learn the patterns. Checking that a password is long enough: write a rule. It is one clear condition, easy to state and easy to test, and a learned guess would only add mistakes. Rules suit jobs that are tidy and must be exact. Learning suits messy jobs, where examples are easier to collect than rules are to write.
Next: Learning From Examples. It shows how training works: guess, get corrected, adjust a little, and repeat across a mountain of examples.