Skip to content
Search

Text and colours

Text size
Colours

This browser remembers your settings.

Lesson 1 of 4 · 15 min

How language models work (and why they make things up)

Text prediction, hallucinations, and why a confident tone is not proof of truth.

Chatbots built on large language models now write emails, summarise documents and answer questions. They come across as all-knowing assistants. To work with them sensibly, you only need to grasp one basic idea: at its core, a language model is a text-prediction machine.

Autocomplete on a grand scale

You know it from your phone: you type "Thanks for your" and the keyboard suggests "message" or "help". A language model does essentially the same thing, just on a vast scale. During training it "read" an enormous amount of text and learned which words (more precisely, fragments of words) tend to follow others.

When you ask it a question, it does not look the answer up in a database of verified facts. It builds, word by word, the text that is likely to follow your question. The result is often surprisingly good, because the training texts contain a huge amount of knowledge. But the model's goal is a plausible-sounding continuation, not verified truth.

What is a hallucination?

A hallucination is when a model produces a statement that sounds convincing but is false or invented. Typical examples:

  • non-existent citations – an article, book or study with a plausible title, author and year that was never published,
  • invented sections of law and court rulings – a correct-looking legal reference that says something else or does not exist,
  • precise but made-up figures – percentages and statistics with no real source,
  • mixed-up people and events – a name linked to the right field but the wrong deed or date.

Why does it happen? A model has no built-in sense of "I don't know this". When you ask for a source, it knows what a source looks like (author, title, year, journal) and produces text in that shape. If it does not "know" a matching real source, the result can be a perfectly formatted fabrication.

Some tools can now search the web and link to the pages they find. That helps, but it does not solve the problem completely: the model may summarise a source badly or attribute to it something it does not say.

A confident tone is not evidence

With people, we are used to uncertainty showing in their speech: "probably", "I think", "I'd have to check". A language model does not reliably have such an internal signal. It often writes a correct answer and a fabricated one equally fluently, equally confidently and equally neatly formatted.

The reverse also happens: if you ask a model "Are you sure?", it may apologise and change a correct answer into a wrong one – because an apology is a likely continuation of that kind of conversation.

Two practical rules follow:

  1. Judge the content, not the form. Bullet points, bold text and technical terms are not signs of accuracy.
  2. The more specific the claim, the more you should check it. Names, figures, dates, citations and legal references are where hallucinations appear most often.

Game: Spot the hallucination

Read the fictional chatbot answers and click the parts that are very likely invented or that should not be used without tracking down the source. Not every answer contains such a part, though.

If you see nothing suspicious in a message, choose “I see nothing suspicious”.

Round 1 of 3 · Found: 0

Illustrative example

A user asks: "Is it proven that working from home increases productivity?" (fictional answer)

Research on working from home has produced mixed results. It depends on the type of work, how the work is organised, and what exactly is being measured as productivity. For example, a large 2019 study by Heidelberg University, published in the Journal of Remote Work Studies, found that employees working from home are on average 37% more productive. Some teams, on the other hand, report missing informal communication and quick consultations. For a particular organisation, it therefore makes sense to track its own indicators and staff experience.

Sample no. 105

Check your understanding

Quiz · 0/3
  1. 1. What does a language model do when it answers a question?

  2. 2. A chatbot answers your question very confidently, with bullet points and a reference to a study. What follows?

  3. 3. Where in an answer do hallucinations appear most often?

Found a mistake or inaccuracy in this lesson?Report a mistake

What next

Done? Next lesson: How to check AI output (15 min)

The whole course is free, no sign-up needed.

Continue with the next lesson →