What problem does it solve?
This Skill helps you align large language models (LLMs) with human preferences by using TRL post-training methods like SFT, DPO, PPO, and GRPO instead of relying only on base pretraining.
Core Features & Use Cases
- SFT for instruction tuning: Train on prompt-completion pairs to improve task-following behavior.
- DPO for preference alignment: Optimize directly from chosen/rejected preference pairs without a separate reward model.
- PPO/GRPO for reinforcement learning: Improve outputs using reward signals, including memory-efficient online RL with custom reward functions.
- Reward modeling support: Train a reward model from preference data to enable stronger RLHF pipelines.
- Use case: You have a base model and either (a) preference pairs or (b) objective reward signals (format/correctness), and you want an aligned model that follows structured outputs and improves quality with bounded, repeatable training recipes.
Quick Start
Run DPO to align your base instruction model using a chosen/rejected preference dataset by executing: trl dpo --model_name_or_path Qwen/Qwen2.5-0.5B-Instruct --dataset_name trl-lib/ultrafeedback_binarized --output_dir qwen-dpo.