What problem does it solve? Aligning language models with human preferences requires navigating multiple post-training methods, dataset formats, and hyperparameter choices, and mistakes like using removed APIs (PPO in TRL 1.x) or misconfigured reward functions waste GPU hours. ## Core Features & Use Cases - Full RLHF Pipelines: Step-by-step checklists for SFT, reward model training, and RLOO reinforcement learning with working code for each stage. - Preference Alignment with DPO: Train on chosen/rejected pairs without a reward model, with guidance on beta tuning and 10+ loss variants (IPO, hinge, robust, APO). - Memory-Efficient GRPO: Design custom reward functions for verifiable tasks like math and structured output, with a production-ready training template and deep-dive reference on training dynamics. - Use Case: Fine-tune Qwen2.5-1.5B-Instruct on GSM8K with GRPO using correctness and format reward functions, monitoring reward progression and avoiding mode collapse. ## Quick Start Fine-tune Qwen/Qwen2.5-0.5B with supervised fine-tuning on the trl-lib/Capybara dataset using TRL's SFTTrainer.