Lesson 4

How Does AI Learn? Teach Spark With Fruit

How does AI learn? Not from rules, and not from being told the answers. It learns from examples — thousands of them — getting a tiny bit better each time it is corrected. Teach Spark below and watch it happen.

Reading time: 7 minutes · Last updated

What this scene shows: Spark stands beside a pedestal holding a piece of 3D fruit (apple, banana, orange or grapes) and makes a guess. You tell Spark whether it was right or what the fruit really was. Behind Spark, a network of blue dots connected by lines glows brighter with every correction, and a meter shows Spark's skill rising.

Two ways to teach a machine

Imagine you wanted to teach a machine to tell apples from bananas. There are two ways you could try.

Way one: write the rules. “If it is red or green and round, it is an apple. If it is yellow and curved, it is a banana.” This sounds sensible. But what about a yellow apple? A green banana? A photo taken in dim light where everything looks brown? You would need thousands of rules, and you would still get caught out.

Way two: show examples. Show the machine a picture and say “apple”. Show another and say “banana”. Do this thousands of times. Don’t explain why. Let the machine work out the pattern for itself.

Way two is how almost all modern AI learns. It is called training, and it is exactly what you are doing when you correct Spark in the game above.

What is happening inside Spark

Behind Spark you can see a web of dots joined by lines. That is a very simple neural network — a drawing of the idea, not the real thing, which would have millions of dots.

Here is how it works in three steps:

  1. A picture goes in. Each dot on the left looks at a tiny part of the picture — a colour here, a curve there.
  2. Signals travel along the lines. Each line has a strength. A strong line passes lots of signal along, a weak line passes hardly any. The dots in the middle add up what they receive.
  3. A guess comes out. The dot on the right that receives the most signal is the answer: “banana!”

At the start, the line strengths are random, so the guesses are random too. Spark is just guessing.

The magic part: correction

Now you tell Spark “No, it’s an apple.” This is the important moment.

The network looks back at which lines led to the wrong answer and makes them a little weaker. It finds the lines that would have led to “apple” and makes them a little stronger. Just a tiny nudge. Then it waits for the next example.

One nudge doesn’t do much. But after a thousand examples — or a million — the strong lines form paths that reliably lead from “round, red, shiny” to “apple”. That is why the lines in Spark’s network glow brighter as you play. The pattern is settling in.

Nobody told the network what an apple looks like. It found out.

Why it needs so many examples

You can learn what a zebra is from one picture. An AI might need thousands. Why?

Because you already know a huge amount before you see the zebra. You know what an animal is, what stripes are, what four legs look like. The AI starts from nothing — random lines — and has to build all of that up from scratch.

This is why AI companies collect enormous amounts of data: pictures, text, sounds. More examples means more chances to nudge the lines in the right direction.

Garbage in, garbage out

Here is something the game shows you if you try it: what happens if you tell Spark an orange is a banana?

Spark believes you. The lines that lead to “banana” get stronger for orange-looking things. Do it enough times and Spark will confidently call every orange a banana.

The AI has no way to know you were wrong. It trusts its examples completely. This is one of the most important facts about AI: it is only as good as what it was taught with. If the examples are wrong, unfair or missing something, the AI will be wrong, unfair or blind to that thing too. Grown-ups call this a problem of bias in training data, and it is a big part of making AI safe and fair.

From fruit to everything

The fruit game is small, but the same idea scales up in an astonishing way.

The chatbots you may have used learned the same way — by seeing an enormous amount of text and being nudged, over and over, to guess the next word correctly. Image tools learned by looking at millions of pictures and their descriptions. The AI that predicts protein shapes for medicine learned from examples of known proteins.

Different data, same trick: examples in, nudges to the lines, better guesses out.

What learning from examples can’t do (yet)

Learning from examples has limits, and they matter for superintelligence.

Today’s AI mostly learns during training and then stops. It does not keep learning from every conversation the way you learn from every day at school. It can also be confidently wrong, because it learned patterns, not understanding — it knows that “banana” often follows “yellow curved”, not what a banana is.

Researchers are working on AI that keeps learning, checks its own answers and understands more deeply. Whether that leads to AGI and beyond is one of the biggest open questions in science.

For now, remember: every AI you meet was once like Spark at the start of the game — guessing at random, waiting for someone to show it an apple.

Quick quiz

3 questions

1. How does most modern AI learn?

Show answer

From lots of examples, adjusting a little each time. Nobody writes rules like 'bananas are yellow and curved'. The network finds the patterns itself from many examples.

2. What happens if you show an AI lots of wrongly labelled examples?

Show answer

It learns the wrong thing. The AI trusts its examples. Bad labels teach bad patterns — which is why good data matters so much.

3. Why do the lines in Spark's network get brighter?

Show answer

Because the connections that led to right answers are strengthened. Training strengthens the connections that helped and weakens the ones that didn't.