What problem does it solve? Aligning language models with human preferences requires complex post-training pipelines involving supervised fine-tuning, reward modeling, and reinforcement learning, which are difficult to configure and debug from scratch. ## Core Features & Use Cases - Full RLHF Pipeline: Run the complete SFT → Reward Model → PPO workflow with step-by-step checklists and working code for each stage. - Preference Alignment with DPO: Train on chosen/rejected pairs without a reward model, with 10+ loss variants (IPO, hinge, robust, APO) and tuned hyperparameters. - Memory-Efficient GRPO: Train with custom reward functions using group-relative optimization, including a production-ready template and deep guidance on reward design, mode collapse, and loss behavior. - Use Case: Fine-tune Qwen2.5-1.5B on GSM8K with GRPO using correctness and format reward functions to produce structured reasoning outputs with XML-tagged answers. ## Quick Start Ask the AI to set up a DPO training run with TRL on a preference dataset using the provided configuration and trainer code.