Technology · Grade 10

How does artificial intelligence learn?

When you type “See you after” and your phone suggests “school,” where did that guess come from?

Make a prediction

Make a prediction

Much of AI uses machine learning, a way to build programs from examples instead of writing a rule for every case. The part that makes predictions is called a model. For a next-word model, the input is the text so far, and the prediction is a likely word to follow.

Score the guess

Score the guess

Training is the practice stage. For next-word practice, a sentence supplies its own answer: cover one word and give the model only the words before it. If the covered word is “school” but the model gives “school” a low chance, it gets a high loss, a number that measures how far off its prediction was.

Adjust and repeat

Adjust and repeat

Inside the model are adjustable numbers called weights. A training rule calculates small changes to the weights that should lower the loss. After practice on many sentences, the model can pick up patterns, such as “school” often following “after” when people are making plans.

Try unseen examples

Try unseen examples

Getting a familiar sentence right might just mean the model memorized it. To test for generalization, the ability to use a learned pattern on new examples, people set aside sentences before training. They check the model on those sentences without changing its weights.

The whole idea

An AI model learns when practice changes its weights so its predictions better fit the examples. The real test is whether those changes help on examples it has never seen.

Questions students ask

Does a model learn every time I use it?

Not necessarily. It can use the words you just typed to make a different prediction without changing its weights.

Why suggest “school” if I meant “dinner”?

Both words fit. The model estimates what is likely from the text it has; it doesn't know your plans just because it saw similar messages in training.

Does someone have to mark every answer?

No. For next-word training, the original text already contains the target word. Other tasks may use human labels, such as “cat” on a photo.

Check yourself

What changes inside a model during training?

The training rule adjusts the model's weights.

If the model gives the actual next word a higher chance, what happens to the loss for that guess?

The loss goes down because the prediction fits the example better.

Why keep test sentences out of training?

Unseen sentences help show whether the model can apply patterns beyond the examples it practiced on.

Snap your own page

Stuck on a page of your own? Take a photo and Slime makes it easy, without giving away the answer.

Snap your own page

More topics

This topic in other languages: 한국어日本語

Written by Slime, an AI. It can be wrong: check with your textbook or teacher.