What problem does it solve? Aligning language models with human preferences requires complex RLHF pipelines involving supervised fine-tuning, reward model training, and reinforcement learning, which are difficult to configure and stabilize without guidance. ## Core Features & Use Cases - Supervised Fine-Tuning (SFT): Train base models on instruction-following datasets with prompt-completion or conversational formats, packing, and LoRA support. - Preference Alignment (DPO): Align models with chosen/rejected preference pairs using 10+ loss variants including IPO, hinge, and robust DPO, without needing a reward model. - Online Reinforcement Learning: Run PPO with a trained reward model or memory-efficient GRPO with custom reward functions for online RL training. - Use Case: Take a base model like Qwen2.5-0.5B, run SFT on the Capybara dataset, train a reward model on UltraFeedback preferences, then apply PPO to produce a human-aligned chat model. ## Quick Start Fine-tune Qwen2.5-0.5B with DPO on the ultrafeedback_binarized preference dataset using TRL.