多模态多轮对话RLHF数据集如何构建
{
"messages": [
{"role": "user", "content": "<image>...<image>请根据提供的甲状腺超声图像..."},
{"role": "assistant", "content": "\n穿刺会诊:\n\n左叶下部内侧见低回声..."},
{"role": "user", "content": "基于这些图像和上述超声所见,得出检查诊断是什么?"},
{"role": "assistant", "content": "\n甲状腺多发实性结节,右叶者可行穿刺\n\n"},
{"role": "user", "content": "综合这些图像...穿刺会诊结果为阳性还是阴性?"},
{"role": "assistant", "content": "阳性"}
],
"images": ["./data_filtered/train/.../1.jpg", "..."],
"rejected_messages": [
{"role": "user", "content": "<image>...<image>请根据提供的甲状腺超声图像..."},
{"role": "assistant", "content": "\n穿刺会诊:\n\n左叶见等回声..."},
{"role": "user", "content": "基于这些图像和上述超声所见,得出检查诊断是什么?"},
{"role": "assistant", "content": "\n甲状腺单发囊性结节,建议随访\n\n"},
{"role": "user", "content": "综合这些图像...穿刺会诊结果为阳性还是阴性?"},
{"role": "assistant", "content": "阴性"}
],
"rejected_images": ["./data_filtered/train/.../1.jpg", "..."]
}
上诉构建的RLHF数据格式是否正确?
通常只有最后一轮是不一样的。
通常只有最后一轮是不一样的。
对于三轮对话构建RLHF数据集,只能为每一轮单独构建吗?
+1
通常只有最后一轮是不一样的。
hello,请问一下,如果我的对话里面, 忘记写
例子如下: { "messages": [ {"role": "user", "content": "请根据提供的甲状腺超声图像..."}, {"role": "assistant", "content": "\n穿刺会诊:\n\n左叶下部内侧见低回声..."}, ], "images": ["./data_filtered/train/.../1.jpg"], }
This issue has been inactive for over 3 months and will be automatically closed in 7 days. If this issue is still relevant, please reply to this message.
多轮历史可以保留。通常让 chosen / rejected 共享同一段历史,只在最后一个 assistant 回答上做偏好比较,比如这条就包含两轮对话:
{
"messages": [
{"role": "user", "content": "先给我一个方案。"},
{"role": "assistant", "content": "第一轮已确认的方案。"},
{"role": "user", "content": "再补充具体步骤。"},
{"role": "assistant", "content": "第二轮更好的回答。"}
],
"rejected_response": "第二轮较差的回答。"
}
rejected_response 会复用前面的历史,替换最后的回答,见转换代码。
想让三轮都贡献偏好信号,再拆成三条,每条截到对应轮;历史固定后再比较这一轮的两个回答。如果连历史回答也分别用 chosen / rejected 分支,比较的条件就不同了。
图片建议在对应 user 的 content 里显式放 <image>,并给同一条样本的 images 传图片路径,便于确定图片插入的位置。