Tokens, parameters and how text comes out
Three words explain most of what you read about AI models. Here is what each one means.
You now know that a language model predicts the next piece of text. Three more ideas let you read almost any description of a model.
Tokens
A model does not see words. It sees tokens. A token is a small piece of text, about three to four characters on average. “Hello” is one token. “Artificial intelligence” is three. A line of code can be six or more.
Tokens are the unit for everything:
- The amount a model can read at once is counted in tokens.
- Speed is counted in tokens per second.
- Services that charge for AI charge for each token.
Parameters
A model called “70B” has 70 billion parameters. A parameter is one learnt number. Together the parameters hold every pattern the model picked up in training.
More parameters give the model more room to store patterns, so bigger models usually give better answers. They also need more memory. Each parameter has to sit in memory while the model runs, so a 70 billion parameter model needs far more than a laptop has, unless it is shrunk. The next lesson covers how.
Training and running are different jobs
Training makes the parameters. The model is shown text and its numbers are adjusted until its predictions improve. This takes thousands of specialised chips and weeks or months.
Inference uses the finished parameters to produce text. This is what happens when you chat. It needs far less equipment, which is why a model that cost a fortune to train can run in a home lab.
How the text comes out
An answer is produced in two phases.
- Reading. The model takes in your whole prompt. A longer prompt takes longer. This is the pause before the first word appears.
- Writing. The model produces one token, adds it to what it has, and predicts again. This cannot be hurried by doing tokens in parallel, because each token depends on the one before.
So two numbers describe how fast a model feels: the wait before the first token, and the tokens per second after that.
Temperature
The model does not always pick the single most likely token. A setting called temperature controls how much it varies. At zero, it gives the same answer each time. Higher values give more varied and surprising text, which suits brainstorming and does not suit facts.
When an answer changes each time you ask, that is not the model changing its mind. It is the temperature.
Close the page in your mind, then answer
Do not scroll up. Pulling the answer out of your own head is the step that makes it stay.