Back to the journalLanguage models / Field notes

From fluent to useful: a note on DPO

Preference data, model behavior, and why alignment starts with the examples you choose.

Two sculptural ribbon paths diverge from one stack of translucent sheets.
A shared prompt. Different directions.

Two answers can both sound plausible. Only one may be grounded, appropriately concise, and useful for the task. Post-training is where that distinction becomes an explicit learning signal.

Learning from comparisons

Direct Preference Optimization uses pairs of responses to the same prompt: one preferred, one rejected. It trains their relative likelihood against a reference model, without training a separate explicit reward model.

01 / One prompt, two responsesIllustrative example
Prompt

Does a lower loss prove better speech?

Chosen

The loss decreased. Listening quality still needs a separate evaluation.

Specific, grounded, and calibrated.
Rejected

Yes, the voice is definitely better.

Confident, but the evidence is insufficient.
The label captures a reason for preferring an answer. This example is explanatory, not a record from the model’s training data.

The public GLM Flash DPO repository documents a GLM-4.7-Flash fine-tune using DPO and TRL. It is a concrete artifact to explore; the card does not establish a measured improvement on every downstream task.

A pair is a small specification

In the explicit-prompt format supported by TRL, a training example carries prompt, chosen, and rejected fields. Here is a deliberately small example that can be inspected before any training code is involved.

preference_pair.py
python
# An illustrative example, not an actual training record.
pair = {
    "prompt": "Does a lower loss prove better speech?",
    "chosen": (
        "The loss decreased. Listening quality still "
        "needs a separate evaluation."
    ),
    "rejected": "Yes, the voice is definitely better.",
}

required = {"prompt", "chosen", "rejected"}
assert required.issubset(pair)
assert pair["chosen"] != pair["rejected"]

The assertions check the shape of an example. They cannot establish whether its label is correct. That still requires a defensible preference criterion and a review process.

The dataset specifies behavior

If longer answers consistently win, a model may learn verbosity. If confidence wins, it may learn to conceal uncertainty. If formatting wins, polish can become a proxy for correctness.

Review the signal behind the label
Preference criterionUseful review question
GroundingDoes the response stay within the available evidence?
Instruction adherenceDoes it complete the actual task?
CalibrationDoes it acknowledge missing information?
EfficiencyDoes each added detail help the reader?

Evaluate the tradeoffs

Keep a held-out set of realistic prompts. Compare the base model and adapted model without revealing which is which. Include ambiguous requests, multilingual cases, and prompts where the useful next step is to ask for missing context.

Preference optimization changes a distribution of behaviors. It does not replace retrieval, access controls, reliable tools, or application-level evaluation. A model that writes beautifully still needs a system that can verify what it does.

Sources & further reading