01 / How AI works
A machine that learns from examples
Normal software follows rules a programmer wrote. Machine learning, the kind of AI behind today's chatbots and photo apps, is different: you show it thousands of examples and it figures out the rules itself. Here's how that works, from one tiny artificial neuron to a network of billions.
The flip that makes it machine learning
Building block · the artificial neuron
One tiny decision maker
An artificial neuron is loosely inspired by brain cells, but it's really simple math. It takes a few inputs, multiplies each by a weight (how much that input matters), adds them up, and fires if the total is big enough.
Try it with a decision you make every week: should I go to the game tonight? Move the sliders. Then change the weights to see how a different person (or a trained model) would decide.
"Learning" just means finding good weights automatically. A big AI model has billions to trillions of them.
Want to wire one up yourself? Play Connect the Clues, a short puzzle game where clues, weights and a final guess light up a circuit.
Interactive neuron
Stack them up · neural networks
Layers that see
more and more
Connect thousands of neurons in layers and you get a neural network. Each layer passes its results to the next.
In an image model, the first layer might notice edges, the next combines edges into shapes, then shapes into eyes and ears, and the last layer decides "cat." Nobody tells the layers to do this. It emerges from training, and this is a simplified picture: in real networks the roles overlap and are hard to pin down.
"Deep learning" just means a network with many layers.
What each layer learns to spot
How learning actually happens
Guess. Check.
Nudge. Repeat.
Training is a loop that runs billions of times. Each lap aims to make the model a little less wrong on average. Single steps can make things worse, so builders watch both the training error and how the model does on examples it has never seen.
The training loop
Gradient descent · walking downhill in fog
Three ways to learn
Teacher, explorer
or player
These are learning settings: where the learning signal comes from. Many systems mix them. A typical chatbot is pretrained with self-supervised learning, then trained further with supervised examples and often reinforcement learning from feedback.
Supervised
Learning with an answer key
Every example comes with the right answer ("this email is spam"). The model learns to match them. Used for photo tagging, spam filters, medical scans.
Self-supervised
Learning by filling in blanks
Hide part of the data and predict it, like guessing the next word in a sentence. No human labels needed, so it scales to the whole internet. This is how chatbots learn language.
Reinforcement
Learning by trial and reward
Try something, get points for success, try again. That's how today's reasoning models learn to work through math problems. AlphaGo used it too: after first studying human expert games, it became a Go champion by playing against itself over and over.
A fourth setting, unsupervised learning, has no answer key at all: the model looks for structure on its own, such as groups of similar songs. People still have to decide what those groups mean. Finding groups · all four compared in How can examples become a rule?
Using it well
How do you know
it learned?
Training is only half the job. Here's how to check what a model really learned.
01 / Train
Find a pattern
Imagine sorting messages into spam and not spam. During training, a model adjusts internal values to make its predictions fit labeled examples.
02 / Test
Try something new
A good score on practice examples is not enough. Test on held-out examples that resemble the situations where you want to use the model.
03 / Verify
Keep checking
A prediction can still be wrong. An unfamiliar input, an unrepresentative dataset or an unreliable label can lead to a mistake.
The important distinction
Confident isn't
the same as correct.
Generative AI produces new text, images or other outputs from learned patterns. A fluent answer can still contain a false claim or an invented source.
For a claim that matters, find the original evidence, check that it supports the exact claim, and notice what is still uncertain. Asking another bot to agree is not an independent fact-check.
Background: IBM: machine learning · NIST: managing AI risks
A 2-minute thought experiment
What did the model really learn?
Every training photo of a wolf has snow in the background. Every dog photo has grass.
What shortcut might a model learn?
It might learn "snow = wolf" instead of anything about the animal. A husky in the snow would be called a wolf.
How could you test that possibility?
Show it wolves on grass and dogs in snow. If accuracy collapses, it learned the background, not the animal.
A useful question: what examples are missing?
Put curiosity to work
Read it. Try it. Question it.
Explore new AI research, or take a paper-first investigation into your classroom.