Yep—under the hood it’s still “predict-the-next-token.”
The trick is in how we S T A G E the prediction game so that the easiest (i.e., highest-probability) next tokens look like something a helpful side-kick would say.
Here’s the journey from raw “parrot” ➜ “assistant”:
──────────────────────
- Pre-training: eat the Internet
──────────────────────
Goal: Minimize surprise when guessing the next word on billions of web pages, books, code, etc.
• What this really gives you
– A giant statistical map of language
– Implicit facts (Paris ⟶ France), styles, common task patterns (“Q:” often followed by “A:”)
– Rudimentary reasoning skills (because many training texts contain chains of logic)
At this point the model can babble convincingly, but it has no idea that it’s supposed to be helpful, safe, or concise.
─────────────────────────────
2. Supervised instruction-tuning
─────────────────────────────
Goal: Show the model what “helpful answers” look like.
• We collect ~10k–100k examples like:
User: “Summarize this article in two sentences.”
Assistant: “…summary…”
• Fine-tune the base model on these (tiny compared to pre-training but laser-focused).
• Result: When the prompt starts with something that looks like a user request, the easiest next tokens resemble an answer.
Think of it as giving the model a new “genre”: Q&A dialog.
─────────────────────────────
3. RLHF (Reinforcement Learning from Human Feedback)
─────────────────────────────
Goal: Align the model with human preferences: helpful, harmless, honest (the 3 H’s).
Loop:
a) Model generates several candidate replies
b) Humans rank them (👍👎)
c) Train a reward model to predict those rankings
d) Use reinforcement learning (e.g., PPO) to make the generator maximize that reward
Outcome: The model starts preferring answers that real people like, and avoiding ones that are rude, biased, or nonsensical. It’s still next-token prediction—we’ve just sculpted the probability landscape with a reward signal.
─────────────────────────────
4. Prompt engineering & system messages
─────────────────────────────
• Each chat session secretly starts with something like:
“System: You are ChatGPT, a large language model trained by OpenAI. Be helpful…”
• That initial context puts the model in “assistant mode.” Every new user message just extends the prompt, so the safest next tokens remain “assistant-like” responses.
─────────────────────────────
5. Tool use & retrieval (optional add-ons)
─────────────────────────────
Plugins, code execution, vector-search, etc., are bolted on via “function calling” or external APIs. From the model’s POV these are just more tokens it can request/receive, but to the user it feels like the assistant can browse, calculate, or remember.
──────────────────────
Key takeaway
──────────────────────
Underneath, nothing mystical happened: we still sample the next token.
What changed is:
P(next_token | huge_internet_corpus) → P(next_token | [system prompt] + [dialog] + [RLHF reward])
When the conditioning context contains “User: Can you help me fix my code?” the highest-probability continuation is now a well-structured, polite answer, not random internet chatter.
So “assistant” = next-token simulator + carefully crafted training stages + smart prompting + optional tool hooks.