<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>InstructGPT on Lee</title>
        <link>/en/tags/instructgpt/</link>
        <description>Recent content in InstructGPT on Lee</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en</language>
        <copyright>Lee</copyright>
        <lastBuildDate>Wed, 09 Sep 2026 23:37:19 +0800</lastBuildDate><atom:link href="/en/tags/instructgpt/index.xml" rel="self" type="application/rss+xml" /><item>
            <title>InstructGPT: Teaching LLMs to Be Helpful with RLHF</title>
            <link>/en/p/instructgpt-rlhf/</link>
            <pubDate>Tue, 08 Sep 2026 00:00:00 +0000</pubDate>
            <guid>/en/p/instructgpt-rlhf/</guid>
            <description>&lt;img src=&#34;/en/p/instructgpt-rlhf/cover.jpg&#34; alt=&#34;Featured image of post InstructGPT: Teaching LLMs to Be Helpful with RLHF&#34; /&gt;&lt;h2 id=&#34;introduction-bigger-is-not-better&#34;&gt;Introduction: Bigger Is Not Better&#xD;&#xA;&lt;/h2&gt;&lt;p&gt;When GPT-3 debuted with 175B parameters in 2020, the world was stunned. But users quickly discovered an awkward truth: this behemoth often did more harm than good. Ask it for a code comment and it produces a blog post. Ask a factual question and it confidently hallucinates. Tell it to refuse inappropriate requests and it spills harmful content after a few leading prompts.&lt;/p&gt;&#xA;&lt;p&gt;The root cause is &lt;strong&gt;misalignment&lt;/strong&gt; — the gap between the model&amp;rsquo;s language-modeling objective (&amp;ldquo;predict the next token&amp;rdquo;) and what users actually want.&lt;/p&gt;&#xA;&lt;p&gt;In March 2022, OpenAI published a paper — &amp;ldquo;Training Language Models to Follow Instructions with Human Feedback&amp;rdquo; — that would reshape the entire industry. The method is called &lt;strong&gt;RLHF&lt;/strong&gt; (Reinforcement Learning from Human Feedback), and it transforms raw GPT-3 into InstructGPT through three stages. ChatGPT&amp;rsquo;s birth, later that year, was the direct continuation of this line.&lt;/p&gt;&#xA;&lt;p&gt;This article dissects each stage, key hyperparameters, quantitative results, and the &amp;ldquo;alignment tax&amp;rdquo; problem.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1-supervised-finetuning--teaching-the-model-what-a-good-answer-looks-like&#34;&gt;Step 1: Supervised Fine‑Tuning — Teaching the Model What a Good Answer Looks Like&#xD;&#xA;&lt;/h2&gt;&lt;p&gt;The first step is straightforward: hire human labelers to write high-quality answers, then fine-tune the model to mimic them.&lt;/p&gt;&#xA;&lt;p&gt;OpenAI hired contractors to write demonstrations for prompts collected from the API — across generation, QA, writing, summarization, coding, and more. The bar is not &amp;ldquo;perfect,&amp;rdquo; but &amp;ldquo;helpful&amp;rdquo;: answer the question, don&amp;rsquo;t fabricate, don&amp;rsquo;t give harmful advice.&lt;/p&gt;&#xA;&lt;p&gt;The result: roughly &lt;strong&gt;13,000 labeled demonstrations&lt;/strong&gt; (12,725 training + 1,653 validation), plus a small slice (~1.4k) from real API users as supplementary data.&lt;/p&gt;&#xA;&lt;p&gt;GPT‑3 is fine-tuned on this data with supervised learning. 1.3B and 6B models train for 16 epochs with batch size 32, learning rate 9.65e-6; the 175B variant uses batch size 8 and learning rate 5.03e-6. All models use residual dropout 0.2 and cosine LR decay. The checkpoint with the highest RM score on validation is selected.&lt;/p&gt;&#xA;&lt;figure&gt;&lt;img src=&#34;/en/p/instructgpt-rlhf/rlhf-pipeline.svg&#34;&gt;&lt;figcaption&gt;&#xA;&#x9;&#x9;&#x9;&lt;h4&gt;Figure 1: The three-step RLHF pipeline — SFT learns from human demonstrations, Reward Model learns from human preference rankings, PPO optimizes the policy with the learned reward signal&lt;/h4&gt;&#xA;&#x9;&#x9;&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;This produces a model π_SFT that &amp;ldquo;can answer&amp;rdquo; but isn&amp;rsquo;t yet finely aligned.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-2-reward-model--teaching-the-model-to-distinguish-good-from-bad&#34;&gt;Step 2: Reward Model — Teaching the Model to Distinguish Good from Bad&#xD;&#xA;&lt;/h2&gt;&lt;p&gt;SFT only teaches the model &lt;em&gt;how to write&lt;/em&gt;, not &lt;em&gt;which style of writing&lt;/em&gt; humans prefer. Step 2 trains a &lt;strong&gt;scorer&lt;/strong&gt; to predict which of two responses a human will prefer.&lt;/p&gt;&#xA;&lt;p&gt;For a batch of prompts, the SFT model samples K = 4–9 different responses (varying temperature), and labelers &lt;strong&gt;rank&lt;/strong&gt; them from best to worst. Each prompt&amp;rsquo;s ranking yields C(K, 2) comparison pairs, turning the labeling problem from absolute scoring into relative preference.&lt;/p&gt;&#xA;&lt;p&gt;This is a brilliant design decision: pairwise comparison produces higher inter-annotator agreement than absolute 1–5 scoring. Two labelers may disagree on whether a response is a &amp;ldquo;3&amp;rdquo; or a &amp;ldquo;4,&amp;rdquo; but they almost always agree on which of two responses is better.&lt;/p&gt;&#xA;&lt;p&gt;The reward model is trained on these comparisons. About &lt;strong&gt;33,000 prompts&lt;/strong&gt; for training. A crucial finding: the reward model is only &lt;strong&gt;6B parameters&lt;/strong&gt; — trying 175B led to severe training instability. Single epoch, learning rate 9e-6, batch size 64 (each batch can hold up to 2,304 comparison pairs).&lt;/p&gt;&#xA;&lt;p&gt;The loss function is intuitive: given a better response y_w and a worse response y_l, maximize the scoring gap:&lt;/p&gt;&#xA;$$L(θ) = -\log(σ(r_θ(x, y_w) - r_θ(x, y_l)))$$&lt;p&gt;Where σ is sigmoid. Larger gap means higher confidence. The final reward values get a normalization bias so that labeled demonstrations score 0 on average — this establishes a reference point for the PPO stage.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-3-ppo-optimization--driving-alignment-with-a-reward-signal&#34;&gt;Step 3: PPO Optimization — Driving Alignment with a Reward Signal&#xD;&#xA;&lt;/h2&gt;&lt;p&gt;With a reward model in hand, Step 3 uses it to optimize the language model policy.&lt;/p&gt;&#xA;&lt;p&gt;PPO (Proximal Policy Optimization) is a stable policy gradient algorithm. OpenAI&amp;rsquo;s RLHF implementation uses the original PPO from Schulman et al. (2017) with minor modifications.&lt;/p&gt;&#xA;&lt;p&gt;Each episode samples a prompt, the current policy generates a response y, and then:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Positive signal&lt;/strong&gt;: reward model score r_θ(x, y) — higher is better&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Negative constraint&lt;/strong&gt;: KL divergence penalty if the policy strays too far from the SFT model&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The KL penalty is critical. Without it, the model quickly learns to game the reward model — producing grammatically garbled output that somehow scores high (reward hacking). KL anchors the policy near the SFT distribution, preventing this degradation.&lt;/p&gt;&#xA;&lt;p&gt;The objective:&lt;/p&gt;&#xA;$$\max_φ \mathbb{E}[r_θ(x, y)] - β \cdot \text{KL}(\pi_φ \| \pi_{\text{SFT}})$$&lt;p&gt;KL penalty coefficient β = &lt;strong&gt;0.02&lt;/strong&gt;. OpenAI also experimented with &lt;strong&gt;PPO-ptx&lt;/strong&gt;, mixing a pretraining gradient term (coefficient γ = 27.8) with 10% pretraining data. PPO-ptx substantially reduces the &amp;ldquo;alignment tax.&amp;rdquo;&lt;/p&gt;&#xA;&lt;p&gt;Key PPO hyperparameters: batch size 512, minibatch 64 (single inner epoch only), PPO clip ratio 0.2, constant learning rate, sampling temperature 1 (no decay), EMA weight decay 0.992. Value function is initialized from the reward model at 6B parameters. A total of 256k episodes (~31k unique prompts).&lt;/p&gt;&#xA;&lt;h2 id=&#34;striking-results&#34;&gt;Striking Results&#xD;&#xA;&lt;/h2&gt;&lt;p&gt;The most dramatic result is from human evaluations:&lt;/p&gt;&#xA;&lt;table&gt;&#xA;&#x9;&lt;thead&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;th&gt;Comparison&lt;/th&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;th&gt;Win Rate&lt;/th&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&lt;/thead&gt;&#xA;&#x9;&lt;tbody&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;&lt;strong&gt;175B InstructGPT vs 175B GPT-3&lt;/strong&gt;&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;&lt;strong&gt;85% ± 3%&lt;/strong&gt; preferred InstructGPT&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;&lt;strong&gt;175B InstructGPT vs few-shot 175B GPT-3&lt;/strong&gt;&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;&lt;strong&gt;71% ± 4%&lt;/strong&gt;&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;&lt;strong&gt;1.3B InstructGPT vs 175B GPT-3&lt;/strong&gt;&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;&lt;strong&gt;InstructGPT wins&lt;/strong&gt; (&amp;lt;1% of the parameters)&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;p&gt;That last row encapsulates the paper&amp;rsquo;s central message: users would rather use a 1.3B aligned model than a 175B misaligned one. Alignment trumps scale.&lt;/p&gt;&#xA;&lt;p&gt;On specific dimensions:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Instruction following&lt;/strong&gt;: InstructGPT is better at completing user requests (&amp;ldquo;doesn&amp;rsquo;t ignore constraints,&amp;rdquo; &amp;ldquo;no padding&amp;rdquo;)&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Truthfulness&lt;/strong&gt;: On TruthfulQA, InstructGPT produces truthful and informative answers roughly &lt;strong&gt;2×&lt;/strong&gt; more often than GPT-3; hallucination rate on closed-domain questions drops from 41% to &lt;strong&gt;21%&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Toxicity&lt;/strong&gt;: When prompted to be respectful, InstructGPT produces about &lt;strong&gt;25%&lt;/strong&gt; less toxic output than GPT-3&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Bias&lt;/strong&gt;: No meaningful improvement on Winogender or CrowS-Pairs benchmarks&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The toxicity improvement — while real — is explicitly called out by the authors as &lt;strong&gt;modest&lt;/strong&gt;. RLHF is not a silver bullet for safety.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-alignment-tax-trade-offs-in-capability&#34;&gt;The Alignment Tax: Trade-offs in Capability&#xD;&#xA;&lt;/h2&gt;&lt;p&gt;RLHF introduces what the authors call the &lt;strong&gt;alignment tax&lt;/strong&gt;: performance regression on certain NLP benchmarks (e.g., DROP QA and translation tasks). The PPO-ptx variant significantly mitigates this.&lt;/p&gt;&#xA;&lt;p&gt;More importantly, InstructGPT &lt;strong&gt;generalizes to held-out labelers&lt;/strong&gt; and to non-English instructions. Labelers who didn&amp;rsquo;t produce any training data still prefer its outputs, and it handles non-English and code tasks well. This suggests the model is learning a broadly useful notion of &amp;ldquo;helpfulness,&amp;rdquo; not just overfitting to specific annotators.&lt;/p&gt;&#xA;&lt;figure&gt;&lt;img src=&#34;/en/p/instructgpt-rlhf/metrics.svg&#34;&gt;&lt;figcaption&gt;&#xA;&#x9;&#x9;&#x9;&lt;h4&gt;Figure 2: Key metrics — 85% human preference win rate, hallucination rate dropped from 41% to 21%, toxicity reduced by 25%&lt;/h4&gt;&#xA;&#x9;&#x9;&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;h2 id=&#34;guardrail-perspective&#34;&gt;Guardrail Perspective&#xD;&#xA;&lt;/h2&gt;&lt;p&gt;As an AI safety practitioner, I see two important takeaways from InstructGPT&amp;rsquo;s approach:&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;The positives&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Ranking beats scoring&lt;/strong&gt;. Pairwise comparison drastically improves inter-annotator agreement, reducing noise in training data&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;KL penalty is a built-in guardrail&lt;/strong&gt;. It prevents the model from abandoning language ability just to game the reward model — an architectural defense against reward hacking&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;PPO-ptx shows alignment and capability can coexist&lt;/strong&gt;. Mixing pretraining gradients nearly eliminates the alignment tax, proving that safety optimization need not degrade performance&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;The challenges&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Limited toxicity reduction&lt;/strong&gt;. The ~25% decrease is real but leaves the model vulnerable to escaped prompts&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Reward model blind spots&lt;/strong&gt;. Trained only on &amp;ldquo;which response is better&amp;rdquo; data, the RM cannot assess subtle discrimination or indirect harm&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Labeler bias baked into alignment&lt;/strong&gt;. If the labeler pool carries cultural biases, the ranking data does not represent universal values. The authors acknowledge this as a primary limitation&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;My assessment&lt;/strong&gt;: InstructGPT defines a technical roadmap but leaves one question open: &lt;strong&gt;who decides what &amp;ldquo;good&amp;rdquo; means?&lt;/strong&gt; RLHF outsources this to labelers, and labeler preferences are not a proxy for universal value. This explains why later work — Anthropic&amp;rsquo;s Constitutional AI, DeepSeek-R1&amp;rsquo;s rule-based rewards — repeatedly tries to answer the same question: alignment targets should not be pure statistical preference aggregation.&lt;/p&gt;&#xA;&lt;h2 id=&#34;conclusion&#34;&gt;Conclusion&#xD;&#xA;&lt;/h2&gt;&lt;p&gt;InstructGPT&amp;rsquo;s contribution isn&amp;rsquo;t algorithmic novelty (PPO and RLHF both predate it). It&amp;rsquo;s the first demonstration that &lt;strong&gt;alignment matters more than scale&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;table&gt;&#xA;&#x9;&lt;thead&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;th&gt;Dimension&lt;/th&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;th&gt;Key Finding&lt;/th&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&lt;/thead&gt;&#xA;&#x9;&lt;tbody&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;Methodology&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;SFT → Reward Model → PPO three-step pipeline, with carefully designed data scales and hyperparameters&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;Key trade-off&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;KL penalty β = 0.02 balances alignment and capability; PPO-ptx reduces alignment tax&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;Performance&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;1.3B aligned model outperforms 175B raw model; hallucination rate halved&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;Limitations&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td&gt;Modest toxicity improvement, no bias improvement, alignment bounded by labeler preferences&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;p&gt;In retrospect, this paper is the technical foundation of ChatGPT and the entire alignment / post‑training era. Subsequent RLHF variants — InstructGPT → ChatGPT → Constitutional AI → DPO → R1&amp;rsquo;s GRPO — all extend the framework it established. But its core insight remains unchanged: &lt;strong&gt;making a model small is easy. Making a model good is what&amp;rsquo;s worth doing.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;references&#34;&gt;References&#xD;&#xA;&lt;/h2&gt;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Original paper&lt;/strong&gt;: Ouyang, L., Wu, J., Jiang, X. et al. &lt;em&gt;Training Language Models to Follow Instructions with Human Feedback&lt;/em&gt;. NeurIPS 2022. &lt;a class=&#34;link&#34; href=&#34;https://arxiv.org/abs/2203.02155&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xD;&#xA;    &gt;https://arxiv.org/abs/2203.02155&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;OpenAI blog&lt;/strong&gt;: &lt;em&gt;Aligning Language Models to Follow Instructions&lt;/em&gt;. &lt;a class=&#34;link&#34; href=&#34;https://openai.com/index/instruction-following/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xD;&#xA;    &gt;https://openai.com/index/instruction-following/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Technical review&lt;/strong&gt;: ArthurChiao. &lt;em&gt;InstructGPT Paper Reading Notes&lt;/em&gt;. &lt;a class=&#34;link&#34; href=&#34;http://arthurchiao.art/blog/instructgpt-paper-zh/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xD;&#xA;    &gt;http://arthurchiao.art/blog/instructgpt-paper-zh/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;PPO algorithm&lt;/strong&gt;: Schulman, J. et al. &lt;em&gt;Proximal Policy Optimization Algorithms&lt;/em&gt;. 2017. &lt;a class=&#34;link&#34; href=&#34;https://arxiv.org/abs/1707.06347&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xD;&#xA;    &gt;https://arxiv.org/abs/1707.06347&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;RLHF foundations&lt;/strong&gt;: Christiano, P. et al. &lt;em&gt;Deep Reinforcement Learning from Human Preferences&lt;/em&gt;. NeurIPS 2017. &lt;a class=&#34;link&#34; href=&#34;https://arxiv.org/abs/1706.03741&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xD;&#xA;    &gt;https://arxiv.org/abs/1706.03741&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Alignment framework&lt;/strong&gt;: Askell, A. et al. &lt;em&gt;A General Language Assistant as a Laboratory for Alignment&lt;/em&gt;. 2021. &lt;a class=&#34;link&#34; href=&#34;https://arxiv.org/abs/2112.00861&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xD;&#xA;    &gt;https://arxiv.org/abs/2112.00861&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;</description>
        </item></channel>
</rss>
