Skip to main content
Direct Preference Optimization (DPO) trains a model to favor a preferred response over a rejected response for the same prompt. DPO is useful when you want to steer the model away from one tendency and toward another, such as its tone, how it follows instructions, or which tool it selects. Use supervised fine-tuning instead when you have only one target response per prompt.
Only some base models support Direct Preference Optimization.
FAiE checks that your dataset holds preference pairs, recommends a base model that supports DPO, and keeps the tuned settings. Ask FAiE to set up a DPO job with a prompt such as “Train a DPO model on my tone preferences dataset.” A common pattern is a DPO run on top of an SFT model. See Train again.

PREFERENCE DATA

DPO trains only on a Preference dataset, and the other training methods don’t accept one. Each row holds the shared conversation in messages, which can have one turn or several, the preferred response in chosen, and the other response in rejected:
A row must follow these rules:
  • messages is a non-empty list of turns. It contains at least one user message with text, and it ends with a user or a tool message.
  • chosen and rejected differ, and each contains exactly one assistant message.
  • An assistant response may contain text, tool calls, or both. Tool calls also need top-level tools definitions, and their arguments must be a JSON-encoded object string.

OTHER FORMATS YOU CAN UPLOAD

When you upload a file, Oumi converts common Hugging Face TRL preference formats to the format above. These include rows with string fields:
Oumi also accepts rows without prompt, where chosen and rejected hold the same conversation and differ only in the final assistant message:

START A DPO JOB

Follow Train a model, and select Direct Preference Optimization as the training method. Select a Preference dataset as the training dataset, and optionally another as the validation dataset. The Preference Settings section holds the DPO settings below.

PREFERENCE SETTINGS

Start with the defaults tuned for the base model, and change one setting at a time. Evaluate the base and trained models on the same task-specific dataset, to confirm that the target metric improves without unacceptable regressions elsewhere.