• Foundation
  • About 15 min
  • 5 practice questions

Artificial intelligence and how machines learn

Define artificial intelligence, tell narrow AI from general AI, and identify supervised, unsupervised and reinforcement learning from examples.

If something looks wrong, please tell us.

Voice assistants, translation apps, spam filters and face unlock on a phone are all forms of artificial intelligence. AI is now a regular topic in general studies and computer awareness. This lesson explains what AI is, what it is not yet, and the three main ways a machine can learn.

What artificial intelligence means

Artificial intelligence (AI) is the ability of computer systems to do tasks that normally need human intelligence: recognising speech and images, understanding language, translating, making predictions and decisions. In 1950 the mathematician Alan Turing proposed a test, now called the Turing test: if a person chatting by text cannot reliably tell whether they are talking to a machine or a human, the machine could be called intelligent. The term 'artificial intelligence' itself was coined by John McCarthy for a research workshop held at Dartmouth College in 1956.

Narrow AI and general AI

Narrow versus general AI
TypeWhat it meansStatus
Narrow (weak) AIBuilt for a specific task or set of tasks - playing chess, recognising faces, recommending videos, translating textAll AI in use today is narrow AI
General AI (AGI)Would match human ability across almost any intellectual task and transfer learning from one area to anotherA goal of research, not an achieved fact

Machine learning: learning from examples

In ordinary programming a person writes the rules: 'if the email contains these words, mark it as spam'. In machine learning (ML), the computer is given many examples and works out the rules - the pattern - by itself. The result of this learning is called a model. The examples it learns from are its training data. Machine learning is a part of AI, and today it is the most widely used part.

The three main types of machine learning
Type of learningWhat the data looks likeWhat the machine doesEveryday examples
Supervised learningExamples come with the right answer (labels)Learns to predict the label for new examplesSpam filter, recognising handwritten digits, predicting a house price
Unsupervised learningExamples have no labelsFinds hidden groups or patterns by itselfGrouping customers with similar buying habits, spotting unusual transactions
Reinforcement learningNo fixed data set; an agent acts in an environmentLearns by trial and error from rewards and penaltiesGame-playing programs, a robot learning to walk

Supervised learning has two common jobs: classification (choosing a category - spam or not spam) and regression (predicting a number - tomorrow's temperature).

Worked example 1: name the learning type

A bank gives a program 10,000 old emails, each already marked 'spam' or 'not spam', and wants it to sort new emails. Working: the examples carry the correct answer, so this is supervised learning, and since the output is a category it is a classification task. If instead the bank gave the program customer records with no labels and asked it to find natural groups, that would be unsupervised learning.

Worked example 2: testing a model fairly

A model is checked on 200 emails it has never seen. It sorts 184 correctly. Accuracy = 184 ÷ 200 × 100 = 92%. The test must use new examples: testing on the training emails would be like setting an exam using the exact questions a student practised, which shows memory rather than learning.

Supervised = learns from labelled examples. Unsupervised = finds patterns in unlabelled data. Reinforcement = learns by trial, reward and penalty. All AI in use today is narrow AI.

Key takeaways: AI is machines doing tasks that need intelligence; the Turing test (1950) and the term 'artificial intelligence' (1956) mark its beginnings. Today's AI is narrow; general AI remains a research goal. Machine learning learns patterns from data, in three main ways: supervised, unsupervised and reinforcement.

Check your understanding

  1. 1. Which of these is an example of narrow AI?

    1. A machine that matches humans at every intellectual task
    2. A robot that can do any job a person can learn
    3. A system that understands all subjects and transfers knowledge freely
    4. A chess-playing program
    Show answer

    Answer: D. A chess program is built for one task, which makes it narrow AI. The other three describe general AI, which would match humans across tasks and is still a research goal.

  2. 2. A model is trained on photographs each labelled 'cat' or 'dog'. This is:

    1. Supervised learning
    2. Unsupervised learning
    3. Reinforcement learning
    4. Not machine learning at all
    Show answer

    Answer: A. The training examples come with the correct answer (the label), so this is supervised learning, and the task is classification.

  3. 3. An online shop asks a program to find groups of customers with similar buying habits, without telling it what the groups should be. Which type of learning is this?

    1. Supervised learning
    2. Reinforcement learning
    3. Unsupervised learning
    4. Rule-based programming
    Show answer

    Answer: C. No labels are given and the program discovers the groups itself (clustering), which is unsupervised learning.

  4. 4. A program learns to play a video game by trying moves and receiving points for good results and losing points for bad ones. This is:

    1. Supervised learning
    2. Reinforcement learning
    3. Unsupervised learning
    4. Data entry
    Show answer

    Answer: B. Learning by trial and error from rewards and penalties is reinforcement learning. There is no labelled data set of correct moves.

  5. 5. A model gets 270 out of 300 new test cases right. What is its accuracy?

    1. 27%
    2. 93%
    3. 90%
    4. 10%
    Show answer

    Answer: C. Accuracy = 270 ÷ 300 × 100 = 90%. The 10% figure is the error rate, the share it got wrong.

Privacy · Terms · Refunds · Delivery