This technical demonstration explores LLM post-training methodologies using HuggingFace TRL to compare Supervised Fine-Tuning (SFT), Direct Preference Optimization (DPO), and Group Relative Policy Optimization (GRPO). Using a 0.14B parameter model on an 8GB GPU, the experiments demonstrate that SFT effectively injects new behaviors, such as identity shifts, but causes significant distribution drift. Quantitative analysis using forward KL divergence and perplexity (PPL) reveals "RL's Razor": on-policy RL (GRPO) preserves prior capabilities much better than SFT. While SFT increased WikiText PPL by approximately 10-21%, GRPO maintained near-baseline performance with only a 0.3% to 0.4% increase in PPL. Furthermore, by scaling to a 3B model on a 48GB GPU, the study shows that GRPO can amplify existing reasoning behaviors—such as self-verification and search strategies seen in DeepSeek-R1—into stable execution patterns without the need for a separate value network. The results highlight that while SFT is effective for instruction following, GRPO provides a more efficient mechanism for task-specific capability gains with minimal degradation of general language abilities.
Read original
hackernews