Crate #2: How Machines Learn
Teaching rocks to think, one number at a time
๐ Prerequisites
Learning Without Being Programmed
Traditional programming works like a recipe: you tell the computer exactly what to do, step by step. "If the email contains 'you won a prize,' move it to spam."
Machine Learning (ML) flips this upside down. Instead of writing rules, you show the computer thousands of examples and let it figure out the rules itself.
Imagine teaching a friend to identify dogs vs. cats. You wouldn't write a 500-page manual of rules ("if it has pointy ears AND whiskers AND..."). You'd just show them pictures: "Dog. Dog. Cat. Dog. Cat. Cat." After enough examples, they get it.
That's exactly how ML works. Show the computer 10,000 pictures of dogs and 10,000 pictures of cats, tell it which is which, and it learns to spot the difference. The "learning" is actually the computer adjusting millions of tiny numbers until it gets good at telling them apart.
The Three Flavors of Learning
SUPERVISED LEARNING โ The teacher approach You give the computer both the questions AND the answers. "Here's a photo (question). It's a cat (answer)." The computer learns to match questions to answers. This is the most common type.
Real examples: spam filters, voice assistants understanding speech, medical diagnosis from X-rays.
UNSUPERVISED LEARNING โ The explorer approach You give the computer data but NO answers. "Here are 50,000 shopping receipts. Find interesting patterns." The computer groups similar things together and discovers structure on its own.
Real examples: Netflix suggesting shows you might like, detecting unusual bank transactions.
REINFORCEMENT LEARNING โ The gamer approach The computer learns by trial and error, like playing a video game. It tries something, gets a score (reward or punishment), and adjusts. Over thousands of attempts, it gets really good.
Real examples: AlphaGo learning to play Go, robots learning to walk, self-driving cars.
What Is 'Training' Really?
When people say they're "training" an AI, they mean they're feeding it data and letting it adjust its internal numbers (called parameters or weights) until it performs well.
Think of it like tuning a guitar. Each string (parameter) needs to be exactly right. If it's off even a tiny bit, the music sounds wrong. ML is like having a guitar with a million strings, and the computer tunes each one, a tiny bit at a time, until the whole thing sounds right.
The data you train on matters ENORMOUSLY. If you train a facial recognition system only on photos of light-skinned people, it'll be terrible at recognizing dark-skinned people. This isn't the AI being "racist" โ it just never learned because no one showed it the right examples. This is why diverse, representative data is critical.
Training big AI models is expensive. Training GPT-4 reportedly cost over $100 million and used more electricity than a small city uses in a year. This is why companies don't retrain from scratch very often.
๐ค Think About It
- Which type of learning (supervised, unsupervised, reinforcement) would work best for teaching AI to play Minecraft? Why?
- If you only trained an AI on books from the year 1900, what would it get wrong about the modern world?
- Why might it be dangerous to use AI trained on biased data to make decisions about people?
๐ฌ Try This
- Play 20 Questions with a friend. Notice how each answer narrows down the possibilities โ that's similar to how decision trees work in ML!
- Collect 20 objects and sort them into groups WITHOUT deciding categories in advance. That's unsupervised learning!
- Try Google's Teachable Machine (teachablemachine.withgoogle.com) โ train your own image classifier in your browser, no coding needed.
๐ Go Deeper
๐ฏ Fun Fact
Google's cat detector (2012) was one of the first big deep learning breakthroughs. Researchers fed a neural network 10 million YouTube thumbnails and it taught itself to recognize cats โ without ever being told what a cat looks like. The internet's obsession with cat videos literally advanced AI research.
๐ Quick Quiz
1. What's the key difference between traditional programming and machine learning?
2. In supervised learning, what does the computer receive during training?
3. Which type of learning does AlphaGo use to master the game of Go?
4. Why was diverse, representative training data highlighted as critical?
