मुख्य सामग्री पर जाएँ
Zubnet AIसीखेंWiki › GRPO
प्रशिक्षण

GRPO

इसे भी कहा जाता है: Group Relative Policy Optimization
Language models की fine-tuning का reinforcement learning algorithm, जिसे DeepSeek ने 2024 में introduce किया और DeepSeek-R1 ने popular बनाया। Outputs judge करने के लिए separate value model train करने के बजाय यह हर prompt पर candidate answers का group sample करता है और हर answer को group के average reward के विरुद्ध score करता है। इससे reinforcement learning सस्ती और चलाने में सरल होती है, तथा verifiable rewards वाले tasks पर post-training reasoning models के लिए यह standard choice बन गया है।

यह क्यों मायने रखता है

GRPO ने critic model हटाकर RL fine-tuning की cost घटाई, classic pipelines को जिन दो large models को train तथा memory में रखना होता था उनमें से एक, और reasoning-style training को frontier-lab infrastructure के बिना teams की पहुँच में रखा। DeepSeek-R1 तथा तब से अधिकतर open reasoning models के पीछे यही algorithm है, इसलिए अब लगभग हर serious post-training stack में दिखाई देता है। आपके इस्तेमाल model को math, code या logic problems solve करने के लिए train किया गया हो तो GRPO शामिल होने की अच्छी संभावना है।

गहन अध्ययन

GRPO — Group Relative Policy Optimization — पहली बार 2024 में DeepSeek के DeepSeekMath paper में आया, फिर एक वर्ष बाद DeepSeek-R1 के training algorithm के रूप में famous हुआ, वह open model जिसने दिखाया कि अकेली reinforcement learning लंबी, self-checking विचार-शृंखला निकाल सकती है। Core में यह PPO का pragmatic simplification है, वह algorithm जो classic RLHF pipelines चलाता था। PPO दूसरा large model, critic, train करता है जो estimate करता है कि partially generated answer कितना अच्छा है; GRPO critic फेंक देता है। हर prompt के लिए current policy candidate outputs का group sample करती है, हर output reward पाता है और हर एक का advantage केवल group average से उसके reward की ऊपर या नीचे दूरी है। परिणाम ऐसा RL loop है जो चलाने में सस्ता, tune करने में आसान और तर्क models train करने वाले verifiable rewards के लिए natural fit है।

Group, Critic की जगह कैसे लेता है

PPO में critic का काम partial answer का expected reward predict करना है, ताकि algorithm बता सके कि final outcome expected से बेहतर था या खराब। GRPO same baseline signal neural network के बजाय statistics से पाता है। Prompt मिलने पर policy G outputs का group generate करती है — व्यवहार में 8 से 64 तक — और हर output score होता है, या rule-based checker से, जैसे math answer match हुआ या code tests pass करता है, या learned Reward Model से। फिर हर output का advantage उसका reward minus group mean, divided by group standard deviation होता है। Group average से ऊपर outputs probability में push up होते हैं, नीचे वाले push down, और PPO-style clipped objective plus frozen reference model की ओर KL penalty हर update छोटा रखती है। Baseline per prompt compute होने के कारण ऐसे prompts जहाँ हर sample same score करता है लगभग कोई gradient नहीं देते, जो व्यवहार में बहुत मायने रखता है।

यह सस्ता और अधिक Stable क्यों है

Savings concrete हैं। Classic PPO pipelines training में चार models memory में रखती हैं — policy, frozen reference policy, reward model और critic जो आम तौर पर policy जितना बड़ा होता है — तथा critic को हर चीज़ के साथ train करना पड़ता है, जो notoriously finicky है। GRPO चार में सबसे troublesome model हटाता है, bigger batches या larger models के लिए VRAM मुक्त करता है और value-learning bugs की पूरी class समाप्त करता है। Group normalization reward scale automatically संभालती है: tightly clustered rewards वाले prompt के advantages zero की ओर squash होते हैं, इसलिए update उन prompts पर focus करता है जहाँ model outputs quality में सचमुच अलग हैं। Tradeoff है कि compute budget critic training से इन्फ़ेरेंस में shift होता है: प्रति step thousands of prompts में हर prompt पर 16 या 32 samples generate करने का अर्थ sampler, optimizer नहीं, आम तौर पर bottleneck है।

यह Optimizer है, Reasoning Recipe नहीं

एक आम गलतफ़हमी है कि GRPO inherently reasoning या verifiable rewards से बँधा है — कि algorithm स्वयं DeepSeek-R1 में दिखा behavior पैदा करता है। ऐसा नहीं है। GRPO reward-agnostic है: helpfulness या style जैसी open-ended qualities score करने वाला learned reward model समेत उसे दिया कोई भी signal happily maximize करेगा। Reasoning breakthrough combination से आया — GRPO plus rule-based verifiable rewards, plus strong base model, plus self-verification जैसे behaviors emerge होने जितने लंबे training runs — वह recipe जिसे अब RLVR कहते हैं। दूसरी ओर verifiable rewards plain PPO के साथ ठीक काम करते हैं और कई labs ने GRPO से पहले उस तरीके से reasoning models train किए। दोनों ideas अलग रखना practically मायने रखता है: carefully designed rewards तथा पर्याप्त compute के बिना केवल algorithm से reasoning emerge होने की उम्मीद में GRPO अपनाने वाली teams आम तौर पर निराश होती हैं।

यह कहाँ टूटता है

GRPO की elegance के साथ जानने लायक failure modes आते हैं। सबसे discussed all-or-nothing group है: prompt के हर sample को same reward मिले — सभी सही या सभी गलत — तो हर advantage zero होता है और prompt कुछ contribute नहीं करता, इसलिए training signal prompt difficulty को उस band में रखने पर बहुत depend करता है जहाँ model कभी succeed होता है। Hard tasks पर reward sparsity इसे बदतर करती है, इसलिए practical pipelines easier problems mix करती या partial credit देती हैं। Small groups noisy baselines देते हैं; large groups अधिक sampling compute cost करते हैं और right size अब भी empirical tuning का विषय है। Long runs में models entropy collapse से भी जूझ सकते हैं, जहाँ policy बहुत जल्दी overconfident होकर explore करना बंद करती है, या length blow-up से, जहाँ answers केवल reward से length correlate होने के कारण लंबे होते जाते हैं। अधिकतर issues के mitigations हैं और Hugging Face TRL जैसे frameworks की implementations relevant knobs expose करती हैं, लेकिन GRPO fire-and-forget algorithm नहीं है।

← सभी शब्द
ESC