🗂️ Data and Training: How AI Learns
5th Grade 🤖 Artificial Intelligence
Artificial intelligence isn’t born smart. Before a program can learn to spot a cat in a photo, filter out spam or suggest the next word on your keyboard, it has to be trained on a huge pile of examples — data. How good that data is decides, to a large degree, how good the program will be.
What is data?
Data is any information that can be collected and saved on a computer: pictures, voice recordings, text, numbers — even a list of which videos you watched all the way through and which ones you skipped.
In a regular program, a programmer writes every rule by hand: “If someone clicks the button, open the window.” But for some jobs it’s almost impossible to write the rules. Try explaining in words exactly how to tell a cat from a dog in a photo. Ears? Some dogs have pointy ears. Size? There are big cats and tiny dogs. This is where machine learning comes in: instead of writing the rules, we give the computer lots of examples, and it finds the patterns that tell them apart on its own.
How does training work?
Say we want to teach a program to recognize spam — annoying ads or messages that try to trick you. We collect thousands of messages and attach a label to each one: “spam” or “not spam.” Adding these labels is called labeling, and very often people do it by hand.
During training, the program looks at a message, guesses whether it’s spam and checks the label to see if it was right. When it’s wrong, it changes its inner settings a tiny bit so it will be less wrong next time. After repeating this thousands and millions of times, it starts noticing patterns: words like “You won!”, lots of exclamation points, suspicious links and urgent requests for personal details.
Keep in mind: the program doesn’t “understand” what a scam is the way a person does. It finds statistical connections between clues in the message and the label. That’s why it can be very good at one narrow job and still get things wrong in cases that don’t look like anything it has seen.
Training data and test data
A teacher doesn’t put the exact same questions from the practice sheet on the test, and AI developers work the same way: they set some of the examples aside and never show them to the program during training. After training, they test the program on those new examples. If it does well on them too, that’s a sign it learned a general pattern instead of just memorizing.
When a program does great on its training examples but fails on new ones, we say it memorized instead of learning. It’s like a student who remembers the answers to the questions from class but gets confused when the same question is worded differently.
Garbage in, garbage out
There’s a famous saying in computing: “garbage in, garbage out.” If the data is wrong, incomplete or not varied enough, the program will be wrong too. For example, if you train a program to recognize dogs using only photos taken on green grass, it might accidentally learn that “green grass” means dog — and get confused when it sees a dog on the beach.
Variety matters a lot. A voice program trained only on adults’ voices may understand kids less well. A face-recognition program trained on photos of one group of people may make more mistakes with other people. That’s why responsible developers try to collect varied data and test their programs on many different people and situations.
Where data comes from — and what that means for you
Data comes from many places: books and websites, photos taken especially for the job, sensors in cars and devices, and also from the things users do. When you mark an email as “spam,” you’re actually helping label data. When you watch a video to the end, that gets recorded as data too.
So think before you share information. Don’t post personal details on websites and apps — your full name, address, phone number, school, or photos of other people without their permission. If something isn’t clear to you, ask an adult you trust.
Key facts
- Data is any information a computer can store: pictures, sound, text and numbers.
- In training, the program guesses, checks whether it was right and corrects itself a little each time.
- A label is the correct answer attached to an example, like “spam” or “not spam.”
- Programs are tested on examples they never saw in training to find out whether they really learned.
- Wrong or one-sided data leads to a program that makes mistakes — “garbage in, garbage out.”
Quick quiz
What is the job of data in training an AI?
What is a label in training data?
What happens when the program makes a mistake during training?
Why are some examples set aside and not used in training?
What does “garbage in, garbage out” mean?
A program learned to recognize dogs only in photos on grass. What might happen?
Why is it important for training data to be varied?
Which of these things you do helps label data?
💭 Think and talk about it
- Try writing rules that tell a picture of a cat from a picture of a dog. Where did you get stuck, and why does that show we need learning from examples?
- What data do you think gets collected about you when you use your favorite app?
- If you were building a program that recognizes kids’ voices, how would you make sure the data was varied?
Questions kids ask
How many examples does it take to train an AI?
It depends on the job. A simple task might need hundreds or thousands of examples, while complicated jobs like understanding language use enormous amounts of text. But it’s not only about quantity — quality and variety matter too.
Does AI keep learning all the time?
Not always. Many systems are trained once and then used as they are until a new version is trained. Other systems get updated with new data from time to time.
Who labels the data?
Sometimes people whose job is to label pictures or text by hand, sometimes the users themselves — for example, when they mark spam — and sometimes the labels are created automatically from the data.