Con-J

📌 核心贡献

提出 Con-J 框架,利用 LLM 自身生成能力构造对比判断对(contrastive judgment pairs),通过 DPO 训练生成式 judge,在保持与标量奖励模型可比性能的同时,实现自然可解释性和对数据集偏差的鲁棒性。

📖 摘要

Learning from preference feedback is a common practice for aligning large language models (LLMs) with human value. Conventionally, preference data is learned and encoded into a scalar reward model that connects a value head with an LLM to produce a scalar score as preference or reward. However, scalar models lack interpretability and are known to be susceptible to biases in datasets. This paper investigates leveraging the generation capability of LLMs to address both limitations in one shot. Specifically, we prompt the pre-trained LLM to generate positive and negative judgments, both supported with rationales in natural language form. The self-generated contrastive judgment pairs are used to train the generative judge with Direct Preference Optimization (DPO). This proposal of training the generative Judge using self-generated Contrastive judgments (Con-J) ensures natural interpretability due to the generated rationales together with the judgments, as well as high robustness against bias without the need for an additional reward head. Experimental results show that the performance of Con-J is comparable to the scalar reward model trained on the same collection of preference data, and demonstrate its superior interpretability and robustness in encoding human preferences.

🔍 关键信息

字段内容
机构Tsinghua University, Baichuan AI, University of Copenhagen
发表2024-10-01
分类cs.CL, cs.AI, cs.LG
链接arXiv

📝 我的笔记

动机与问题定义

标量奖励模型(Scalar Reward Model)将 LLM 的输出通过一个 value head 映射为单一标量分数,存在两个核心缺陷:

  1. 缺乏可解释性:标量分数无法解释偏好判断的理由
  2. 对数据偏差敏感:容易受到格式偏差(format bias)和冗长偏差(verbosity bias)的影响

Con-J 的核心思路:利用 LLM 自身的生成能力,直接生成带有自然语言理由(rationale)的判断,而非输出标量分数。通过自举(self-bootstrapping)方式从偏好数据中构造对比判断对,再用 DPO 训练。

方法总览

Con-J 方法总览:三步流程——判断采样(repeated + hint-driven)、对比过滤、DPO+SFT 训练

Con-J 包含三个核心步骤:

Step 1:判断采样(Judgment Sampling)

给定问题 和一对候选回答 ,构造 preamble ,然后用两种策略生成多样化判断:

  • Repeated Sampling:对同一 prompt 使用不同随机种子采样 8 次,得到多个判断
  • Hint-driven Sampling:在 prompt 中显式暗示哪个回答更好(正确/错误暗示各一半),迫使模型生成多样化判断

Step 2:判断过滤(Judgment Filtering)

利用真实偏好标签将生成的判断分类:

  • 正判断 :偏好预测与真实标签一致
  • 负判断 :偏好预测错误或模糊

构造对比对:

Step 3:DPO + SFT 联合训练

DPO 损失:

SFT 损失(在正判断上监督微调):

最终损失:

Rationale 的偏差鲁棒性理论分析

Con-J 将判断分解为 rationale 和二元预测 ,偏差鲁棒性的理论动机如下:

包含 rationale 的生成过程将偏差分散到 rationale 和预测两个组件中,降低了偏差对最终预测的直接影响。这类似于在判断前强制模型”先思考再回答”的 chain-of-thought 机制。

训练细节

配置值
基座模型Qwen2-7B-Instruct
学习率9e-6(cosine schedule, 3% warmup)
最大序列长度4,096
Batch size24(Con-J)/ 128(Scalar Model)
精度BF16/TF32 mixed precision
优化DeepSpeed ZeRO Stage 3
采样参数top-p=0.9, top-k=20, temp=1.0, rep_penalty=1.2
推理VLLM, top-p=1.0, temp=0.0

关键实验结果

商业数据集判断准确率:

模型CreationMathCode
GPT-4o55.674.868.1
Scalar Model (pointwise)69.484.869.4
Scalar Model (pairwise)69.284.669.6
Con-J72.485.070.1

Con-J 在所有任务上超越标量奖励模型和 GPT-4o。

公开基准测试:

模型Infinity-PrefUltraFeedbackPKU-SafeRLHFRewardBench
Llama3.1-8B59.062.966.480.7
Qwen2-7B59.064.567.291.3
Auto-J69.063.966.993.0
GPT-4o75.072.269.695.3
Con-J81.073.068.491.3

Con-J 在 Infinity-Preference 和 UltraFeedback 上超越 GPT-4o,在 7B 参数量级模型中 RewardBench 排名第一。

Ablation 分析

变体CreationMathCode
Con-J untrained53.663.461.7
Con-J w/o Hint61.377.468.2
Con-J w/o DPO(仅 SFT)54.664.263.5
Con-J (Full)72.485.070.1

关键发现:

  • DPO 训练至关重要:去掉 DPO 后 Creation 任务性能从 72.4 降至 54.6(降幅约 25%),仅 SFT 完全不够
  • Hint-driven 采样不可缺少:去掉后 Creation 从 72.4 降至 61.3,因为缺少多样化的负样本

偏差鲁棒性

Con-J 在格式偏差对抗测试中的表现:Con-J 相比标量模型在对抗集上性能衰减更小

Con-J 在格式偏差(format bias)和冗长偏差(verbosity bias)注入测试中均优于标量模型:

  • 标量模型在对抗集上性能大幅下降
  • Con-J 通过 rationale 生成提供了正则化效果
  • 去除 rationale 的 Con-J 在对抗测试上性能下降 15-25%,证实 rationale 是鲁棒性的关键来源

总结性评价

Con-J 的核心创新在于将 generative judge 的训练问题转化为一个自举式的对比学习问题:

  1. 自举构造训练数据:不依赖外部模型(如 GPT-4),完全从偏好数据自举生成对比判断对
  2. Rationale 带来双重优势:既提供可解释性,又通过偏差分散机制增强鲁棒性
  3. DPO 训练的巧妙应用:将”好判断 vs 坏判断”的对比转化为 DPO 的偏好对格式

与 GenRM 相比,Con-J 更强调 rationale 的鲁棒性作用和自举数据构造;与 J1 等后续工作相比,Con-J 是较早探索生成式 judge + DPO 训练范式的工作之一。局限性在于 rationale 与最终预测的一致性仍有提升空间。

🔗 相关论文

基于/改进自: GenRM, DPO

同方向: J1, Self-Rewarding