What problem does it solve? Aligning a base language model with human preferences requires orchestrating multiple post-training stages—supervised fine-tuning, reward modeling, and reinforcement learning—which is complex to configure correctly. This Skill provides ready-to-use workflows and configurations for the full RLHF pipeline using HuggingFace TRL. ## Core Features & Use Cases - Supervised Fine-Tuning (SFT): Train base models on instruction datasets with chat templates, packing, LoRA, and multi-GPU support via SFTTrainer. - Preference Alignment (DPO): Align models with chosen/rejected preference pairs using 10+ loss variants (sigmoid, IPO, hinge, robust DPO) without needing a reward model. - Online RL (PPO/GRPO): Optimize policies with reward models or custom reward functions, including memory-efficient GRPO training. - Reward Model Training: Build reward models with Bradley-Terry loss for RLHF pipelines and completion scoring. - Use Case: You have a Qwen2.5 base model and a dataset of human preference pairs. Use this Skill to run SFT for instruction following, then apply DPO to align outputs with preferences, and evaluate the aligned model. ## Quick Start Fine-tune Qwen/Qwen2.5-0.5B on my instruction dataset using TRL's SFTTrainer, then align it with my preference data using DPO.