Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Free lesson

What AI does well and badly

After this lesson: I can weigh what AI does well and badly.

50 min lesson2 commandsJupyterLab data science lab: pandas, Matplotlib and scikit-learn in the browser

Three books, and one is made up

Sam asks a chatbot for three books to quote in an essay. It gives three titles, with authors and years, in a confident tone.

Two of the books are real. The third does not exist. The chatbot was not lying: it has no idea what is true. By the end of this lesson you will know why.

By the end of this lesson

Note

I can weigh what AI does well and badly.

Key words

WordWhat it means
Artificial intelligence (AI)computers doing tasks that seem to need thinking
Language modela program that predicts the next word of a text
Training datathe examples a model learns from
Made-up answerconfident output that is not true, also called a hallucination
Fairnesstreating people alike unless there is a good reason not to
Automated decisiona decision a computer makes with no person involved

The cells students fill in are left blank in this preview.

Before you start

Note

Press Start the lab on the bar at the top and wait until it is running. Each Run starts a short Python script inside the lab.

A language model guesses the next word

A language model reads text and learns which word tends to come next. The smallest kind just counts pairs of words.

After the word "the", which word came most often? Divide each count by the total and you get a chance for each next word. bigram.py does this on seven short sentences about a bike shop.

Count which word follows "the"

Command
docker exec jupyter python3 steps/bigram.py

Shown here, not run. Create a free account to press Run and type it into your own lab’s terminal.

Write four new sentences

Command
docker exec jupyter python3 steps/generate.py

Shown here, not run. Create a free account to press Run and type it into your own lab’s terminal.

Fluent is not the same as true

generate.py starts each sentence with "the" and picks each next word by chance, from the words that followed it in the text.

"the shop opens at nine ." is true. "the desk is by the desk ." sounds like English and means nothing. The program never checks anything against the real shop. It only knows which words go together.

Big models: the same idea, scaled up

The chatbots people use are language models too, trained on a huge amount of text. They read the whole conversation, not one word, and people have tuned them to be helpful.

Their writing is far better than ours. But they still produce likely words, not checked facts. That is why a book title can sound real and not exist.

What AI does well, and badly

AI tools are often good at drafting, rewording, summarising a text you give them, explaining an idea and suggesting code.

They are weak at facts they must recall exactly, such as dates, quotes and sources. They can slip on sums, miss recent events and rarely know when they are wrong. Some tools look things up first. That helps, but it does not make them always right.

Worked example: when to trust it

TaskHow AI doesHow you check
Summarise your own notesusually wellread it against your notes
Give three sources for an essayriskyfind each source yourself
Explain an error in your codeoften wellrun the fixed code
Work out 17% of £2,350riskyuse a calculator
Say who won last night's matchriskycheck a news site

The cells students fill in are left blank in this preview.

A common mistake

Warning

Many people think an answer that sounds sure must be right. A language model sounds just as sure when it is wrong, because it writes likely words. Check every fact, number and source before you use it. Follow your school's rules, and say when you used AI.

A model repeats the unfairness in its examples

A model learns from text and pictures people made, so it learns their unfairness too. Ask a picture tool for "a nurse" and "a boss" and it may show one sex for each.

This matters most when a model sorts people, for jobs, loans or marks. A group can be treated worse, and the people affected may never know why.

The law, in our own words

In the UK and the EU, data protection law also covers AI that uses personal data. Some decisions about you matter a lot, such as a job or a loan. If a computer alone made one, you can ask for a person to look at it again.

The EU has also agreed rules for AI itself. They sort uses by risk, ban a few outright, and ask for the most care where jobs, education or safety are at stake.

Going further: the costs nobody sees

Training and running big models uses a lot of electricity, and data centres use water to keep cool. Some writers and artists object that their work was used for training without being asked, and courts are still deciding such cases.

Pick one of these costs. Write three sentences: what it is, who pays it, and one thing that could make it smaller.

About this lab and its source: JupyterLab data science lab: pandas, Matplotlib and scikit-learn in the browser

Teaching a class? Set this module for your students with a teacher guide, marked assignments and a lab for every student.