19. 合成数据(Synthetic Data)与模型对齐

随着大模型的发展,人工标注已经逐渐成为瓶颈。

例如:

text 复制代码
GPT-4
Claude
DeepSeek-R1
Gemini

背后大量数据并非全部来自人工。

而是:

人工设计规则 + 大模型自动生成数据

这种方式通常称为:

text 复制代码
Synthetic Data
合成数据

为什么需要合成数据

人工标注的问题:

问题 描述
成本高 专家标注非常昂贵
速度慢 数据增长有限
覆盖不足 难以覆盖长尾问题
质量不一致 不同标注员标准不同

因此工业界越来越多采用:

text 复制代码
Human → AI → Human

的混合模式。


合成数据流水线

一个典型的数据生成流程:
#mermaid-svg-Px0gU4PLJoK97cqY{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-Px0gU4PLJoK97cqY .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-Px0gU4PLJoK97cqY .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-Px0gU4PLJoK97cqY .error-icon{fill:#552222;}#mermaid-svg-Px0gU4PLJoK97cqY .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-Px0gU4PLJoK97cqY .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-Px0gU4PLJoK97cqY .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-Px0gU4PLJoK97cqY .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-Px0gU4PLJoK97cqY .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-Px0gU4PLJoK97cqY .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-Px0gU4PLJoK97cqY .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-Px0gU4PLJoK97cqY .marker{fill:#333333;stroke:#333333;}#mermaid-svg-Px0gU4PLJoK97cqY .marker.cross{stroke:#333333;}#mermaid-svg-Px0gU4PLJoK97cqY svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-Px0gU4PLJoK97cqY p{margin:0;}#mermaid-svg-Px0gU4PLJoK97cqY .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-Px0gU4PLJoK97cqY .cluster-label text{fill:#333;}#mermaid-svg-Px0gU4PLJoK97cqY .cluster-label span{color:#333;}#mermaid-svg-Px0gU4PLJoK97cqY .cluster-label span p{background-color:transparent;}#mermaid-svg-Px0gU4PLJoK97cqY .label text,#mermaid-svg-Px0gU4PLJoK97cqY span{fill:#333;color:#333;}#mermaid-svg-Px0gU4PLJoK97cqY .node rect,#mermaid-svg-Px0gU4PLJoK97cqY .node circle,#mermaid-svg-Px0gU4PLJoK97cqY .node ellipse,#mermaid-svg-Px0gU4PLJoK97cqY .node polygon,#mermaid-svg-Px0gU4PLJoK97cqY .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-Px0gU4PLJoK97cqY .rough-node .label text,#mermaid-svg-Px0gU4PLJoK97cqY .node .label text,#mermaid-svg-Px0gU4PLJoK97cqY .image-shape .label,#mermaid-svg-Px0gU4PLJoK97cqY .icon-shape .label{text-anchor:middle;}#mermaid-svg-Px0gU4PLJoK97cqY .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-Px0gU4PLJoK97cqY .rough-node .label,#mermaid-svg-Px0gU4PLJoK97cqY .node .label,#mermaid-svg-Px0gU4PLJoK97cqY .image-shape .label,#mermaid-svg-Px0gU4PLJoK97cqY .icon-shape .label{text-align:center;}#mermaid-svg-Px0gU4PLJoK97cqY .node.clickable{cursor:pointer;}#mermaid-svg-Px0gU4PLJoK97cqY .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-Px0gU4PLJoK97cqY .arrowheadPath{fill:#333333;}#mermaid-svg-Px0gU4PLJoK97cqY .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-Px0gU4PLJoK97cqY .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-Px0gU4PLJoK97cqY .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-Px0gU4PLJoK97cqY .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-Px0gU4PLJoK97cqY .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-Px0gU4PLJoK97cqY .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-Px0gU4PLJoK97cqY .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-Px0gU4PLJoK97cqY .cluster text{fill:#333;}#mermaid-svg-Px0gU4PLJoK97cqY .cluster span{color:#333;}#mermaid-svg-Px0gU4PLJoK97cqY div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-Px0gU4PLJoK97cqY .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-Px0gU4PLJoK97cqY rect.text{fill:none;stroke-width:0;}#mermaid-svg-Px0gU4PLJoK97cqY .icon-shape,#mermaid-svg-Px0gU4PLJoK97cqY .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-Px0gU4PLJoK97cqY .icon-shape p,#mermaid-svg-Px0gU4PLJoK97cqY .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-Px0gU4PLJoK97cqY .icon-shape .label rect,#mermaid-svg-Px0gU4PLJoK97cqY .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-Px0gU4PLJoK97cqY .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-Px0gU4PLJoK97cqY .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-Px0gU4PLJoK97cqY :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} Prompt Template
LLM生成数据
数据过滤
格式转换
质量评分
训练数据


第一步:生成(Generation)

使用已有大模型生成:

text 复制代码
Question
Answer
Reasoning
Tool Use
Code

等数据。


例如:

text 复制代码
请生成10个高中数学问题及答案

模型输出:

text 复制代码
Question
Answer

数据对。


自动生成流程

#mermaid-svg-s1jpllYDpDxKpvw8{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-s1jpllYDpDxKpvw8 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-s1jpllYDpDxKpvw8 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-s1jpllYDpDxKpvw8 .error-icon{fill:#552222;}#mermaid-svg-s1jpllYDpDxKpvw8 .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-s1jpllYDpDxKpvw8 .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-s1jpllYDpDxKpvw8 .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-s1jpllYDpDxKpvw8 .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-s1jpllYDpDxKpvw8 .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-s1jpllYDpDxKpvw8 .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-s1jpllYDpDxKpvw8 .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-s1jpllYDpDxKpvw8 .marker{fill:#333333;stroke:#333333;}#mermaid-svg-s1jpllYDpDxKpvw8 .marker.cross{stroke:#333333;}#mermaid-svg-s1jpllYDpDxKpvw8 svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-s1jpllYDpDxKpvw8 p{margin:0;}#mermaid-svg-s1jpllYDpDxKpvw8 .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-s1jpllYDpDxKpvw8 .cluster-label text{fill:#333;}#mermaid-svg-s1jpllYDpDxKpvw8 .cluster-label span{color:#333;}#mermaid-svg-s1jpllYDpDxKpvw8 .cluster-label span p{background-color:transparent;}#mermaid-svg-s1jpllYDpDxKpvw8 .label text,#mermaid-svg-s1jpllYDpDxKpvw8 span{fill:#333;color:#333;}#mermaid-svg-s1jpllYDpDxKpvw8 .node rect,#mermaid-svg-s1jpllYDpDxKpvw8 .node circle,#mermaid-svg-s1jpllYDpDxKpvw8 .node ellipse,#mermaid-svg-s1jpllYDpDxKpvw8 .node polygon,#mermaid-svg-s1jpllYDpDxKpvw8 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-s1jpllYDpDxKpvw8 .rough-node .label text,#mermaid-svg-s1jpllYDpDxKpvw8 .node .label text,#mermaid-svg-s1jpllYDpDxKpvw8 .image-shape .label,#mermaid-svg-s1jpllYDpDxKpvw8 .icon-shape .label{text-anchor:middle;}#mermaid-svg-s1jpllYDpDxKpvw8 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-s1jpllYDpDxKpvw8 .rough-node .label,#mermaid-svg-s1jpllYDpDxKpvw8 .node .label,#mermaid-svg-s1jpllYDpDxKpvw8 .image-shape .label,#mermaid-svg-s1jpllYDpDxKpvw8 .icon-shape .label{text-align:center;}#mermaid-svg-s1jpllYDpDxKpvw8 .node.clickable{cursor:pointer;}#mermaid-svg-s1jpllYDpDxKpvw8 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-s1jpllYDpDxKpvw8 .arrowheadPath{fill:#333333;}#mermaid-svg-s1jpllYDpDxKpvw8 .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-s1jpllYDpDxKpvw8 .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-s1jpllYDpDxKpvw8 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-s1jpllYDpDxKpvw8 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-s1jpllYDpDxKpvw8 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-s1jpllYDpDxKpvw8 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-s1jpllYDpDxKpvw8 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-s1jpllYDpDxKpvw8 .cluster text{fill:#333;}#mermaid-svg-s1jpllYDpDxKpvw8 .cluster span{color:#333;}#mermaid-svg-s1jpllYDpDxKpvw8 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-s1jpllYDpDxKpvw8 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-s1jpllYDpDxKpvw8 rect.text{fill:none;stroke-width:0;}#mermaid-svg-s1jpllYDpDxKpvw8 .icon-shape,#mermaid-svg-s1jpllYDpDxKpvw8 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-s1jpllYDpDxKpvw8 .icon-shape p,#mermaid-svg-s1jpllYDpDxKpvw8 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-s1jpllYDpDxKpvw8 .icon-shape .label rect,#mermaid-svg-s1jpllYDpDxKpvw8 .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-s1jpllYDpDxKpvw8 .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-s1jpllYDpDxKpvw8 .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-s1jpllYDpDxKpvw8 :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} Prompt Template
LLM
Question
Answer
Think


Template Engineering

实际生成时通常使用模板工程。

模板中可以控制:

  • 主题
  • 风格
  • 难度
  • 领域
  • 数量
  • 多样性

例如:

text 复制代码
领域:
数学

难度:
高中

风格:
逐步推导

生成:
100个问题

模板:

text 复制代码
请生成{数量}个{领域}问题

要求:

难度:{难度}
风格:{风格}

输出:
Question
Think
Answer

第二步:过滤(Filtering)

生成的数据并不能直接训练。

因为:

text 复制代码
Garbage In
Garbage Out

垃圾数据会直接降低模型质量。


因此需要过滤。


为什么过滤重要

例如生成:

text 复制代码
Question:
1+1=?
text 复制代码
Answer:
3

显然错误。


或者:

text 复制代码
<think>

因为今天星期三

所以答案是北京

</think>

逻辑混乱。


这些数据必须删除。


过滤流程

#mermaid-svg-7z3BAiIbQ68J0USm{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-7z3BAiIbQ68J0USm .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-7z3BAiIbQ68J0USm .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-7z3BAiIbQ68J0USm .error-icon{fill:#552222;}#mermaid-svg-7z3BAiIbQ68J0USm .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-7z3BAiIbQ68J0USm .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-7z3BAiIbQ68J0USm .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-7z3BAiIbQ68J0USm .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-7z3BAiIbQ68J0USm .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-7z3BAiIbQ68J0USm .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-7z3BAiIbQ68J0USm .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-7z3BAiIbQ68J0USm .marker{fill:#333333;stroke:#333333;}#mermaid-svg-7z3BAiIbQ68J0USm .marker.cross{stroke:#333333;}#mermaid-svg-7z3BAiIbQ68J0USm svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-7z3BAiIbQ68J0USm p{margin:0;}#mermaid-svg-7z3BAiIbQ68J0USm .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-7z3BAiIbQ68J0USm .cluster-label text{fill:#333;}#mermaid-svg-7z3BAiIbQ68J0USm .cluster-label span{color:#333;}#mermaid-svg-7z3BAiIbQ68J0USm .cluster-label span p{background-color:transparent;}#mermaid-svg-7z3BAiIbQ68J0USm .label text,#mermaid-svg-7z3BAiIbQ68J0USm span{fill:#333;color:#333;}#mermaid-svg-7z3BAiIbQ68J0USm .node rect,#mermaid-svg-7z3BAiIbQ68J0USm .node circle,#mermaid-svg-7z3BAiIbQ68J0USm .node ellipse,#mermaid-svg-7z3BAiIbQ68J0USm .node polygon,#mermaid-svg-7z3BAiIbQ68J0USm .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-7z3BAiIbQ68J0USm .rough-node .label text,#mermaid-svg-7z3BAiIbQ68J0USm .node .label text,#mermaid-svg-7z3BAiIbQ68J0USm .image-shape .label,#mermaid-svg-7z3BAiIbQ68J0USm .icon-shape .label{text-anchor:middle;}#mermaid-svg-7z3BAiIbQ68J0USm .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-7z3BAiIbQ68J0USm .rough-node .label,#mermaid-svg-7z3BAiIbQ68J0USm .node .label,#mermaid-svg-7z3BAiIbQ68J0USm .image-shape .label,#mermaid-svg-7z3BAiIbQ68J0USm .icon-shape .label{text-align:center;}#mermaid-svg-7z3BAiIbQ68J0USm .node.clickable{cursor:pointer;}#mermaid-svg-7z3BAiIbQ68J0USm .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-7z3BAiIbQ68J0USm .arrowheadPath{fill:#333333;}#mermaid-svg-7z3BAiIbQ68J0USm .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-7z3BAiIbQ68J0USm .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-7z3BAiIbQ68J0USm .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-7z3BAiIbQ68J0USm .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-7z3BAiIbQ68J0USm .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-7z3BAiIbQ68J0USm .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-7z3BAiIbQ68J0USm .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-7z3BAiIbQ68J0USm .cluster text{fill:#333;}#mermaid-svg-7z3BAiIbQ68J0USm .cluster span{color:#333;}#mermaid-svg-7z3BAiIbQ68J0USm div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-7z3BAiIbQ68J0USm .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-7z3BAiIbQ68J0USm rect.text{fill:none;stroke-width:0;}#mermaid-svg-7z3BAiIbQ68J0USm .icon-shape,#mermaid-svg-7z3BAiIbQ68J0USm .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-7z3BAiIbQ68J0USm .icon-shape p,#mermaid-svg-7z3BAiIbQ68J0USm .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-7z3BAiIbQ68J0USm .icon-shape .label rect,#mermaid-svg-7z3BAiIbQ68J0USm .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-7z3BAiIbQ68J0USm .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-7z3BAiIbQ68J0USm .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-7z3BAiIbQ68J0USm :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 原始生成数据
格式检查
正确性检查
推理检查
保留高质量样本


LLM作为过滤器

现代训练中经常使用:

text 复制代码
LLM as a Judge

即:

让一个更强模型评价较弱模型。


例如:

text 复制代码
GPT-4
Claude
DeepSeek-V3

担任评审。


评分维度:

text 复制代码
正确性
逻辑性
格式规范
推理质量
可读性

第三步:转换(Transformation)

即使答案正确。

格式也未必适合训练。

因此需要转换。


例如:

原始数据:

text 复制代码
问题:
苹果有几个?

答案:
5

转换后:

text 复制代码
<user>
苹果有几个?
</user>

<assistant>
5
</assistant>

常见转换

对话格式

text 复制代码
Question → Chat

CoT格式

text 复制代码
Answer
↓
Think + Answer

风格转换

text 复制代码
正式
↓
口语化

长度扩展

text 复制代码
一句话
↓
详细解释

数据转换流程

#mermaid-svg-1kyYSvOKPxe7JG0Y{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-1kyYSvOKPxe7JG0Y .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-1kyYSvOKPxe7JG0Y .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-1kyYSvOKPxe7JG0Y .error-icon{fill:#552222;}#mermaid-svg-1kyYSvOKPxe7JG0Y .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-1kyYSvOKPxe7JG0Y .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-1kyYSvOKPxe7JG0Y .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-1kyYSvOKPxe7JG0Y .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-1kyYSvOKPxe7JG0Y .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-1kyYSvOKPxe7JG0Y .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-1kyYSvOKPxe7JG0Y .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-1kyYSvOKPxe7JG0Y .marker{fill:#333333;stroke:#333333;}#mermaid-svg-1kyYSvOKPxe7JG0Y .marker.cross{stroke:#333333;}#mermaid-svg-1kyYSvOKPxe7JG0Y svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-1kyYSvOKPxe7JG0Y p{margin:0;}#mermaid-svg-1kyYSvOKPxe7JG0Y .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-1kyYSvOKPxe7JG0Y .cluster-label text{fill:#333;}#mermaid-svg-1kyYSvOKPxe7JG0Y .cluster-label span{color:#333;}#mermaid-svg-1kyYSvOKPxe7JG0Y .cluster-label span p{background-color:transparent;}#mermaid-svg-1kyYSvOKPxe7JG0Y .label text,#mermaid-svg-1kyYSvOKPxe7JG0Y span{fill:#333;color:#333;}#mermaid-svg-1kyYSvOKPxe7JG0Y .node rect,#mermaid-svg-1kyYSvOKPxe7JG0Y .node circle,#mermaid-svg-1kyYSvOKPxe7JG0Y .node ellipse,#mermaid-svg-1kyYSvOKPxe7JG0Y .node polygon,#mermaid-svg-1kyYSvOKPxe7JG0Y .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-1kyYSvOKPxe7JG0Y .rough-node .label text,#mermaid-svg-1kyYSvOKPxe7JG0Y .node .label text,#mermaid-svg-1kyYSvOKPxe7JG0Y .image-shape .label,#mermaid-svg-1kyYSvOKPxe7JG0Y .icon-shape .label{text-anchor:middle;}#mermaid-svg-1kyYSvOKPxe7JG0Y .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-1kyYSvOKPxe7JG0Y .rough-node .label,#mermaid-svg-1kyYSvOKPxe7JG0Y .node .label,#mermaid-svg-1kyYSvOKPxe7JG0Y .image-shape .label,#mermaid-svg-1kyYSvOKPxe7JG0Y .icon-shape .label{text-align:center;}#mermaid-svg-1kyYSvOKPxe7JG0Y .node.clickable{cursor:pointer;}#mermaid-svg-1kyYSvOKPxe7JG0Y .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-1kyYSvOKPxe7JG0Y .arrowheadPath{fill:#333333;}#mermaid-svg-1kyYSvOKPxe7JG0Y .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-1kyYSvOKPxe7JG0Y .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-1kyYSvOKPxe7JG0Y .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-1kyYSvOKPxe7JG0Y .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-1kyYSvOKPxe7JG0Y .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-1kyYSvOKPxe7JG0Y .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-1kyYSvOKPxe7JG0Y .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-1kyYSvOKPxe7JG0Y .cluster text{fill:#333;}#mermaid-svg-1kyYSvOKPxe7JG0Y .cluster span{color:#333;}#mermaid-svg-1kyYSvOKPxe7JG0Y div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-1kyYSvOKPxe7JG0Y .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-1kyYSvOKPxe7JG0Y rect.text{fill:none;stroke-width:0;}#mermaid-svg-1kyYSvOKPxe7JG0Y .icon-shape,#mermaid-svg-1kyYSvOKPxe7JG0Y .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-1kyYSvOKPxe7JG0Y .icon-shape p,#mermaid-svg-1kyYSvOKPxe7JG0Y .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-1kyYSvOKPxe7JG0Y .icon-shape .label rect,#mermaid-svg-1kyYSvOKPxe7JG0Y .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-1kyYSvOKPxe7JG0Y .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-1kyYSvOKPxe7JG0Y .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-1kyYSvOKPxe7JG0Y :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} Raw Data
Format Transform
Style Transform
Training Data


第四步:评分(Scoring)

最后一步:

质量评分。


评分维度通常包括:

指标 含义
Correctness 是否正确
Reasoning 推理质量
Helpfulness 是否有帮助
Safety 是否安全
Format 是否符合格式
Length 长度是否合理

例如:

text 复制代码
Correctness = 9
Reasoning = 8
Format = 10

综合:

text 复制代码
Score = 9.0

合成数据完整流程

#mermaid-svg-i1tvX01VAb6czaGw{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-i1tvX01VAb6czaGw .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-i1tvX01VAb6czaGw .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-i1tvX01VAb6czaGw .error-icon{fill:#552222;}#mermaid-svg-i1tvX01VAb6czaGw .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-i1tvX01VAb6czaGw .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-i1tvX01VAb6czaGw .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-i1tvX01VAb6czaGw .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-i1tvX01VAb6czaGw .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-i1tvX01VAb6czaGw .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-i1tvX01VAb6czaGw .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-i1tvX01VAb6czaGw .marker{fill:#333333;stroke:#333333;}#mermaid-svg-i1tvX01VAb6czaGw .marker.cross{stroke:#333333;}#mermaid-svg-i1tvX01VAb6czaGw svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-i1tvX01VAb6czaGw p{margin:0;}#mermaid-svg-i1tvX01VAb6czaGw .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-i1tvX01VAb6czaGw .cluster-label text{fill:#333;}#mermaid-svg-i1tvX01VAb6czaGw .cluster-label span{color:#333;}#mermaid-svg-i1tvX01VAb6czaGw .cluster-label span p{background-color:transparent;}#mermaid-svg-i1tvX01VAb6czaGw .label text,#mermaid-svg-i1tvX01VAb6czaGw span{fill:#333;color:#333;}#mermaid-svg-i1tvX01VAb6czaGw .node rect,#mermaid-svg-i1tvX01VAb6czaGw .node circle,#mermaid-svg-i1tvX01VAb6czaGw .node ellipse,#mermaid-svg-i1tvX01VAb6czaGw .node polygon,#mermaid-svg-i1tvX01VAb6czaGw .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-i1tvX01VAb6czaGw .rough-node .label text,#mermaid-svg-i1tvX01VAb6czaGw .node .label text,#mermaid-svg-i1tvX01VAb6czaGw .image-shape .label,#mermaid-svg-i1tvX01VAb6czaGw .icon-shape .label{text-anchor:middle;}#mermaid-svg-i1tvX01VAb6czaGw .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-i1tvX01VAb6czaGw .rough-node .label,#mermaid-svg-i1tvX01VAb6czaGw .node .label,#mermaid-svg-i1tvX01VAb6czaGw .image-shape .label,#mermaid-svg-i1tvX01VAb6czaGw .icon-shape .label{text-align:center;}#mermaid-svg-i1tvX01VAb6czaGw .node.clickable{cursor:pointer;}#mermaid-svg-i1tvX01VAb6czaGw .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-i1tvX01VAb6czaGw .arrowheadPath{fill:#333333;}#mermaid-svg-i1tvX01VAb6czaGw .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-i1tvX01VAb6czaGw .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-i1tvX01VAb6czaGw .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-i1tvX01VAb6czaGw .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-i1tvX01VAb6czaGw .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-i1tvX01VAb6czaGw .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-i1tvX01VAb6czaGw .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-i1tvX01VAb6czaGw .cluster text{fill:#333;}#mermaid-svg-i1tvX01VAb6czaGw .cluster span{color:#333;}#mermaid-svg-i1tvX01VAb6czaGw div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-i1tvX01VAb6czaGw .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-i1tvX01VAb6czaGw rect.text{fill:none;stroke-width:0;}#mermaid-svg-i1tvX01VAb6czaGw .icon-shape,#mermaid-svg-i1tvX01VAb6czaGw .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-i1tvX01VAb6czaGw .icon-shape p,#mermaid-svg-i1tvX01VAb6czaGw .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-i1tvX01VAb6czaGw .icon-shape .label rect,#mermaid-svg-i1tvX01VAb6czaGw .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-i1tvX01VAb6czaGw .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-i1tvX01VAb6czaGw .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-i1tvX01VAb6czaGw :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} Template
Generate
Filter
Transform
Score
Training Data


Constitutional AI(宪法AI)

Anthropic 提出了著名的:

text 复制代码
Constitutional AI

核心思想:

不依赖大量人工反馈,而是让AI根据一套规则自我监督。


第一阶段:基于宪法的SFT

首先由专家制定:

text 复制代码
Constitution

即:

  • 安全原则
  • 价值观
  • 行为规范

例如:

text 复制代码
不要鼓励违法行为

不要泄露隐私

保持诚实

流程:
#mermaid-svg-HUZrJkeardmEzTtI{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-HUZrJkeardmEzTtI .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-HUZrJkeardmEzTtI .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-HUZrJkeardmEzTtI .error-icon{fill:#552222;}#mermaid-svg-HUZrJkeardmEzTtI .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-HUZrJkeardmEzTtI .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-HUZrJkeardmEzTtI .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-HUZrJkeardmEzTtI .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-HUZrJkeardmEzTtI .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-HUZrJkeardmEzTtI .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-HUZrJkeardmEzTtI .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-HUZrJkeardmEzTtI .marker{fill:#333333;stroke:#333333;}#mermaid-svg-HUZrJkeardmEzTtI .marker.cross{stroke:#333333;}#mermaid-svg-HUZrJkeardmEzTtI svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-HUZrJkeardmEzTtI p{margin:0;}#mermaid-svg-HUZrJkeardmEzTtI .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-HUZrJkeardmEzTtI .cluster-label text{fill:#333;}#mermaid-svg-HUZrJkeardmEzTtI .cluster-label span{color:#333;}#mermaid-svg-HUZrJkeardmEzTtI .cluster-label span p{background-color:transparent;}#mermaid-svg-HUZrJkeardmEzTtI .label text,#mermaid-svg-HUZrJkeardmEzTtI span{fill:#333;color:#333;}#mermaid-svg-HUZrJkeardmEzTtI .node rect,#mermaid-svg-HUZrJkeardmEzTtI .node circle,#mermaid-svg-HUZrJkeardmEzTtI .node ellipse,#mermaid-svg-HUZrJkeardmEzTtI .node polygon,#mermaid-svg-HUZrJkeardmEzTtI .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-HUZrJkeardmEzTtI .rough-node .label text,#mermaid-svg-HUZrJkeardmEzTtI .node .label text,#mermaid-svg-HUZrJkeardmEzTtI .image-shape .label,#mermaid-svg-HUZrJkeardmEzTtI .icon-shape .label{text-anchor:middle;}#mermaid-svg-HUZrJkeardmEzTtI .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-HUZrJkeardmEzTtI .rough-node .label,#mermaid-svg-HUZrJkeardmEzTtI .node .label,#mermaid-svg-HUZrJkeardmEzTtI .image-shape .label,#mermaid-svg-HUZrJkeardmEzTtI .icon-shape .label{text-align:center;}#mermaid-svg-HUZrJkeardmEzTtI .node.clickable{cursor:pointer;}#mermaid-svg-HUZrJkeardmEzTtI .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-HUZrJkeardmEzTtI .arrowheadPath{fill:#333333;}#mermaid-svg-HUZrJkeardmEzTtI .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-HUZrJkeardmEzTtI .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-HUZrJkeardmEzTtI .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-HUZrJkeardmEzTtI .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-HUZrJkeardmEzTtI .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-HUZrJkeardmEzTtI .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-HUZrJkeardmEzTtI .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-HUZrJkeardmEzTtI .cluster text{fill:#333;}#mermaid-svg-HUZrJkeardmEzTtI .cluster span{color:#333;}#mermaid-svg-HUZrJkeardmEzTtI div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-HUZrJkeardmEzTtI .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-HUZrJkeardmEzTtI rect.text{fill:none;stroke-width:0;}#mermaid-svg-HUZrJkeardmEzTtI .icon-shape,#mermaid-svg-HUZrJkeardmEzTtI .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-HUZrJkeardmEzTtI .icon-shape p,#mermaid-svg-HUZrJkeardmEzTtI .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-HUZrJkeardmEzTtI .icon-shape .label rect,#mermaid-svg-HUZrJkeardmEzTtI .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-HUZrJkeardmEzTtI .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-HUZrJkeardmEzTtI .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-HUZrJkeardmEzTtI :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 编写宪法
基础模型生成回答
AI批判回答
AI修正回答
SFT训练
Fine-tuned Model


第二阶段:RLAIF

RLAIF:

text 复制代码
Reinforcement Learning from AI Feedback

即:

AI反馈强化学习。


不再依赖人工排序。

而是:

AI自己比较。


流程:
#mermaid-svg-KGFnuNTULQgb6tl4{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-KGFnuNTULQgb6tl4 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-KGFnuNTULQgb6tl4 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-KGFnuNTULQgb6tl4 .error-icon{fill:#552222;}#mermaid-svg-KGFnuNTULQgb6tl4 .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-KGFnuNTULQgb6tl4 .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-KGFnuNTULQgb6tl4 .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-KGFnuNTULQgb6tl4 .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-KGFnuNTULQgb6tl4 .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-KGFnuNTULQgb6tl4 .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-KGFnuNTULQgb6tl4 .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-KGFnuNTULQgb6tl4 .marker{fill:#333333;stroke:#333333;}#mermaid-svg-KGFnuNTULQgb6tl4 .marker.cross{stroke:#333333;}#mermaid-svg-KGFnuNTULQgb6tl4 svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-KGFnuNTULQgb6tl4 p{margin:0;}#mermaid-svg-KGFnuNTULQgb6tl4 .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-KGFnuNTULQgb6tl4 .cluster-label text{fill:#333;}#mermaid-svg-KGFnuNTULQgb6tl4 .cluster-label span{color:#333;}#mermaid-svg-KGFnuNTULQgb6tl4 .cluster-label span p{background-color:transparent;}#mermaid-svg-KGFnuNTULQgb6tl4 .label text,#mermaid-svg-KGFnuNTULQgb6tl4 span{fill:#333;color:#333;}#mermaid-svg-KGFnuNTULQgb6tl4 .node rect,#mermaid-svg-KGFnuNTULQgb6tl4 .node circle,#mermaid-svg-KGFnuNTULQgb6tl4 .node ellipse,#mermaid-svg-KGFnuNTULQgb6tl4 .node polygon,#mermaid-svg-KGFnuNTULQgb6tl4 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-KGFnuNTULQgb6tl4 .rough-node .label text,#mermaid-svg-KGFnuNTULQgb6tl4 .node .label text,#mermaid-svg-KGFnuNTULQgb6tl4 .image-shape .label,#mermaid-svg-KGFnuNTULQgb6tl4 .icon-shape .label{text-anchor:middle;}#mermaid-svg-KGFnuNTULQgb6tl4 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-KGFnuNTULQgb6tl4 .rough-node .label,#mermaid-svg-KGFnuNTULQgb6tl4 .node .label,#mermaid-svg-KGFnuNTULQgb6tl4 .image-shape .label,#mermaid-svg-KGFnuNTULQgb6tl4 .icon-shape .label{text-align:center;}#mermaid-svg-KGFnuNTULQgb6tl4 .node.clickable{cursor:pointer;}#mermaid-svg-KGFnuNTULQgb6tl4 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-KGFnuNTULQgb6tl4 .arrowheadPath{fill:#333333;}#mermaid-svg-KGFnuNTULQgb6tl4 .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-KGFnuNTULQgb6tl4 .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-KGFnuNTULQgb6tl4 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-KGFnuNTULQgb6tl4 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-KGFnuNTULQgb6tl4 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-KGFnuNTULQgb6tl4 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-KGFnuNTULQgb6tl4 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-KGFnuNTULQgb6tl4 .cluster text{fill:#333;}#mermaid-svg-KGFnuNTULQgb6tl4 .cluster span{color:#333;}#mermaid-svg-KGFnuNTULQgb6tl4 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-KGFnuNTULQgb6tl4 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-KGFnuNTULQgb6tl4 rect.text{fill:none;stroke-width:0;}#mermaid-svg-KGFnuNTULQgb6tl4 .icon-shape,#mermaid-svg-KGFnuNTULQgb6tl4 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-KGFnuNTULQgb6tl4 .icon-shape p,#mermaid-svg-KGFnuNTULQgb6tl4 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-KGFnuNTULQgb6tl4 .icon-shape .label rect,#mermaid-svg-KGFnuNTULQgb6tl4 .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-KGFnuNTULQgb6tl4 .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-KGFnuNTULQgb6tl4 .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-KGFnuNTULQgb6tl4 :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} Prompt
生成回答A
生成回答B
AI评审
Preference Data
Reward Model
RL训练
Aligned Model


数据比例的重要性

很多训练失败原因:

不是数据太少。

而是:

text 复制代码
数据配比错误

一个错误案例

训练:

text 复制代码
90% 编程

10% 其它

结果:

text 复制代码
代码能力很强

但:

text 复制代码
聊天能力下降

能力遗忘问题

例如:

微积分助手。

训练后:

text 复制代码
微积分:95分

但是:

text 复制代码
历史:20分
写作:10分
聊天:0分

这称为:

text 复制代码
Catastrophic Forgetting
灾难性遗忘

一个更合理的数据比例

例如通用助手:

类型 比例
通用对话 60%
专业任务 30%
安全数据 10%

注意:

这只是经验值。

并不存在万能比例。


如何确定比例

最佳实践:
#mermaid-svg-6QCGjbblRKbhTsE3{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-6QCGjbblRKbhTsE3 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-6QCGjbblRKbhTsE3 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-6QCGjbblRKbhTsE3 .error-icon{fill:#552222;}#mermaid-svg-6QCGjbblRKbhTsE3 .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-6QCGjbblRKbhTsE3 .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-6QCGjbblRKbhTsE3 .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-6QCGjbblRKbhTsE3 .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-6QCGjbblRKbhTsE3 .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-6QCGjbblRKbhTsE3 .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-6QCGjbblRKbhTsE3 .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-6QCGjbblRKbhTsE3 .marker{fill:#333333;stroke:#333333;}#mermaid-svg-6QCGjbblRKbhTsE3 .marker.cross{stroke:#333333;}#mermaid-svg-6QCGjbblRKbhTsE3 svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-6QCGjbblRKbhTsE3 p{margin:0;}#mermaid-svg-6QCGjbblRKbhTsE3 .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-6QCGjbblRKbhTsE3 .cluster-label text{fill:#333;}#mermaid-svg-6QCGjbblRKbhTsE3 .cluster-label span{color:#333;}#mermaid-svg-6QCGjbblRKbhTsE3 .cluster-label span p{background-color:transparent;}#mermaid-svg-6QCGjbblRKbhTsE3 .label text,#mermaid-svg-6QCGjbblRKbhTsE3 span{fill:#333;color:#333;}#mermaid-svg-6QCGjbblRKbhTsE3 .node rect,#mermaid-svg-6QCGjbblRKbhTsE3 .node circle,#mermaid-svg-6QCGjbblRKbhTsE3 .node ellipse,#mermaid-svg-6QCGjbblRKbhTsE3 .node polygon,#mermaid-svg-6QCGjbblRKbhTsE3 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-6QCGjbblRKbhTsE3 .rough-node .label text,#mermaid-svg-6QCGjbblRKbhTsE3 .node .label text,#mermaid-svg-6QCGjbblRKbhTsE3 .image-shape .label,#mermaid-svg-6QCGjbblRKbhTsE3 .icon-shape .label{text-anchor:middle;}#mermaid-svg-6QCGjbblRKbhTsE3 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-6QCGjbblRKbhTsE3 .rough-node .label,#mermaid-svg-6QCGjbblRKbhTsE3 .node .label,#mermaid-svg-6QCGjbblRKbhTsE3 .image-shape .label,#mermaid-svg-6QCGjbblRKbhTsE3 .icon-shape .label{text-align:center;}#mermaid-svg-6QCGjbblRKbhTsE3 .node.clickable{cursor:pointer;}#mermaid-svg-6QCGjbblRKbhTsE3 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-6QCGjbblRKbhTsE3 .arrowheadPath{fill:#333333;}#mermaid-svg-6QCGjbblRKbhTsE3 .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-6QCGjbblRKbhTsE3 .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-6QCGjbblRKbhTsE3 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-6QCGjbblRKbhTsE3 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-6QCGjbblRKbhTsE3 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-6QCGjbblRKbhTsE3 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-6QCGjbblRKbhTsE3 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-6QCGjbblRKbhTsE3 .cluster text{fill:#333;}#mermaid-svg-6QCGjbblRKbhTsE3 .cluster span{color:#333;}#mermaid-svg-6QCGjbblRKbhTsE3 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-6QCGjbblRKbhTsE3 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-6QCGjbblRKbhTsE3 rect.text{fill:none;stroke-width:0;}#mermaid-svg-6QCGjbblRKbhTsE3 .icon-shape,#mermaid-svg-6QCGjbblRKbhTsE3 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-6QCGjbblRKbhTsE3 .icon-shape p,#mermaid-svg-6QCGjbblRKbhTsE3 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-6QCGjbblRKbhTsE3 .icon-shape .label rect,#mermaid-svg-6QCGjbblRKbhTsE3 .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-6QCGjbblRKbhTsE3 .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-6QCGjbblRKbhTsE3 .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-6QCGjbblRKbhTsE3 :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 小规模训练
评估
误差分析
调整比例
重新训练

而不是:

text 复制代码
一次训练100万条

奖励函数也需要平衡

奖励并不是单一指标。

通常是多个目标组合。

例如:

text 复制代码
Reward

=
0.4 × Helpfulness
+
0.4 × Safety
+
0.2 × Truthfulness

奖励冲突问题

模型经常面临:

text 复制代码
简洁
VS
完整

例如:

回答:

text 复制代码
是。

很简洁。

但毫无帮助。


回答:

text 复制代码
5000字长文

很完整。

但用户不想看。


因此需要:

text 复制代码
奖励上限
长度约束
多目标优化

共同控制。


训练通用能力还是专业能力?

这是所有后训练项目都会面对的问题:

text 复制代码
能力增强
VS
能力保留

例如:

训练一个微积分模型。

目标:

text 复制代码
微积分能力 ↑

但同时希望:

text 复制代码
聊天能力保留
数学其它领域保留
代码能力保留

因此现代训练通常采用:
#mermaid-svg-wZcYDDK9sNwmMUGk{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-wZcYDDK9sNwmMUGk .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-wZcYDDK9sNwmMUGk .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-wZcYDDK9sNwmMUGk .error-icon{fill:#552222;}#mermaid-svg-wZcYDDK9sNwmMUGk .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-wZcYDDK9sNwmMUGk .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-wZcYDDK9sNwmMUGk .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-wZcYDDK9sNwmMUGk .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-wZcYDDK9sNwmMUGk .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-wZcYDDK9sNwmMUGk .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-wZcYDDK9sNwmMUGk .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-wZcYDDK9sNwmMUGk .marker{fill:#333333;stroke:#333333;}#mermaid-svg-wZcYDDK9sNwmMUGk .marker.cross{stroke:#333333;}#mermaid-svg-wZcYDDK9sNwmMUGk svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-wZcYDDK9sNwmMUGk p{margin:0;}#mermaid-svg-wZcYDDK9sNwmMUGk .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-wZcYDDK9sNwmMUGk .cluster-label text{fill:#333;}#mermaid-svg-wZcYDDK9sNwmMUGk .cluster-label span{color:#333;}#mermaid-svg-wZcYDDK9sNwmMUGk .cluster-label span p{background-color:transparent;}#mermaid-svg-wZcYDDK9sNwmMUGk .label text,#mermaid-svg-wZcYDDK9sNwmMUGk span{fill:#333;color:#333;}#mermaid-svg-wZcYDDK9sNwmMUGk .node rect,#mermaid-svg-wZcYDDK9sNwmMUGk .node circle,#mermaid-svg-wZcYDDK9sNwmMUGk .node ellipse,#mermaid-svg-wZcYDDK9sNwmMUGk .node polygon,#mermaid-svg-wZcYDDK9sNwmMUGk .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-wZcYDDK9sNwmMUGk .rough-node .label text,#mermaid-svg-wZcYDDK9sNwmMUGk .node .label text,#mermaid-svg-wZcYDDK9sNwmMUGk .image-shape .label,#mermaid-svg-wZcYDDK9sNwmMUGk .icon-shape .label{text-anchor:middle;}#mermaid-svg-wZcYDDK9sNwmMUGk .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-wZcYDDK9sNwmMUGk .rough-node .label,#mermaid-svg-wZcYDDK9sNwmMUGk .node .label,#mermaid-svg-wZcYDDK9sNwmMUGk .image-shape .label,#mermaid-svg-wZcYDDK9sNwmMUGk .icon-shape .label{text-align:center;}#mermaid-svg-wZcYDDK9sNwmMUGk .node.clickable{cursor:pointer;}#mermaid-svg-wZcYDDK9sNwmMUGk .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-wZcYDDK9sNwmMUGk .arrowheadPath{fill:#333333;}#mermaid-svg-wZcYDDK9sNwmMUGk .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-wZcYDDK9sNwmMUGk .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-wZcYDDK9sNwmMUGk .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-wZcYDDK9sNwmMUGk .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-wZcYDDK9sNwmMUGk .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-wZcYDDK9sNwmMUGk .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-wZcYDDK9sNwmMUGk .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-wZcYDDK9sNwmMUGk .cluster text{fill:#333;}#mermaid-svg-wZcYDDK9sNwmMUGk .cluster span{color:#333;}#mermaid-svg-wZcYDDK9sNwmMUGk div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-wZcYDDK9sNwmMUGk .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-wZcYDDK9sNwmMUGk rect.text{fill:none;stroke-width:0;}#mermaid-svg-wZcYDDK9sNwmMUGk .icon-shape,#mermaid-svg-wZcYDDK9sNwmMUGk .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-wZcYDDK9sNwmMUGk .icon-shape p,#mermaid-svg-wZcYDDK9sNwmMUGk .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-wZcYDDK9sNwmMUGk .icon-shape .label rect,#mermaid-svg-wZcYDDK9sNwmMUGk .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-wZcYDDK9sNwmMUGk .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-wZcYDDK9sNwmMUGk .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-wZcYDDK9sNwmMUGk :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 专业数据
混合训练
通用数据
评估
能力保持检查


总结

合成数据已经成为现代大模型训练的核心基础设施。

完整流程通常为:

text 复制代码
Generate
→ Filter
→ Transform
→ Score
→ Train

而在模型对齐中,Anthropic 的 Constitutional AI 和 RLAIF 展示了一条重要路线:

用 AI 生成数据、AI 评审数据、AI 训练奖励模型,再通过 RL 完成对齐。

最终决定模型质量的往往不是数据量,而是:

数据质量、数据配比、奖励设计以及是否保留原有通用能力。

相关推荐
会飞锦鲤1 小时前
基于YOLOv10的瓜果成熟度智能检测系统
人工智能·python·深度学习·yolo·flask
一键生成网站1 小时前
AI产品原型工具高保真复杂交互场景深度对比与选型指南
人工智能·交互·
larance1 小时前
机器学习特征预处理之序号编码
人工智能·深度学习·机器学习
SNKXD_11 小时前
企业如何选AI数字人系统?2026年深度评测与选型方案
大数据·人工智能
cyforkk1 小时前
架构设计中的无用之用:拆解 lambda state: state 与同步屏障
人工智能
水如烟1 小时前
孤能子视角:异质压力测试法应用到企业、大模型市场竞争
人工智能
hey you~1 小时前
2026年北上广深呼叫中心系统现状:AI Agent落地一年后,技术栈被重构了吗?
大数据·人工智能·ai agent·高并发架构·呼叫中心系统·asr优化·北上广深
一次旅行2 小时前
【AI技术_工具】用 MCP 把本地工具接入 Claude_Cursor,让 AI 真正摸到你的数据
大数据·人工智能·python
ws2019072 小时前
从零件到核心:AUTO TECH China 2026广州汽车零部件展的产业新叙事
大数据·人工智能·科技·汽车