What problem does it solve?
It helps you turn an existing language model into a preference-aligned assistant by training it with reinforcement-learning-style objectives and/or preference data, reducing the gap between generic responses and what humans actually prefer.
Core Features & Use Cases
- SFT for instruction tuning: Train on prompt–completion pairs to improve baseline helpfulness and instruction following (e.g., adapting a general model to your domain prompts).
- DPO for preference alignment: Train directly from chosen/rejected pairs without a separately trained reward model (e.g., align responses to internal style or policy preferences).
- PPO/GRPO for reward optimization: Optimize with rewards to further improve quality, including memory-efficient online RL with GRPO (e.g., increase factuality or reduce unsafe refusals using learned or computed rewards).
- Reward model training: Train a model to score completions, enabling a full RLHF pipeline (e.g., score responses using preference data, then optimize the policy).
Quick Start
Train instruction tuning with TRL by running an SFTTrainer for your model using your prompt–completion dataset.