A decoder LLM turns text into a prediction through a fixed pipeline. Here's the whole thing at a glance — each stage with the memory trick from your notes:
Step through each stage and watch the sentence transform — sliced into tokens, turned into vectors, timestamped, understood, then raced to a prediction.
Stage 4 said "a stack of decoder blocks." But what's inside a single block? Three sub-layers, each wrapped in an "Add & Norm." Data flows bottom → top. Click each part.
From your notes: earlier layers focus on short, local connections; later layers pick up global, abstract, long-range meaning. Click each layer (bottom = first) to see what it specializes in.
One pass predicts one word. To write a whole sentence, the model loops: predict → append → predict again. Watch it build "The robot learns fast." one word at a time, then stop at <EOS>.
Now you can see the full contrast (straight from your notes). This table sums up why the Transformer won:
| Feature | RNN | Transformer (decoder LLM) |
|---|---|---|
| Speed | Sequential — must finish "The" before "robot" | Parallel — all words enter at once |
| Memory | Hidden state (a blurry notepad, fades) | Self-attention (a spotlight, no distance limit) |
| Order | Natural — receives words in order | Artificial — needs positional encoding added |
| Next word | From the final blurry note | From the entire context at once |
RNN: reads "The" → "robot" (tries to remember "The") → "learns" (starts forgetting "The") → predicts from a messy blend. Transformer: takes all three at once → adds positions → "learns" spotlights "robot" → instantly sees the full picture → predicts "fast" confidently.
Next up → Module 13: Running LLMs Yourself (the finale!). Now that you understand what's inside, let's use one: self-hosting with Ollama, the all-important system prompt, and the two creativity dials — temperature and top-p. Plus a wrap-up of activation functions.