How AI works

arqiv✳

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

Traditional programming takes rules and data and produces answers. Machine learning takes data and answers and produces the rules. TRADITIONAL PROGRAM Rules Data Computer Answers MACHINE LEARNING Data Answers Training Rules (a model) Example: 10,000 photos labeled “cat” or “dog”→ a model that can label new photos.

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.

Interactive neuron

Neuron with three inputs (friends going, weather, homework) feeding into a sum that produces a go or stay decision
Go!

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.

“Deep learning” just means a network with many layers.

What each layer learns to spot

Neural network with input pixels, layers detecting edges, shapes and parts, and an output deciding cat or dog

How learning actually happens

Guess. Check.
Nudge. Repeat.

Training is a loop that runs billions of times. Each lap makes the model a tiny bit less wrong.

The training loop

Training loop: make a guess, measure the error, nudge the weights, repeat 1 · GUESS“That’s a dog” 2 · CHECKAnswer: cat ✗ 3 · NUDGEadjust weights 4 · REPEATnext example × billionsof times

Gradient descent · walking downhill in fog

A ball rolling step by step down a curved error valley toward the lowest point start: lots of errorlowest error found← all the possible weight settings →↑ higher = more error
Imagine standing on a foggy hill and wanting to reach the bottom. You can’t see far, so you feel which way is downhill and take a small step. Repeat. That’s how a model finds weights that make fewer mistakes.

Three ways to learn

Teacher, explorer
or player

Most AI systems use one or a mix of these. Modern chatbots use all three.

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.

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 is an output, not a guarantee. 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.