← Using AI well

How a chatbot writes: predicting the next word

Large language models learn patterns from huge amounts of text.

Start this lesson

Most AI chatbots are built on a large language model (LLM). An LLM is trained on a huge amount of text (books, websites, articles and more). During training it learns patterns: which words tend to follow which, how explanations are shaped, what a polite email sounds like. When you ask it something, it writes the answer one small piece at a time, each time choosing a likely next piece based on everything so far. That is why answers sound fluent: fluent text is exactly what it learned to produce.

The capital of France is ___

After reading millions of sentences, a model has learned that "Paris" is by far the most likely next word here. It is not looking up a map; it is continuing a very familiar pattern.

"Likely" is not the same as "true". For common facts, the likely answer is usually the true one. For rare facts, tricky details or questions with no answer in its training, the model may still produce something that sounds likely but is wrong.

Companies also train models further, often with human feedback, so they follow instructions and answer helpfully. That makes them more useful, but it does not turn them into fact-checkers.