Lesson 03 of 8 · 5 min
How an AI chatbot writes
The big idea
A large language model writes by guessing the next word over and over, and it has become very good at guessing.
Updated October 8, 2026
Think of it like this
Your phone's keyboard suggests the next word as you type. A large language model, or LLM, does the same thing, but it learned from a huge library of text, so its guesses are far better. Keep guessing one word at a time and you get sentences, paragraphs and whole reports.
How it works
- You give the model some text. This is called the prompt.
- The model looks at everything written so far and gives each possible next piece of text a score: how likely is it to come next?
- It picks one, usually one of the likely ones, with a little randomness mixed in.
- It adds that piece to the text and goes back to step 2. It stops when the answer is complete.
The randomness is why you can ask the same question twice and get two different answers. Many tools let you turn it up for creative writing or down for steady, repeatable answers.
The catch
The model writes what is likely, based on what it learned. By default it does not check facts against a source. Most of the time, likely and true are the same thing. Sometimes they are not, and the model writes something that sounds confident and is wrong. People call this a hallucination.
The fix is to give the model the facts it needs, and to check anything that matters. The lesson on RAG shows how.
Try it
On your phone, type "I'm running late because" and then tap the middle suggestion ten times in a row. You will get a strange sentence. An LLM is doing the same thing, with a much better sense of what makes sense.
Why it matters at work
LLMs are excellent at drafting, summarizing, rewording and explaining. They are weaker at exact facts, maths and anything that needs current information, unless you give them the source. Use them as a fast first draft, and keep a person in charge of what is true.