PPO
यह क्यों मायने रखता है
गहन अध्ययन
PPO policy-gradient method है, यानी policy को — language-model work में model स्वयं — अच्छा score करने वाले actions की ओर और खराब score वाले actions से दूर धकेलकर improve करता है। Signature trick clipped surrogate objective है: हर action के लिए PPO current policy द्वारा दी probability और previous policy द्वारा दी probability का ratio compute करता है, उस ratio को action के expected से कितना बेहतर होने के advantage estimate से multiply करता है, फिर ratio को narrow band, आम तौर पर 0.8 से 1.2, में clip करता है ताकि single batch policy को बहुत दूर न खींच सके। Clipping aggressive updates safe बनाती है, इसलिए algorithm same collected data पर minibatch gradient updates के several epochs चला सकता है, जो naive policy gradients से बहुत अधिक sample-efficient है। यह combination — stability plus decent sample efficiency — PPO को वर्षों तक default रीइन्फ़ोर्समेंट लर्निंग workhorse बनाता रहा, पहले games तथा robotics benchmarks में और फिर language model alignment में।
Objective के आसपास की Machinery
PPO शायद ही अकेला चलता है। यह actor-critic method है, इसलिए policy, यानी actor, के साथ value model, यानी critic, train करता है जो state का expected reward predict करता है, और इससे final scores की प्रतीक्षा के बजाय generalized advantage estimation से advantages compute होते हैं। RLHF setting में memory bill और बढ़ता है: original model की frozen copy reference policy होती है और अलग Reward Model scores देता है, इसलिए full training run एक साथ memory में चार models रख सकता है। Reference model इसलिए है क्योंकि objective current policy तथा reference के बीच KL divergence पर penalty रखता है, जिससे model ऐसे degenerate text की ओर drift नहीं करता जो संयोग से अच्छा score करे। इस ensemble को smoothly train करने के लिए कई interacting hyperparameters — clip range, KL penalty coefficient, learning rate तथा advantage-estimation settings — juggle करने पड़ते हैं, जो PPO की fiddly reputation का बड़ा कारण है।
PPO, RLHF को कैसे चलाता है
PPO को famous बनाने वाली pipeline उस model से शुरू होती है जो प्री-ट्रेनिंग और demonstrations पर supervised फ़ाइन-ट्यूनिंग से गुजर चुका है। Human annotators फिर same prompt के several sampled responses rank करते हैं और rankings ऐसे reward model में distill होती हैं जो predict करता है कि लोग कौन-से responses prefer करेंगे। PPO वहाँ से संभालता है: model fresh prompts पर responses generate करता है, reward model उन्हें score करता है और clipped objective plus KL penalty higher-scoring behavior favor करने के लिए weights update करते हैं। यह मूलतः OpenAI के InstructGPT तथा ChatGPT के पीछे की recipe है, और इसने RLHF को research idea से base model को helpful और instruction-following बनाने के standard तरीके में बदला। Catch reward hacking है — optimization बहुत push करें तो model genuinely बेहतर answers के बजाय reward model की quirks exploit करना सीखता है, इसीलिए KL anchor तथा careful early stopping व्यवहार में इतने महत्वपूर्ण हैं।
यह RLHF का पर्याय नहीं है
Common shorthand PPO तथा RLHF को same मानती है, लेकिन वे अलग levels पर हैं: RLHF human preferences से training का overall paradigm है, जबकि PPO उसमें plug होने वाला केवल एक optimizer है। DPO reinforcement learning पूरी तरह छोड़कर simple classification-style loss से policy को सीधे preference pairs पर fit करता है, और कई alignment tasks में अच्छी तरह काम करता है। GRPO, जिसे DeepSeek के reasoning-model work ने popular बनाया, RL loop रखता है लेकिन value model निकाल देता है और हर response का baseline same prompt के लिए drawn samples के group के average reward से estimate करता है। Critic हटाने से memory घटती और tuning headaches की पूरी category खत्म होती है, इसीलिए verifiable rewards पर reasoning models train करने के लिए GRPO common default बना है। यह भी याद रखना चाहिए कि PPO स्वयं LLM era से पुराना है — इसे game-playing agents और simulated robot control के general-purpose algorithm के रूप में design किया गया था, और बाद में language model अलाइनमेंट में भर्ती किया गया।
Practical Tradeoffs
आज PPO चुनना engineering judgment call है। Plus side पर यह largest scales पर battle-tested है, value model से per-token credit assignment fine-grained learning signal देता है और years की accumulated tooling तथा practitioner folklore इसके failures diagnose करने योग्य बनाती हैं। Minus side पर GPU memory में चार models रखना expensive है, hyperparameter surface बड़ा तथा unforgiving है और reward over-optimization constant background risk है: reward model scores बढ़ते रह सकते हैं जबकि human judges कहें कि quality वास्तव में गिर रही है। Mature infrastructure और training dynamics पर tight control चाहने वाली teams अब भी PPO चुनती हैं, खासकर rewards binary के बजाय noisy हों। कुछ simpler, cheaper और easier to reproduce चाहने वाली teams increasingly GRPO या DPO से शुरू करती हैं और PPO तभी चुनती हैं जब वे methods wall पर पहुँचें। किसी भी तरह PPO समझना price of admission है — लगभग हर modern post-training algorithm को उसके modification के रूप में सबसे अच्छी तरह समझा जाता है।