AI in a nutshell - Part 2 | How does AI work?
Author
Nguyễn Hoàng Tuấn Anh
Date Published
Welcome back to AI in a nutshell—your go-to guide for understanding Artificial Intelligence without the tech headaches! In Part 1: What the heck is AI? Should you be afraid of it?, we covered the basics: what AI is, types of AI, how it’s already part of your daily life, some misconceptions about AI and why you should not be afraid of it. Now, in Part 2, we’re diving deeper into the how behind AI.
Ever wondered how AI learns, makes decisions, or even uses math to predict your next move? You’re in the right place! We’ll break it all down into simple, fun steps, with real-world examples and friendly analogies.
Whether you’re curious about how AI recognizes your face or how it gets better with practice, this guide will make you feel like an AI pro in no time.
Ready to unlock the secrets of your electronic brain friend? Let’s get started! 🚀
Meet Your Electronic Brain Friend!
Imagine having a super-smart toddler who grows up at lightning speed. That's basically what AI is! Just like how babies learn to recognize their parents' faces, take wobbly first steps, and eventually string together sentences, AI starts from scratch and learns through experience. The big difference? While it took you years to learn how to walk and talk, AI can zoom through its "childhood" at super-speed!
Think of AI as your device's brain that learns from everything it sees – kind of like how you learned not to touch a hot stove (ouch!) or that dogs say "woof" and cats say "meow." It's constantly absorbing information and getting smarter, just like we do, but with one hilarious twist: it can master complex math problems in seconds but might get totally confused by a simple joke!
🤖 Fun Fact: AI can learn to recognize thousands of cat photos in just a few hours, but it still hasn't figured out how to tie shoelaces like a human! Some things that are super easy for us can be really tricky for AI, while things we find difficult can be a piece of cake for our digital friends.
The Big Four Steps of AI Learning
Now that you’ve met your electronic brain friend, let’s dive into how AI actually learns. Think of AI as a student in a giant classroom called “The World.” It doesn’t have a teacher standing over its shoulder, but it does have four key steps to follow: Eating Information (Data Collection), Making Sense of Things (Processing), Finding Patterns (Machine Learning), and Getting Better with Practice (Improvement). These steps are like a recipe for learning—each one builds on the last, and together, they help AI grow smarter over time. Let’s break them down one by one, with real-world examples to make it all crystal clear.
Step 1: Eating Information (Data Collection)
Imagine you’re teaching a toddler what a dog is. You’d show them pictures of dogs, point to real dogs at the park, and maybe even make barking sounds. Over time, the toddler learns to recognize dogs based on all the examples you’ve given them. AI works the same way—it needs *lots* of examples to learn. This first step is all about data collection, or as we like to call it, eating information.
Real-World Example: Teaching AI to Recognize Dogs
Let’s say you want AI to recognize dogs in photos. First, you’d feed it thousands (or even millions) of dog pictures. These pictures are the AI’s “textbooks.” The more data it has, the better it gets at its job. But here’s the catch: the data has to be high-quality. If you feed it blurry or mislabeled pictures, the AI might get confused and think a cat is a dog. (And trust me, cats would not be happy about that.)
Why This Matters:
Data is the foundation of AI. Without it, AI would be like a chef without ingredients—stuck and unable to create anything. The more diverse and accurate the data, the smarter AI becomes.
🤖 Fun Comparison: Think about how you learned to ride a bike. You didn’t just hop on and start pedaling perfectly. You practiced over and over, falling a few times along the way. AI learns the same way—through repetition and lots of data.
Step 2: Making Sense of Things (Processing)
Once AI has all that data, it needs to make sense of it. This is where processing come in. Think of it like cooking: you have all the ingredients (data), but you need a recipe (algorithm) to turn them into something delicious. Processing is where AI takes raw data and turns it into something meaningful.
Real-World Example: How AI Recognizes Faces
When AI processes data, it’s like a detective looking for clues. For example, facial recognition AI analyzes features like the distance between your eyes, the shape of your nose, and the curve of your jawline. It uses these clues to create a unique “faceprint” that it can use to identify you later.
Why This Matters
Processing is where AI turns raw data into meaningful information. It’s like turning flour, sugar, and eggs into a cake—without this step, you’d just have a messy kitchen.
Step 3: Finding Patterns (Machine Learning)
Now that AI has processed the data, it’s time to find patterns. This is where the magic happens, thanks to a technique called machine learning. Machine learning is like teaching AI to recognize multiplication is like teaching AI to recognize multiplication tables—once it knows the pattern, it can solve any problem.
Real-World Example: Netflix Recommendations
Netflix uses machine learning to recommend shows you’ll love. It looks at what you’ve watched before, finds patterns, and says, “Hey, you liked Doctor Strange, so you’ll probably love Iron Man.” The more you watch, the better it gets at predicting your preferences.
Why This Matters
Machine learning is what makes AI adaptable. It doesn’t just follow instructions—it learns from experience and gets better over time.
🤖 Fun Comparison: Just like you know it might rain when you see dark clouds, AI knows you’ll love a movie based on your watching habits.
Step 4: Getting Better with Practice (Improvement)
AI doesn’t stop learning after it finds patterns—it keeps improving with practice. Think of it like playing a video game. At first, you’re terrible, but the more you play, the higher your score gets. AI works the same way. It learns from its mistakes and gets better over time.
Real-World Example: AI-Powered Chess Programs
Take AI-powered chess programs like AlphaZero. At first, they’re not very good. But the more games they play, the better they get. In fact, AlphaZero taught itself to play chess at a superhuman level in just a few hours by playing millions of games against itself. Talk about dedication!
Why This Matters
Improvement is what makes AI powerful. It’s not just about learning—it’s about getting better with every experience.
Putting It All Together: A Day in the Life of AI
Let’s tie it all together with a real-world example: **AI in Self-Driving Cars**.
- Data Collection: The car’s sensors collect data about the road, other cars, and pedestrians.
- Processing: The AI processes this data to understand what’s happening around it.
- Finding Patterns: It uses machine learning to recognize patterns, like stop signs, traffic lights, and lane markings.
- Improvement: The more the car drives, the better it gets at navigating complex situations, like merging onto a highway or avoiding a cyclist.
How Does AI Use Math to Make Decisions?
Now that you know how AI learns through those four big steps, you might be wondering: “But how does AI actually make all these decisions? What’s happening inside its electronic brain?” Well, here’s a fun secret: AI uses math!
Hey there! I know what you’re thinking—“Oh no, not math!” But hold onto your calculators, because this isn’t the kind of math that gives you homework headaches. This is more like the math you use when you’re splitting pizza with friends or figuring out if you’ve saved enough money to buy your favorite toy. Math is just AI’s way of making choices—and it’s way cooler than you think.
Math is AI’s Superpower
At its core, AI is all about making decisions. Should it recommend a movie? Is that a dog or a cat in the photo? Should the self-driving car turn left or right? To answer these questions, AI uses math to weigh the options and pick the best one. Let’s break it down with some fun examples.
Probability: The Pizza Topping Problem
Imagine you’re choosing toppings for a pizza. In your head, you might think:
- Pepperoni is always delicious (100% yum chance!).
- Pineapple is sometimes good (50% maybe?).
- Anchovies… well, let’s not go there (0% nope!).
That’s exactly how AI uses math! It gives everything a number (we call this probability) to help make decisions. For example, when Netflix suggests shows to you, it might think:
- “This person watched 8 out of 10 superhero movies” (80% chance they like superheroes!).
- “They only finished 1 out of 5 romantic movies” (20% chance they like romance…).
- “Better suggest the new Batman movie!”
By assigning probabilities, AI can make smart guesses about what you’ll like—and it gets better with practice.
Counting Like a Robot
Think about how you organize your toys or trading cards. You might sort them by:
- Color (all the blue ones together).
- Size (smallest to biggest).
- How much you like them (favorites first!).
AI does something similar, but with everything! When it looks at a photo of a dog, it’s basically doing a giant checklist:
- Floppy ears? +10 points.
- Wet nose? +5 points.
- Wagging tail? +15 points.
- Total = 30 points… “Yep, that’s definitely a dog!”
This process is called scoring, and it’s how AI makes decisions based on the data it has.
AI’s Favorite Math Tools
Now that you know the basics, let’s dive into some of AI’s favorite math tools. These are the tricks it uses to make decisions, predict outcomes, and even learn from its mistakes.
1. Counting Cards: Keeping Score
Just like keeping score in a game, AI counts everything. It tracks:
- How many times you click on cat videos.
- How often you order pizza.
- What time do you usually go to bed?
For example, if you’ve watched 10 cat videos in a row, AI might think: “This person really loves cats. Let’s show them more cat content!” It’s like having a super-observant friend who remembers all your favorite things.
2. Making Charts: Visualizing Data
Remember those pie charts you made in school? AI loves those! It uses charts and graphs to understand patterns in data. For example:
- “80% of people click the red button.”
- “Only 5% of kids eat their vegetables first.”
- “Everyone loves ice cream!” (Okay, that’s just a fact 😋).
By visualizing data, AI can spot trends and make better decisions. For instance, if 90% of people prefer chocolate ice cream over vanilla, AI might recommend chocolate to new customers.
3. Playing “What If?”: Predicting the Future
One of AI’s coolest tricks is its ability to predict things. It uses math to play the ultimate game of “What If?” For example:
- If you liked the first Harry Potter movie, you’ll probably like the second one.
- If you enjoyed that chocolate ice cream, you might like chocolate cake too.
- If you’re usually asleep by 9 PM, your smart home should probably start dimming the lights at 8:30 PM.
This is called predictive modeling, and it’s how AI helps us make smarter choices in everyday life.
4. Sorting and Ranking: Organizing the World
AI is like the ultimate organizer. It sorts and ranks everything to make sense of the world. For example:
- When you search for “best pizza near me,” AI ranks the results based on reviews, distance, and your preferences.
- When Spotify creates a playlist for you, it ranks songs based on how often you’ve listened to them and what mood you’re in.
- This process is called ranking algorithms, and it’s how AI helps us find what we’re looking for—fast.
Real-World Example: AI in Action
Let’s put it all together with a real-world example: AI in Online Shopping.
- Counting Cards: AI tracks what you’ve bought before and how often you shop.
- Making Charts: It analyzes trends, like which products are popular this season.
- Playing “What If?”: It predicts what you might want to buy next.
- Sorting and Ranking: It shows you the most relevant products first.
The result? A personalized shopping experience that feels like magic—but it’s really just math!
The Cool Science Behind AI
So now you know how AI learns and uses math to make decisions. But if you're still curious and want to dig a little deeper, let's go on an adventure to explore what's really happening inside AI's "brain"! This part is optional, but I promise it's pretty cool!
Think of this as the “behind-the-scenes” tour of your favorite movie—except instead of special effects, we’re talking about neural networks, algorithms, and a whole lot of data.
Neural Networks: The Brain of AI
At the heart of AI is something called a neural network. Don’t let the fancy name scare you—it’s just a way of mimicking how the human brain works. Here’s how it breaks down:
The School Classroom Analogy
Imagine a neural network as a classroom full of students (called neurons). Each student has a specific job:
- Some students are responsible for spotting shapes (like circles or squares).
- Others focus on colors (like red or blue).
- And some put it all together to recognize objects (like a stop sign or a cat).
These students work together to solve a problem, passing information to each other until they reach a conclusion. For example, if the task is to recognize a cat, one group of neurons might identify pointy ears, another might spot whiskers, and another might recognize a tail. Together, they shout, “It’s a cat!”
🤖 Fun Fact: Neural networks are inspired by the human brain, but they’re way simpler. Your brain has about 86 billion neurons. A typical AI neural network might have just a few thousand. So, AI is smart, but it’s not that smart—yet.
How Neural Networks Learn: The 20 Questions Game
Remember playing 20 Questions as a kid? You’d think of an object, and your friend would ask yes-or-no questions to guess what it was. Neural networks learn in a similar way. They ask a series of questions (or make calculations) to narrow down the answer.
Real-World Example: Image Recognition
Let’s say you show AI a picture of a dog. The neural network starts by asking:
- Is there fur? (Yes.)
- Are there pointy ears? (Yes.)
- Is there a tail? (Yes.)
- Is it small enough to fit in a purse? (No.)
Based on these answers, the AI concludes: “It’s a dog, not a cat.” The more pictures it sees, the better it gets at asking the right questions and making accurate guesses.
Algorithms: The Recipes for AI
If neural networks are the brain, then algorithms are the recipes that tell AI what to do. An algorithm is just a set of instructions, like a cooking recipe or a DIY tutorial. Here’s how it works:
The Cooking Analogy
Let’s say you’re baking cookies. Your recipe might look like this:
- Preheat the oven to 350°F.
- Mix flour, sugar, and butter.
- Add chocolate chips.
- Bake for 10 minutes.
An algorithm is similar, but instead of baking cookies, it’s solving a problem. For example, an algorithm for recognizing faces might say:
- Detect the edges of the face.
- Identify the eyes, nose, and mouth.
- Measure the distance between these features.
- Compare the measurements to a database of known faces.
🤖 Fun Comparison: Just like you can tweak a cookie recipe to make it better (more chocolate chips, anyone?), scientists tweak algorithms to make AI smarter.
Training AI: Practice Makes Perfect
AI doesn’t just magically know how to recognize cats or play chess. It has to train, just like an athlete or a musician. Training involves feeding the AI lots of data and letting it practice until it gets better.
Real-World Example: AI Playing Chess
When AI learns to play chess, it starts by playing millions of games against itself. At first, it makes terrible moves (like sacrificing its queen for no reason). But over time, it learns which strategies work and which don’t. Eventually, it becomes a chess master, capable of beating even the best human players.
The Role of Big Data: Fuel for AI
You’ve probably heard the term big data thrown around, but what does it actually mean? In simple terms, big data refers to the massive amounts of information that AI uses to learn. Without data, AI would be like a car without fuel—it wouldn’t go anywhere.
Real-World Example: Weather Forecasting
Weather forecasting AI uses big data to predict the weather. It analyzes historical weather patterns, current conditions, and even satellite images to make its predictions. The more data it has, the more accurate its forecasts become.
🤖 Fun Fact: AI can predict the weather up to 10 days in advance with surprising accuracy. So, the next time your weather app says it’s going to rain, you can thank AI for the heads-up!
Conclusion: A Day in the Life of AI
Let’s wrap this up with a quick story to show just how much AI is already part of your world. Imagine it’s Monday morning. Your AI-powered alarm clock wakes you up at the perfect time, based on your sleep patterns. As you stumble to the kitchen, your smart coffee maker has already brewed your favorite blend. On your way to work, your GPS uses real-time traffic data to find the fastest route, avoiding accidents and construction zones. At lunch, you scroll through Netflix, and AI suggests a show so perfect it feels like it reads your mind. On your way home, AI adjusts the traffic lights to keep things moving smoothly. And at night, your robot vacuum cleans up while you relax.
AI isn’t just a futuristic dream—it’s already here, making life easier and more fun. From the moment you wake up to the time you go to bed, AI is working behind the scenes to help you out. And the best part? It’s only going to get smarter.
The Future of AI: What’s Next?
The possibilities for AI are endless. It could help us discover new planets, cure diseases, or even create art that moves us to tears. But no matter how advanced AI becomes, it’s important to remember that it’s just a tool—a really smart tool, but a tool nonetheless. It’s up to us to use it wisely and make sure it benefits everyone.
So, the next time you ask Siri a question, get a recommendation from Netflix, or marvel at a self-driving car, take a moment to appreciate the incredible technology behind it. AI isn’t just changing the world—it’s changing the way we live in it.
FAQs
1. What is AI, and how does it work?
AI, or Artificial Intelligence, is a computer system designed to mimic human intelligence. It works by following four key steps: data collection, processing, finding patterns, and improvement. Think of it like teaching a child—AI learns from examples, makes sense of information, spots patterns, and gets better with practice.
2. How does AI use data to learn?
AI needs lots of data to learn, just like a student needs textbooks. For example, to recognize dogs, AI is fed thousands of dog pictures. The more high-quality data it has, the better it gets at its job. Without data, AI wouldn’t have anything to learn from!
3. What’s the difference between AI and machine learning?
AI is the broader concept of machines performing tasks that require human-like intelligence. Machine learning is a subset of AI that focuses on finding patterns in data. For example, Netflix uses machine learning to recommend shows based on your watching habits.
4. How does AI improve over time?
AI improves through practice, just like humans do. For example, AI-powered chess programs like AlphaZero play millions of games against themselves to get better. The more data AI processes and the more mistakes it learns from, the smarter it becomes.
5. How does AI use math to make decisions?
AI uses math to weigh options and make smart choices. For example, it assigns probabilities (like a 90% chance you’ll like a movie) or scores (like +10 points for floppy ears in a dog photo). It also uses tools like counting, ranking, and predictive modeling to organize information and predict outcomes. Math is the secret sauce that helps AI make decisions!
Discover what AI is, how it works, and why it’s not something to fear. Learn how AI is already making your life easier and shaping the future
OpenAI is awarding a $1 million grant to a Duke University research team to look at how AI could predict human moral judgments.
When devices, networks, and AI work together seamlessly, it creates a smarter, more connected ecosystem.