广告 / 赞助展示Apple iPhone 官方产品图(Apple Newsroom)消费电子与设备端 AI访问官网 →

【Editorial】A preference loader swaps chosen and rejected answers: how do you catch a polarity flip before training?

Started by FPGA_ARM_Linux · 2026-11-28 11:40 北京时间 · 11 views · 1 replies
F Member
【Editorial Discussion】

A preference or DPO-style loader usually takes a prompt and two complete answers, with a column or key that marks which one was chosen. If that mapping is reversed—because columns were renamed, a sign was flipped, or a field was read from the wrong key—the trainer sees valid-looking pairs whose polarity is the opposite of the file. The answers can both be intact. The preference was inverted.

This is not a pair that was truncated until the remaining chosen text is no longer better than the rejected one, and it is not a question about stable preference cycles. It is also not a process label copied from a final answer, a speaker label swap in a transcript, a translated gold that was never remapped, or an id-to-label map that disagrees with a classifier head. The schema can be well-formed. Chosen and rejected were exchanged.

**Load a marked pair upright, then with the labels flipped**

Build a small, locally checkable pair in which the chosen answer contains a unique marker C and the rejected answer contains a unique marker R, both complete and untruncated. In condition A, load the pair through the documented schema and record, just before the loss, which text is treated as chosen and which as rejected. In condition B, swap only the chosen and rejected fields in the file, or invert a documented sign, and load again. In condition C, use a control that asserts, on a known fixture, that the chosen side still contains C.

Condition A should present C as chosen. If a production loader, given the same upright file as A, presents R as chosen, the polarity was flipped in the mapping. Condition B should be the mirror of A; if B and A agree, the loader is ignoring the label. The test fails if logs store only a pair id and a scalar loss, and never a digest or marker from each side as the trainer saw them. A startup check on a sealed fixture pair should refuse to train when C is not on the chosen side.

**Record both sides as the trainer sees them**

1) Persist, beside any preference batch, the pair id, a digest or marker of the chosen text, a digest or marker of the rejected text, and the source field names. A line that says only `pairs=N` cannot show a polarity flip.

2) Include a fixture that uses alternative key names, such as `winner`/`loser` or a ±1 sign, and one that reads from a joined table. A check that only tests a single column name will miss a join or a rename.

3) If several stages can invert the pair—an export job, a shuffle, and the training collator—run the same upright fixture through each. A correct collator can hide an export that already swapped the columns.

There are limits. Human preference data can contain genuine disagreements, and a sealed fixture does not certify every row. Some recipes mix several preference formats in one run. The test asks whether the loader preserves the documented chosen and rejected sides on a complete pair.

What chosen and rejected markers would you require in a training log before a preference step is treated as correctly labeled? How do you test a loader that reads a well-formed schema and still inverts the pair?
I IAI 编辑部 · 官方 Official
@FPGA_ARM_Linux 偏好学习或 DPO 的加载器若把 chosen 和 rejected 对调,训练仍会看到两条完整答案,只是极性反了。建议按你的夹具做:chosen 与 rejected 各带唯一标记,在进入 loss 前记录哪一段被当成 chosen;只交换字段或只翻转符号后,极性必须跟着翻转,否则说明映射没接上。再加一个对照:字段不动,只改无关列名,极性不得变化。

还建议在报告里留下进入 loss 前的文本摘要,而不是只留「已加载 N 对」。列改名、符号约定从 {0,1} 改成 {-1,1}、或从「rank_1 更好」改成「score 更高更好」,都足以把极性弄反。

想请教:你们的偏好数据现在是用列名、符号还是单独的 winner id 表示极性?换数据源时,有没有一条「翻转后奖励方向必须反号」的必跑夹具?

——
IAI 编辑部(iaiforum.com 官方编辑账号 · Official editorial account of IAI Forum)
广告 / 赞助展示广告位招商此处招商 · ads@iaiforum.comA6 · 728×90(移动端 320×100)了解详情 →
Log in or register to reply.