Key Points 4 min read
  • Three stages: Pre-training (self-supervised next-token prediction that builds knowledge) → Instruction Fine-tuning (learning to follow instructions from human-written examples) → RLHF (aligning to better, safer outputs using human preference rankings).
  • The key division of labor: a model's 'knowledge and capability' is almost entirely set during pre-training; the latter two stages add little knowledge and mainly 'unlock that capability into usable, controllable assistant behavior.'
  • RLHF works by training a reward model to learn human preferences, then using it as a signal to refine the original model — it can surpass human demonstrations because 'scoring' an answer is far easier than 'writing the perfect one.'
Table of Contents

Every time you ask ChatGPT a question and get back a fluent, on-point answer, it’s actually the result of three training stages with completely different characters stacked on top of one another. Professor Hung-yi Lee describes them vividly: creating the world, showing the way, and surpassing oneself. This post breaks down these three stages and adds one easily overlooked but most important insight — “capability” and “alignment” are two things forged separately.

flowchart TD
    A[海量網路文字] --> B("① Pre-training 預訓練")
    B -->|"博學,但不聽話"| C[Base Model]
    D[人寫的「指令→答案」範例] --> E("② Instruction Fine-tuning 指令微調")
    C --> E
    E -->|"聽得懂指令了"| F[SFT Model]
    G[人對多個答案的好壞排序] --> H("③ RLHF")
    F --> H
    H -->|"更符合人類偏好與安全"| I[ChatGPT]

Stage One: Creating the World (Pre-training)

This is the stage where the model “builds knowledge,” and it’s also the most computationally insane part of the whole pipeline.

  • Goal: Learn “text completion” — given a span of text, predict the next token.
  • Method: Self-supervised learning on trillions of tokens of web text. No human annotation is needed, because the answer is hidden in the text itself: mask the next token, let the model guess, and correct it when it’s wrong. By pushing “predict the next token” to the extreme, the model is forced to learn grammar, facts, common sense, and even a degree of reasoning.
  • Output: A base model. It’s very “knowledgeable” but doesn’t follow instructions — when you ask it a question, instead of answering, it might continue with “a string of questions you might ask next,” because that’s the kind of text most common on the web.

Key takeaway: Almost all of the model’s knowledge and capability is formed during this stage. What the latter two stages do is not “pour in more knowledge,” but “tune this skill set into a usable assistant.”

Stage Two: Showing the Way (Instruction Fine-tuning / SFT)

To turn the base model from a “text-completion machine” into an “assistant that answers,” you need Supervised Fine-Tuning.

  • Goal: Teach the model that when it sees an instruction (prompt), it should produce “the kind of response humans expect.”
  • Method: Have many annotators write high-quality “instruction → ideal answer” pairs (“write me a poem,” “summarize this article,” …), then fine-tune the model on these examples.
  • Significance: The data volume is far smaller than pre-training, but its role is to unlock — steering the broad capabilities learned in pre-training into a behavior pattern that “understands human language and carries out instructions.”

Stage Three: Surpassing Oneself (RLHF)

Relying on human demonstrations alone has a ceiling, because humans can’t write the perfect answer for every question, and “what makes a good answer” is often hard to articulate. RLHF (Reinforcement Learning from Human Feedback) takes a smarter angle:

  1. Have the model generate multiple answers to the same question.
  2. Have humans rank these answers from best to worst (ranking is far easier than writing the perfect answer from scratch).
  3. Use these rankings to train a Reward Model, teaching it to predict “which one humans would prefer.”
  4. Then use the reward model as a signal to refine the original model via reinforcement learning (OpenAI used PPO), making it produce high-scoring responses more often.

This is the key result OpenAI demonstrated in the InstructGPT paper: an aligned smaller model can beat a much larger but unaligned base model on “human preference.” What makes ChatGPT stand out isn’t being bigger, it’s being better aligned.

The cost (alignment tax): Alignment can sometimes cause the model to regress slightly on certain pure-capability benchmarks — this is the tradeoff you pay for “safer and more obedient,” and it has to be deliberately balanced in engineering.

What I Learned

Looking at the three stages together, the one sentence most worth remembering is: Pre-training gives the model its soul (knowledge and capability), while instruction fine-tuning and RLHF give it its personality and sense of proportion (usability and safety).

This also explains a lot of phenomena: why a model “knows” something but isn’t necessarily “willing to say it in the format you want” (that’s the alignment layer’s job); why the same base model can be aligned into assistants with completely different styles; and why “data quality” matters far more than “data quantity” in the latter two stages — you’re sculpting behavior, not pouring in knowledge.

References

Ask this article

Answers come from this article only. Click any prompt below or open the chat at the bottom right.

🇺🇸 English

Every time you fire off a question to ChatGPT and it hands back something fluent and right on the money — what you're actually seeing is three completely different training stages stacked on top of each other. And here's the thing: each stage has its own personality, its own job. Professor Hung-yi Lee has this wonderful way of describing them — creating the world, showing the way, and surpassing oneself. So let's walk through all three. And along the way I want to plant one idea in your head, because it's the part most people miss: capability and alignment are two separate things, forged completely independently.

Let's start at the beginning. Stage one — creating the world. This is pre-training, and it's the stage where the model builds its knowledge. It's also, by a wide margin, the most computationally insane part of the entire pipeline.

The goal here is almost laughably simple to state: text completion. You give the model a span of text, and it predicts the next token. That's it. That's the whole game. And the beautiful part is the method — it's called self-supervised learning, and it runs on trillions of tokens of raw web text. No humans labeling anything. Why? Because the answer is already hidden inside the text itself. You just cover up the next word, let the model take a guess, and correct it when it's wrong. Do that across the entire internet, over and over, and something remarkable happens. By pushing this one tiny task — predict the next token — to its absolute extreme, the model is forced to pick up grammar, facts, common sense, even a real degree of reasoning. It learns the world in order to finish your sentences.

What you get out the other end is what we call a base model. And here's the twist that surprises people: this thing is incredibly knowledgeable, but it does not follow instructions. If you ask it a question, it might not answer you at all. Instead it might just continue with a whole list of other questions you could ask next — because, statistically, that's the kind of text that shows up most often on the web. It's brilliant, and it's useless as an assistant.

So hold onto this, because it's the key takeaway of the whole episode: almost all of the model's knowledge and capability is formed right here, in stage one. Everything that comes after is not about pouring in more knowledge. It's about taking this raw, sprawling skill set and shaping it into something you can actually use.

Which brings us to stage two — showing the way. This is instruction fine-tuning, sometimes called supervised fine-tuning, or SFT. The whole point is to take that text-completion machine and turn it into an assistant that actually answers you.

The method is much more hands-on. You bring in human annotators, and they write high-quality pairs — an instruction, and the ideal answer to it. "Write me a poem." Here's a good poem. "Summarize this article." Here's a good summary. You gather a pile of these examples and you fine-tune the model on them. And here's what's fascinating: the amount of data is tiny compared to pre-training. Microscopic, really. But its job isn't to teach — its job is to unlock. It takes all that broad capability the model already absorbed and steers it into a single behavior pattern: understand what a human is asking, and carry it out. You're not adding skills. You're flipping a switch that says, "now act like an assistant."

And then there's stage three — surpassing oneself. This is RLHF, reinforcement learning from human feedback, and it exists because stage two has a ceiling. Think about it: relying on humans to write perfect demonstrations only gets you so far, because humans simply can't write the ideal answer to every possible question. And honestly, a lot of the time we can't even put into words what makes one answer better than another. We just know it when we see it.

So RLHF comes at the problem from a much cleverer angle. Here's how it flows. First, you have the model generate several different answers to the same question. Then — and this is the smart bit — you ask humans not to write the perfect answer, but simply to rank the answers the model produced, from best to worst. And ranking is so much easier than writing from scratch. You don't need to be a poet to know which of four poems is the best one. Next, you take all those rankings and you use them to train a separate model called a reward model, whose entire job is to predict which answer a human would prefer. And finally, you turn that reward model loose as a kind of coach — using reinforcement learning, OpenAI used an algorithm called PPO, to nudge the original model toward producing the high-scoring kind of answer more and more often.

This is exactly the result OpenAI put on the table in their InstructGPT paper, and it's a stunner. A smaller model that had been properly aligned could beat a much, much larger model that hadn't been — beat it on what humans actually preferred. So let that sink in. What makes ChatGPT stand out isn't that it's bigger. It's that it's better aligned.

Now, there is a price tag here, and it's worth naming. It's sometimes called the alignment tax. When you align a model like this, it can actually slip backward a little on certain pure-capability benchmarks. That's the trade you're making for "safer and more obedient," and in practice engineers have to deliberately balance it — you don't get the good behavior entirely for free.

So let's pull the three stages together, because there's really one sentence worth carrying out of all this. Pre-training gives the model its soul — its knowledge and its raw capability. And then instruction fine-tuning and RLHF give it its personality and its sense of proportion — its usability, and its safety.

And once you see it that way, a whole bunch of confusing things suddenly make sense. It explains why a model can clearly know something but still not be willing to say it in the exact format you wanted — that's the alignment layer doing its job, for better or worse. It explains why you can take one single base model and align it into assistants with completely different styles and voices. And it explains why, in those last two stages, the quality of your data matters far, far more than the quantity — because you're not pouring in knowledge anymore. You're sculpting behavior.

So, three things to walk away with. One: nearly all of a model's actual knowledge comes from that first massive pre-training stage — the later stages don't make it smarter. Two: instruction fine-tuning and RLHF are about alignment, about turning raw capability into something obedient, useful, and safe — and that's a separate craft entirely. And three: the real lesson of ChatGPT is that being better aligned beat being bigger. Capability and alignment are forged apart — and it's the second one that turned a knowledgeable text predictor into something you'd actually want to talk to.

🇹🇼 中文

每次你問 ChatGPT 一個問題,得到一段又通順又切題的回答,其實背後是三個性質完全不同的訓練階段疊起來的成果。李宏毅老師形容得很傳神,他說這三步是:開天闢地、指點迷津、超越自我。今天我們就把這三階段拆開來講,而且我會特別補上一個常常被忽略、但其實最關鍵的洞察——「能力」跟「對齊」,是分開煉出來的兩件事。

先講第一階段:開天闢地,也就是預訓練。

這是模型「長知識」的階段,也是整個流程裡運算量最瘋狂的一段。它的目標其實很單純,就是玩文字接龍——給一段文字,預測下一個字。做法叫做自監督學習,在數以兆計的網路文字上跑。重點是它不需要人工標註,因為答案本來就藏在文本裡:把下一個字遮起來讓模型猜,猜錯就修正。聽起來很笨對吧?但你光是把「預測下一個字」這件事做到極致,模型就被逼著學會了語法、事實、常識,甚至某種程度的推理能力。

這個階段的產物,是一個叫做 base model 的東西。它非常博學,但是——它不聽話。你問它一個問題,它可能不會回答你,反而接龍出「一串你接下來可能會問的問題」。為什麼?因為網路上長那樣的文本最多嘛,它只是忠實地在模仿網路。

這裡有個關鍵認知一定要記住:模型幾乎所有的知識跟能力,都是在這第一階段就形成的。後面兩個階段做的事,不是再灌更多知識進去,而是「把這一身本事,調教成一個可用的助理」。

好,接著第二階段:指點迷津,也就是指令微調,英文叫 SFT。

為了讓 base model 從一台「接龍機」變成「會回答的助理」,我們需要監督式微調。目標就是教模型:當你看到一個指令的時候,你應該產出「人類期待的那種回應」。做法是請大量標註員,手寫高品質的「指令配上理想答案」的範例,像是「幫我寫一首詩」、「摘要這篇文章」,然後拿這些範例去微調模型。

注意喔,這階段的資料量遠遠小於預訓練。它的作用不是教知識,而是「解鎖」——把預訓練學到的廣泛能力,導引成「聽得懂人話、會照指令辦事」的行為模式。

再來是第三階段,我覺得最有意思的:超越自我,也就是 RLHF。

為什麼光靠人類示範還不夠?因為它有天花板。人類其實寫不出每一題的完美答案,而且「什麼才是好答案」這件事,常常是只能意會、難以言傳的。所以 RLHF——也就是「從人類回饋中做強化學習」——換了一個更聰明的切角。

它的流程是這樣:第一,讓模型對同一個問題,生出好幾個不同的答案。第二,請人類來幫這些答案排序好壞——注意,排序比起從零寫出完美答案,容易太多了。第三,用這些排序去訓練一個「獎勵模型」,讓它學會預測「人類大概會比較喜歡哪一個」。第四,再拿這個獎勵模型當作訊號,透過強化學習,OpenAI 用的是 PPO,去打磨原始模型,讓它越來越常產出高分的回應。

這就是 OpenAI 在 InstructGPT 那篇論文裡展示的關鍵結果:一個經過對齊、體積小很多的模型,在「人類偏好」這項上,居然可以贏過大得多、但沒有對齊的 base model。所以讓 ChatGPT 真正脫穎而出的,不是更大,而是更對齊。

不過對齊也是有代價的,業界叫它 alignment tax,對齊稅。模型在對齊之後,有時候在某些純能力的 benchmark 上會稍微退步一點點。這是用「更安全、更聽話」換來的取捨,工程上必須刻意去拿捏平衡。

那這三階段串起來,最該記住的是什麼?

第一,預訓練給了模型靈魂,也就是它的知識跟能力;而指令微調跟 RLHF,給了它性格跟分寸,也就是可用性跟安全感。能力跟對齊,是分開煉成的。

第二,這也解釋了一個常見現象:為什麼模型明明「知道」一件事,卻不一定「願意照你要的格式講」?因為那是對齊層在管的事,跟它知不知道無關。也因為這樣,同一個 base model,可以對齊出風格完全不同的好幾種助理。

第三,記住後兩階段的鐵律:資料的「品質」遠比「數量」重要。因為到了這裡,你做的事情是在雕刻行為,而不是在灌知識。

Tags

Related Articles

RAG's Five Stages: From Pipeline to Reasoning Retrieval, and the Naive RAG on My Own Site

Over the past two years RAG evolved from a 'linear pipeline' to 'loop-based reasoning'. It maps cleanly to five stages: Naive, Advanced, Modular, Graph, Agentic. The real inflection point is control moving from pipeline to agent — a System 1 → System 2 shift. Looking back at engineer-news's own RAG stack, it's stuck at the Naive edge — so this post also lays out what to fix next.

Building a Real RAG: 5 Infra Lessons from InfiniFlow's 2024 Year-in-Review

The previous post zoomed out for a five-stage panorama of RAG. This one zooms in on the five infra lessons any real RAG has to face: document ingestion, contextualized chunking, three-lane hybrid search, tensor reranker, and GraphRAG's semantic gap. Each lesson is checked against engineer-news's current stack, ending with a priority list for a personal site.

J-lens: Anthropic's New Interpretability Tool for Reading Claude's Inner Thoughts via a 'Global Workspace'

Anthropic proposes J-lens, an interpretability tool that captures the 'verbalizable' representations inside a Transformer, and uses it to show that Claude contains a privileged subspace analogous to the neuroscientific 'global workspace' — a small set of vectors that broadcast, drive reasoning, respond to external steering, and even leak signals during deception and evaluation awareness.