How a language model writes one word at a time

Process map by Brian. 13 steps, 2 layers. Tags: ai, tech.

  1. You: You type a prompt
  2. The tokenizer: Split it into tokens (word pieces)
  3. The neural network: Turn the tokens into numbers (embeddings)
  4. The neural network: Attention layers decide which earlier words matter most
  5. The neural network: Compute a probability for every possible next token
  6. The sampler: Pick one (temperature controls how adventurous)
  7. You: Is it a stop token?
  8. You: The answer is complete
  9. The neural network: Add the token to the text and repeat

Read this process as Markdown

$Ai $Tech All process maps