How does a language model continue text?
The model scores its options, adds one token, and predicts again with the updated context.
- 1 Tokens
- 2 Model layers
- 3 Next token
A word in context
Each token gets an initial representation.
Switch contexts to see how the prediction changes.
The mechanic inserted the key into the
Add one piece to the phrase
What happens inside the model?
Training changes the weights. When the model answers, the weights stay fixed and the layers process new signals.
The mechanic inserted the key into the
o200k_base tokenizer: starting phrase
The#976␣mechanic#75544␣inserted#40986␣the#290␣key#2140␣into#1511␣the#290
The ␣ symbol shows a space. The ellipsis is not part of the input.
The model uses the last position to score possible next tokens. Once a token is added, it becomes part of the context and the model scores the options again.
Which detail needs checking?
The city library will open on Friday. Admission is free.
Select the detail that needs checking before publication.
Model, tools and application
Transforms data
A language model scores possible continuations. Models for other formats can encode audio or generate images.
Manages tools
It extracts text from files, calls search, gives results to the model and checks which actions are allowed.
Provides the workspace
ChatGPT assembles conversation context. Codex can also work with project files, run commands and run checks.
Sources and simulation limits
- Attention Is All You Need: attention and feed-forward sublayers.
- GLIDE: diffusion-based image generation.
- Denoising Diffusion Probabilistic Models · Ho et al.
- OpenAI: audio: chained and direct audio processing.
- OpenAI: retrieval: retrieving relevant passages.
- CLIP · Radford et al. / Faiss