How a language model works, the engine behind ChatGPT and Claude

Why a chatbot writes so smoothly, and why you should not take its word for everything.

The core idea

A language model receives text and predicts which word should come next. It writes an answer the same way: step by step, one word at a time, picking the most likely continuation each time.

It is a bit like the word suggestions on your phone keyboard, except the model has read far more text and chooses words very precisely.

Why the answers sound human

The model learned from millions of texts: articles, letters, recipes, instructions, forums. So it knows well how an explanation, a polite letter or a travel plan should sound.

It does not hold an encyclopedia in its head. It reproduces how people write about things, and most of the time that is correct.

What follows from this

An answer can sound confident and still be false. The model does not check facts; it picks plausible text.

So for anything important (dates, numbers, names, medicines, money, the law) check the answer in an official source.

Glossary

Language model
A model that learned to continue text: it predicts which word comes next.
Chatbot
A program you talk to in text. A language model works inside it.