Tokencito Game of the day Play

What is machine learning?

Machine learning is the part of artificial intelligence where a program learns patterns from examples instead of following hand written rules. It then uses those patterns to make predictions about new cases: how long a delivery will take, whether a photo shows a cat or which word comes next in a sentence.

📚Lots of text🔍Patterns💬New answer

Put it to the test

A question from the app. Pick an answer.

How did a language model learn its patterns?

Play the full lesson: What is AI?

How it learns: an example with numbers

Picture a food delivery app that wants to tell you how long your order will take. Nobody writes a rule for every street. Instead, it gets, say, 50,000 past orders with the distance, the time of day, whether it was raining and how many minutes each one really took. During training, the program adjusts its internal numbers until its predictions get close to those real times.

The result of that process is a model. When a new order comes in, the model does not look for an identical one in the list: it uses the patterns it learned (farther and rainy means more minutes) to estimate a number.

Three ways to learn

Supervised: each example comes with the right answer. Photos of avocados labeled "ripe" or "unripe", and the model learns to tell them apart. Unsupervised: the examples come with no answer and the model looks for groups on its own, like a supermarket discovering kinds of shoppers from what they buy. Reinforcement: the program tries actions and gets a reward or a penalty, like someone learning a video game one match at a time.

Language models like ChatGPT are machine learning too: they were trained on huge amounts of text by learning to predict the next piece, and then tuned with examples and ratings from people.

The data decides

A model learns patterns from its examples and uses them on new cases; if those cases do not look like the examples, it can fail. If a speech recognizer was trained mostly on accents from one region, it often understands people with other accents worse. If the delivery model only saw orders from a flat city with no traffic, it will miss in a hilly city with jams.

Another classic problem is memorizing instead of learning: the model gets almost everything right on its training examples and fails on new ones, like someone who memorized the answers to an old exam. That is why models are always tested on examples they never saw.

Common mistakes

"Machine learning and artificial intelligence are the same thing." Machine learning is one part of AI, today the most widely used. "It learns from everything I tell it." Many models stay fixed after training: they do not change while you use them unless someone trains them again. "More data is always better." More bad or duplicated data teaches more mistakes.