Skip to content
LSLab

How Do Machines Learn?

  • Starter
  • Article
  • Ages 10+
  • 4 min read
A small robotic arm sorting physical objects by shape on a laboratory table, illustrating learning from examples.

In machine learning, a computer trains a piece of software, called a model, to make useful predictions from data. One common approach is to analyze training examples. The model's logic is learned through experience instead of being programmed rule by rule.

Contents
Examples go through a repeating training process and produce a model.
  • Training examples
  • Repeated training
  • A model

What you will learn

  • Describe how a machine learns from examples.
  • Compare a machine that learns with a machine that follows written rules.
  • Explain why a model is adjusted again and again, and what it is for.

Before you start

You should know what artificial intelligence is. The article "What Is Artificial Intelligence?" covers that.

How does a machine learn from examples?

One common approach is to analyze training examples. With a neural net, a computer can learn to perform a task this way.

In the neural-net example described by MIT, examples are usually hand-labeled in advance. A label is a name that a person attaches to an example, such as the name of the object in a photo.

Imagine a picture-sorting program. It might be fed thousands of labeled images of cars, houses and coffee cups, and it would find visual patterns in the images. Nobody has to describe what a coffee cup looks like.

The machine looks at labeled examples and finds a pattern in them.
  • Labeled examples
  • Looking for patterns
  • A pattern that was found

How is learning different from following rules?

A rules-based system follows rules that a person wrote down. IBM gives a simple case: even a rudimentary thermostat is a rules-based AI system.

A machine-learning model works differently. According to IBM, the logic by which it operates is not explicitly programmed but learned through experience.

Google gives a weather example. An ML model is given enormous amounts of weather data until it eventually learns the mathematical relationship between weather patterns that produce differing amounts of rain.

The top row follows written rules; the bottom row passes through a model that learned from examples.
  • Following written rules
  • Learning from examples

How does a model get better?

In MIT's description of a supervised neural net, the network's weights and thresholds are initially set to random values. These are adjustable settings inside the network.

During training, those settings are continually adjusted until training data with the same labels consistently yield similar outputs.

For its spam-filter example, IBM describes a loop: calculate prediction error, adjust the algorithm to reduce it, then repeat with the aim of improving accuracy.

The model guesses, is compared with the answer, is adjusted, and guesses again.
  • The model makes a prediction
  • Comparing to see the error
  • Adjusting

What is all this learning for?

The aim is to do well on new cases. According to IBM, the fundamental goal of machine learning is generalization: turning strong performance on training data into useful results in real-world scenarios.

A model that only did well on the examples it had already seen would not be much use. Training is a way to reach that goal, not the goal itself.

The model learns from cards it has seen, then meets a new card and aims for a useful result.
  • Examples already seen
  • A trained model
  • A new case
  • A useful result

Real-world example

Think about how a younger child learns to tell apart a cat and a dog from picture books. Each page shows an animal and says its name. After many pages, the child can name an animal in a photo never seen before. A model learning from labeled examples can follow a similar path, then face new ones.

Common misunderstandings

Someone writes out every rule for the machine. According to IBM, a machine-learning model's logic is learned through experience, not explicitly programmed.

Learning happens in one go. In its spam-filter example, IBM describes repeatedly calculating error and adjusting the algorithm to reduce it.

Doing well on the practice examples is the end goal. The fundamental goal is generalization to real-world scenarios.

Frequently asked questions

What is a training example?

A training example is one piece of data a computer analyses while learning. In MIT's neural-net example, the examples are usually hand-labeled in advance.

What is a model in machine learning?

According to Google, a model is the piece of software that is trained to make useful predictions or generate content from data.

Does a machine learn all at once?

In MIT's description of a supervised neural net, weights and thresholds start at random values and are adjusted during training.

Summary

  • In MIT's supervised neural-net example, a machine analyzes examples that are usually hand-labeled.
  • IBM describes training its spam-filter example by repeatedly calculating errors and adjusting the algorithm to reduce them.
  • The fundamental goal is generalization: useful results in real-world scenarios.

Terms in this article

English and Vietnamese terms, with the meanings used here. Hover, tap or Tab to a term with a dotted underline for an explanation as you read.

Machine learningHọc máy
Training software with data to make useful predictions or generate content.
ModelMô hình
Software that learns from data during training to perform a task.
Training exampleVí dụ huấn luyện
An example a computer analyses while learning, such as a labelled photograph.
LabelNhãn
An answer or category attached to an example so a system can learn from it.
WeightTrọng số
A value adjusted during neural-network training that changes the influence of an input.
ThresholdNgưỡng
A reference value in a neural network, adjusted along with weights during training.
GeneralizationTổng quát hóa
Turning good results on training data into useful results on new real-world data.
Neural networkMạng nơ-ron
An approach to machine learning in which connected nodes are adjusted by analysing training examples.
Rules-based systemHệ thống dựa trên quy tắc
A system that follows preset rules, such as the simple thermostat discussed here.

This article is not marked as viewed

Spotted something wrong or unsafe?

Tell the administrator by email. The message already has the article title and address.

Report this article
See all articles of the topic

Sources

These sources are written for older readers. If they feel hard, read them with an adult.