Understanding AI
How Does Machine Learning Work?
2 min read
Learning from examples
Machine learning (ML) is the technique behind most modern AI. The core idea: instead of programming rules, you show the system many examples and let it figure out the rules itself.
The three ingredients
Every ML system needs three things:
- Data — thousands (sometimes millions) of labeled examples. "This photo is a cat. This one is a dog."
- A model — a mathematical structure that can learn patterns. Think of it as a panel of adjustable dials.
- Training — the process of adjusting those dials until the model gets the right answer most of the time.
An analogy: learning to grade math tests
Imagine a student learning to grade math exams. At first, they make random guesses about what earns full marks vs. partial credit. You show them the correct grade for each test. Slowly, they learn what a perfect answer looks like and what earns only half points.
An ML model does exactly this — just faster, and on millions of examples.
What "training" actually means
During training, the model:
- Makes a prediction on an example
- Compares that prediction to the correct answer
- Measures how wrong it was (the "error" or "loss")
- Adjusts its dials slightly in the direction that would reduce the error
- Repeats millions of times
This process — called gradient descent — is the engine behind almost all modern AI. The key insight: correct the mistakes, repeat until the errors are small.
Why this is powerful
Once trained, the model can make good predictions on data it has never seen before. It generalizes from examples to new situations, just like a person would after enough practice.
The catch
A model is only as good as its training data. If the examples are biased, incomplete, or mislabeled, the model will learn those flaws. This is one of the most important things to understand about AI — and one we'll revisit throughout this course.
What's next?
Now that you understand how AI learns, the next lesson will cover the different types of problems AI is used to solve in the real world.