Predicting the next word.
Behind a chat assistant is a large language model. It was trained on a very large amount of text with one task: given some text, predict what comes next. Doing that well across so much writing means picking up grammar, commonly repeated facts, the usual shape of a letter or a report, and the way questions tend to be answered.
When you send a message, the model reads it and produces a likely next piece. That piece is added to the text, and the model repeats the step with the longer text. This continues until the answer is complete, which is why an answer appears on screen a little at a time.
Tokens, and how much it can read at once.
The pieces are called tokens. A token is a word or part of a word, so a short common word is usually one token and a long or rare word is split into several. Usage limits and prices for AI tools are often counted in tokens.
A model can read only a limited number of tokens at once. This limit is the context window. It has to hold your message, the earlier conversation, any documents you attached and the standing instructions the assistant was given by whoever set it up. When a conversation grows past the limit, the earliest parts are dropped or shortened, and the assistant can lose track of something said much earlier.
Why the same question gets different answers.
At each step the model has several candidates for the next token, each with a different likelihood. The assistant sometimes takes a less likely one. A setting called temperature controls how much variety is allowed: a low setting gives more predictable text, and a higher one gives more varied text.
The result is that the same question can produce different wording on two tries, and sometimes a different answer. That suits drafting, where several versions are useful. It is a drawback where one fixed answer is needed every time.
What it learned from, and what gets added.
The model’s own knowledge comes from its training text and stops at its knowledge cutoff. It also has none of your private information unless you provide it.
Many assistants add to this. Some can search the web, some are connected to an organization’s documents, and some can use tools such as a calculator. In each case the text that was found is placed in the context window, and the model writes its answer from it. Finding text first and writing from it is called retrieval-augmented generation.
An answer built this way rests on what was found, so it is worth checking that the source says what the answer claims.
Try it: one word at a time.
Step through a sentence as a model completes it. The shares are invented to show the idea. A real model weighs many thousands of candidates at each step.
- STEP 1 OF 7
The meeting has been moved to next word
The assistant did not take the most likely word. This is the variety that temperature allows.
- STEP 2 OF 7
The meeting has been moved to next next word
- STEP 3 OF 7
The meeting has been moved to next week next word
Ending the sentence was the most likely step. A different choice was made, and the sentence needs a reason to follow.
- STEP 4 OF 7
The meeting has been moved to next week because next word
- STEP 5 OF 7
The meeting has been moved to next week because the next word
The three candidates are close. Any of them would read well, and each would give a different reason.
- STEP 6 OF 7
The meeting has been moved to next week because the room next word
- STEP 7 OF 7
The meeting has been moved to next week because the room is next word
The meeting has been moved to next week because the room is unavailable.
The sentence is complete. Nothing told the model that a room was unavailable. A reason was produced because a reason usually follows the word “because”. Lesson 4 looks at what this means for accuracy.
Check yourself.
Answer each question in your head, then open it.
Why does a chat assistant’s answer appear a little at a time?
The answer is produced that way. The model chooses a likely next token, adds it to the text and repeats until the answer is complete.
Why might an assistant lose track of something from early in a long conversation?
It can read a limited number of tokens at once, called the context window. When a conversation passes that limit, the earliest parts are dropped or shortened.
You ask the same question twice and get two different answers. Is something broken?
Nothing is broken. The assistant chooses among several likely next tokens, so its wording varies and its answer sometimes does too. For a fact that matters, check it against a source.
Go further.
- Glossary
- Insights
The examples are fictional. This is general guidance, not advice for your situation.