Lecture 6 - Model Training

Lecture 6 - Model Training

训练目标与 Timestep

第 5 讲打开了 generation model 的 architecture black box:从 U-Net 到 DiT,再到 MM-DiT。第 6 讲进一步回答一个更实际的问题:

课程先明确范围:本讲聚焦 image generation model 本身,即负责预测 noise、score 或 velocity 的 backbone;VAE 和 text/image embedding model 只作为已存在的组件,下周再深入 multimodal LLM 与 embedding model。

整个训练生命周期可以画成:

Training loss
      |
      v
Pre-training  ->  学会生成图像
      |
      v
Post-training ->  学会生成“好”的图像
      |
      v
Tuning        ->  适配特定主体或场景
      |
      v
Distillation  ->  在更少采样步数下保持质量

第 6 讲的四阶段训练生命周期

四阶段的目标不同:

阶段 要解决的问题 典型方法
Pre-training 模型能不能生成图像? Flow Matching / diffusion objective、数据配方、REPA、curriculum
Post-training 模型生成的图像是否符合质量与人类偏好? Continued Training、SFT、ReFL、Flow-GRPO、Diffusion-DPO、Prompt Enhancement
Tuning 能否生成某个特定人物、物体或风格? DreamBooth、Prior Preservation、LoRA
Distillation 能否把多步采样压缩成少步甚至一步? Progressive Distillation、InstaFlow、Consistency、DMD、ADD、LADD

课程反复强调:“能生成”与“生成得好”不是同一个训练目标;“生成得好”与“生成得快”也不是同一个目标。


训练 loss 仍然是前三讲的那些吗?

三种视角最终可以落到同一类回归问题

Lecture 1 的 DDPM 预测噪声:

formula

Lecture 2 的 Score Matching 预测 score:

formula

Lecture 3 的 Flow Matching 预测 velocity field。课程从本讲开始默认采用 flow-matching perspective:

formula

其中 formula 来自 noise distribution,formula 来自 data distribution。对应的 conditional flow target 为:

formula

训练目标是:

formula

课件中的 Flow Matching objective 与 noise / in-between / clean 状态

这里的选择主要是为了课堂统一,并不表示真实系统只能预测 velocity。只要采样器与 parameterization 一致,noise、score、velocity 都可以作为模型输出。

关键变化不是目标形式,而是训练分布

在理论推导里,常写成:

formula

但工程训练时,真正需要优化的是:

formula

其中 formula 不一定是 uniform distribution。课程接下来就是解释为什么要改变它。


为什么中间 timestep 是最难的?

本讲采用 flow-matching 的时间方向:

  • formula:接近 noise;
  • formula:接近 clean image;
  • formula:处于 in-between 状态。

纯噪声端反而是容易任务

当 formula 接近 0 时,输入几乎没有关于目标图像的信息。模型无法知道这次要生成泰迪熊、汽车还是风景,于是 MSE 训练会鼓励它预测数据分布的平均方向。

这不是好图像所需的细节,但从回归角度看任务很容易:模型只需学一个粗略的 mean direction。

近干净端也不难

当 formula 接近 1 时,formula 已经几乎是一张 clean image。模型只需修正少量 texture、edge 或局部结构,因此也是相对容易的局部修补任务。

中间区域包含最多不确定性

当 formula 位于中间区域,模型已经看见一些 global structure,但仍要决定:

  • 物体的姿态和部件怎样摆放;
  • 眼睛、手、书等局部结构放在哪里;
  • 纹理、材质和颜色怎样展开;
  • 当前状态究竟应该沿哪条路径走向某个 valid image。

这时模型面临的是 多模态、信息不完整、方向不唯一 的预测问题,通常也是最难学的区域。

采样策略:Logit-Normal Timestep

如果训练时均匀采样 formula,那么简单任务和困难任务被分配了相近的训练频率。课程的做法是让时间步更多集中在中间区域。

先定义:

formula

令 logit space 中的变量服从 Gaussian,再通过 sigmoid 映射回 formula,得到 logit-normal distribution:

formula

其中 formula 控制分布中心,formula 控制宽度。通过调节二者,可以强调中间 timestep,或在特定任务中偏向早期或晚期 timestep。

Logit-Normal timestep distribution:把训练重点放在更困难的中间区域

为什么不直接对 formula 使用 Gaussian?因为 Gaussian 的取值范围是整个实数轴,而 timestep 必须位于 formula;先在 logit space 采样,再用 sigmoid 映射可以保证范围合法。


为什么不同分辨率需要不同 timestep?

数值噪声不等于感知噪声

同一张图在低分辨率和高分辨率下加入相同数值强度的噪声,人眼感受到的“脏乱程度”并不相同。

低分辨率图像每个 pixel 承担的信息更多,局部噪声更容易破坏整体结构;高分辨率图像拥有更多 pixels,单个 pixel 的扰动会被更大范围的结构平均掉。因此在不同 resolution 下,相同 formula 不代表相同的 learning difficulty。

Resolution-aware Timestep Shift

课件给出一种基于分辨率比例的 shift。设低分辨率为 formula,高分辨率为 formula,并记原始 timestep 为 formula,则可以用:

formula

在本课引用的论文约定中,formula 是 clean,formula 是 noise;这是与前面 flow-matching 课堂约定相反的方向,使用公式时必须先确认时间方向。

这个变换的目的不是改变生成语义,而是让不同 resolution 下的 perceived noise / uncertainty 尽量对齐。

不同 resolution 下的 timestep shift

对 DiT 的含义

DiT 把 latent 切成 patches。分辨率提高后,patch 数和 token 数增加,模型看到的 context 更长;如果 timestep 仍按同一数值解释,训练任务的难度会发生系统偏移。

因此,现代高分辨率训练通常需要联合考虑:

  • timestep distribution;
  • image resolution;
  • aspect ratio;
  • patch token 数;
  • attention compute。

Pre-training

训练从零开始的问题

Generation model 的 backbone 需要同时学会:

  • 视觉语义表示;
  • 去噪或 transport dynamics;
  • condition interaction;
  • 局部纹理和图像细节。

仅依赖最终的 flow-matching regression,模型需要自己摸索这些中间 representation。尤其对大 DiT,早期训练可能非常昂贵。

Representation Alignment

REPA(REPresentation Alignment)的想法是:借用一个已经训练好的 image encoder 所学到的 representation,作为额外的学习信号。

设 generation Transformer 某一层、某个 patch 的 hidden representation 为 formula,预训练 encoder 对对应 clean image patch 的表示为 formula。用可训练 projection head formula 把生成模型表示映射到同一空间,并最大化 cosine similarity:

formula

总损失可以写成:

formula

REPA loss:预训练 clean-image representation 与生成 Transformer hidden representation 对齐

为什么对齐早期层更有效?

课程给出的直觉是:

  • Transformer 早期层更可能携带 semantic / global representation;
  • 后期层更接近最终 velocity output,可能更偏向 local details 与 task-specific correction;
  • 因此,把早期 hidden states 对齐到语义 encoder,往往比对齐最后一层更合适。

REPA 的实证结论包括:

  1. 可以显著加快达到同等质量所需的训练过程;
  2. 对较大的 diffusion model,收益更明显;
  3. 对齐层和 encoder 的选择需要通过 ablation 验证,不能机械地固定最后一层。

这里的核心不是“把两个模型完全合并”,而是给 generation model 一本已经写好的 representation textbook,使它更快获得有用的视觉语义结构。


Pre-training 阶段究竟在教什么?

目标:先学会生成,不急于追求完美

Pre-training 的目标是让模型掌握 broad image distribution:

formula

此时重点不是让每张图都符合人类审美,而是建立足够广泛的 image prior、composition 能力和 condition-to-image 基础映射。

Data Mixture 是高成本工程

课件用 Qwen-Image technical report 说明,预训练数据管线通常包含:

  • 不同来源和类型的 image-text pairs;
  • 图像质量过滤;
  • 去重和安全过滤;
  • caption 清洗与重写;
  • 不同 resolution、aspect ratio 的混合;
  • 复杂度不同的 prompt mixture。

因此,大模型训练的关键问题不只是“有多少张图”,还包括数据如何被筛选、配比和调度。

Curriculum Learning:先简单,后复杂

课程学习按照任务难度逐步增加:

Easy curriculum:

  • low-resolution images;
  • fixed square aspect ratio;
  • simple and short prompts,例如 a teddy bear。

Hard curriculum:

  • high-resolution images;
  • variable aspect ratios;
  • complex prompts,包含对象关系、材质、光照、环境和构图约束。

Curriculum learning:从低分辨率、固定方形和短 prompt 逐步过渡到高分辨率、可变宽高比和复杂 prompt

不同分辨率如何进入同一个 DiT?

DiT 的 patchify 给出自然答案。若 latent 的空间大小是 formula,patch size 是 formula,token 数约为:

formula

低分辨率对应较短 sequence,高分辨率对应较长 sequence;同一 Transformer 可以处理不同数量的 tokens,前提是 position encoding、attention memory 与 batch 组织方式支持这种变化。


Post-training 与偏好优化

Pre-training 后的模型已经能生成各种图像,但“好”包含多个维度:knowledge、aesthetics、lighting、instruction following、prompt adherence 与 human preference。课程把 post-training 分成三类。

Continued Training:补充知识

Continued Training(CT)使用新的数据继续训练原模型,重点是扩大或修正 model knowledge。

例子:模型已经见过自然图像和汽车,但目标任务特别关心 teddy bear、医学图像或某类设计风格,就可以在相关数据上继续训练。

它更像给模型增加新知识,而不是重新定义“什么样的图像才算好看”。

Supervised Fine-Tuning:改变行为

Supervised Fine-Tuning(SFT)通常使用质量更高、标注更精细的数据,让模型学习:

  • 更好的 lighting;
  • 更稳定的 aesthetics;
  • 更准确的 instruction following;
  • 更好的 text-image alignment;
  • 更符合目标产品的输出格式。

一个实用区分是:

Continued Training = 教模型更多“内容”
Supervised Fine-Tuning = 教模型用什么“方式”表达内容

Continued Training 与 Supervised Fine-Tuning 的知识/行为区分

Preference Tuning:不仅教模型做什么,也教它不要做什么

SFT 主要提供“正确示范”。但对于同一 prompt,可能有两张都合理的图,其中一张在人类看来更美、更清晰、更符合指令。

Preference tuning 使用 pairwise 或 listwise comparison:

formula

目标是提高 preferred image 的概率,降低 less-preferred image 的概率。偏好信号可以来自:

  • human ratings;
  • learned reward model;
  • image-text alignment score;
  • aesthetics、safety、OCR 或其他自动评价器。

三类 Preference Tuning 方法怎样理解?

Reward Feedback Learning(ReFL)

ReFL 的思路是先训练或使用一个 reward model,对生成结果给出可微或近似可微的质量分数:

formula

然后把 reward 作为信号反向传给 generation model,使模型更倾向于产生高 reward 图像。

关键分工是:

Image generator -> 生成候选图像
Reward model   -> 判断图像有多符合偏好
Gradient / update -> 提高高 reward 输出的概率

风险是 reward model 只是偏好的 proxy。如果模型过度优化它,可能出现 reward hacking:评分变高,但真实人类并不觉得结果更好。

Flow-GRPO:把在线 RL 思路带入 Flow Matching

Flow-Group Reward Policy Optimization(Flow-GRPO)把生成过程看成 policy,针对一组由同一 prompt 生成的图像计算相对 reward。

设一组样本的 reward 为 formula,可以用组内相对优势表示:

formula

再根据 advantage 更新 flow policy。组内比较的好处是减少对 reward 绝对尺度的依赖,但仍需处理:

  • reward model 偏差;
  • policy 更新过大;
  • 采样成本;
  • reward hacking。

Diffusion-DPO:直接使用偏好对

DPO(Direct Preference Optimization)在 LLM 中使用 preferred/rejected pair 直接优化 policy 与 reference policy 的相对概率,不必单独训练 RL reward model。Diffusion-DPO 将同样的思想改写为 diffusion/flow 的 velocity prediction。

课件中的 velocity-error 形式可以概念化为:

formula
formula

一个常见的 logistic preference objective 为:

formula

直觉上:

  • policy model 应更偏向 win image;
  • reference model 提供稳定基准;
  • formula 控制偏好更新强度。

Diffusion-DPO 的课件公式:用 win/lose velocity error 的相对差异优化偏好

Prompt Enhancement:不改权重也可以改变输入分布

用户常输入短 prompt,例如:

a teddy bear reading a book

但模型可能在复杂、长、描述性强的 caption 上训练。Prompt Enhancement 用一个语言模型或专门的 prompt rewriter,把用户输入扩展成更详细、更加 in-distribution 的 prompt,再交给图像生成模型。

它的作用不是更新 generation model,而是减少:

用户自然语言输入分布 != 模型训练时的 caption 分布

这是一种 inference-time alignment,成本低,但会引入 prompt 改写偏差和额外语言模型延迟。


个性化 Tuning

DreamBooth:用少量图像绑定稀有 token

假设用户不是要“任意一只 teddy bear”,而是要某一只特定的 teddy bear。DreamBooth 的典型流程是:

  1. 收集同一主体在不同 pose、视角和场景下的少量图片;
  2. 为主体分配一个 rare token,例如 [V];
  3. 用“[V] teddy bear”等 prompt 训练模型;
  4. 让模型把 rare token 与特定主体的 appearance 绑定;
  5. 推理时用该 token 在新场景中生成主体。

DreamBooth:用 rare token 绑定特定 teddy bear

Prior Preservation:避免过拟合和遗忘

只用几张主体图片训练,很容易出现:

  • 过拟合训练姿势和背景;
  • 主体 token 只能生成原始构图;
  • 模型忘记原本对“teddy bear”这一类概念的通用能力。

因此加入 prior preservation loss。概念上:

formula

第一项保证模型记住特定主体;第二项用原模型能够生成的 class images 保持一般概念能力。

LoRA:只训练低秩增量

完整更新 billions of parameters 成本很高。LoRA 将冻结的 base weight formula 与低秩增量相加:

formula

其中:

formula

训练时只更新 formula、formula,推理时可以将增量合并或作为 adapter 加载。

LoRA:用两个低秩矩阵近似权重更新

优点:

  • trainable parameter 大幅减少;
  • 显存和训练时间降低;
  • 可以为不同主体、风格、任务保存不同 adapter。

缺点:

  • 每个特殊主体仍需要一次 tuning;
  • 很多主体对应很多 adapters,部署管理复杂;
  • 低秩假设可能限制可表达的变化。

因此 DreamBooth + LoRA 适合“需要生成大量某一个特定主体图像”的场景,而不适合为无数特殊 case 都单独训练。


Distillation

生产环境的真正瓶颈

高质量 diffusion/flow model 通常需要多次 function evaluations(NFEs):

formula

每个 step 都要执行一次大模型 forward。高并发服务、实时交互、动画生成和普通用户设备都关心:

  • inference latency;
  • GPU cost;
  • energy consumption;
  • throughput。

因此 distillation 的目标不是把 teacher 的 parameter count 简单压小,而是让 student 用更少的 sampling steps 近似 teacher 的多步 trajectory。

Teacher 与 Student

传统 distillation 常见的是大 teacher 与小 student。但图像生成中的重要旋钮经常是 sampling step count:

Teacher: many function evaluations
Student: few evaluations, ideally one

简单地让 student 一步回归 teacher 的最终输出通常太难:teacher 用很多小步完成的复杂轨迹,student 必须在一个 forward 中压缩所有变化。


Progressive Distillation 如何逐步减半?

核心思想

Progressive Distillation(PD)不要求 student 一次学会从 noise 直达 clean image,而是:

  1. teacher 用两步完成一个较大的 transition;
  2. student 学习直接拟合这两步的合成结果;
  3. 得到的新 student 作为下一轮 teacher;
  4. 继续把步数减半。

如果初始步数是 formula,经过约 formula 轮,可以逐渐变成 formula 步。

Progressive Distillation:teacher 的多步 transition 由 student 逐轮压缩

为什么逐步减半更容易?

每一轮只要求 student 学一个相对局部、难度可控的 transition,而不是一次拟合整条复杂路径。它类似让学生先学会“每两笔合成一笔”,不断迭代后再得到一笔完成的能力。

优势与限制

优势:

  • 可在 quality 与 NFEs 之间提供多个 operating points;
  • 相同步数下可能优于直接使用 DDIM 等 baseline;
  • 训练目标直观,容易与现有 teacher sampler 对接。

限制:

  • 需要多轮 distillation;
  • 依赖离散、固定的 inference schedule;
  • 原始 curved path 仍然存在,student 只是绕开它,而没有真正简化 transport geometry。

这引出下一个问题:能不能先把 path 变直,再 distill?


InstaFlow 为什么先 Reflow 再 Distill?

Reflow 先把 transport path 拉直

Lecture 3 的 rectified flow / reflow 通过重新配对 noise 与 data,并用 ODE 生成新的 input-output pairs,训练出更直的 transport path。

直线路径的好处是:Euler integration 用更少步数也能接近目标。

InstaFlow 的流程

InstaFlow 可以概括为:

pretrained flow model
        |
        v
reflow:得到更直的 path
        |
        v
distillation:把 N-step teacher 压成 one-step student

teacher 与 student 的距离可以分阶段优化:

  • warm-up 使用 MSE,稳定训练;
  • polish 使用 LPIPS,更关注 perceptual similarity,而非逐 pixel 相等。

为什么不无限增加 Reflow 次数?

每次 reflow 都需要先用 ODE 生成 pairs,计算成本高;过多离散积分还会把 discretization error 写入训练 pairs。课程强调,第一次 reflow 往往带来最大收益,继续 reflow 的边际收益会下降。

InstaFlow 的核心洞见是:先改善 teacher 所教的路径,再要求 student 压缩它。


Consistency Models 怎样直接预测终点?

Self-Consistency Property

如果沿一条 deterministic ODE path 从 noise 走向 data,那么同一路径上的任意点理论上都对应同一个最终 clean image。Consistency Model 学习映射:

formula

因此无论从路径上的哪个 formula 出发,都应得到相同的终点预测:

formula

Consistency Training:路径上两个噪声程度不同的点应预测到相同终点

Consistency Training 与 Consistency Distillation

Consistency Training(CT):

  1. 从 clean image 构造两个相邻 noise levels;
  2. 分别输入同一个 model;
  3. 让两次 clean-image prediction 一致。

Consistency Distillation(CD):

  1. 使用 pretrained teacher 负责确定 ODE path 或 denoising transition;
  2. student 在不同 points 上预测终点;
  3. 用 teacher/student 的结果构造 consistency target。

如何避免 representation collapse?

如果只要求两个输出相等,常数输出(例如永远输出 0)也能得到低 consistency loss。课程强调两个稳定机制:

  • boundary condition / parameterization 让模型在终点附近必须表达合理 image;
  • stop-gradient 与 slow-moving average teacher,避免两个网络同时追逐彼此导致对称塌缩。

局限:Regression to the Mean

Consistency loss 常带有 L2 regression 性质。当多个真实图像都合理时,均值回归会导致:

  • 细节被平均;
  • texture 变平滑;
  • 输出不够 crisp;
  • pixel-level mismatch 惩罚了“语义正确但像素不同”的结果。

因此课程从 sample matching 转向 distribution matching。


Distribution Matching Distillation 如何匹配分布?

从样本距离到分布距离

Consistency / progressive distillation 常要求某个 student sample 接近某个 teacher target。Distribution Matching Distillation(DMD)改为:

理想目标可写成:

formula

但 teacher distribution 通常不可直接计算,真实 score 也不可得。

Teacher Advice 与 Student Advice

DMD 用额外的 diffusion models 估计:

  • teacher distribution 的 score / velocity advice;
  • student distribution 的 score / velocity advice。

梯度的直觉是:

formula

也就是:

更接近 teacher advice
更少遵循 student 当前造成的错误方向

DMD 的 KL gradient:由 teacher / student score 差异指导生成器

为什么 DMD 昂贵?

课程提出三个问题:

  1. teacher output 不是 ground truth,只是一个复杂 teacher 的建议;
  2. distillation loop 内又嵌入 diffusion training loop;
  3. teacher model 与 student model 可能计算相似的东西,成本接近重复训练。

因此 DMD 的方向更接近真实 distribution,但训练复杂度很高,且 score difference 对 student 来说仍然是较软的信号。


Adversarial Diffusion Distillation 怎样提供更硬的信号?

ADD:把分布匹配重新表述为分类

Adversarial Diffusion Distillation(ADD)借鉴 GAN,引入 discriminator / detector 区分:

  • teacher-generated 或 real-like representation;
  • student-generated representation。

整体目标可以抽象为:

formula

其中:

  • formula 保留 teacher 的 guidance;
  • formula 让 student output 更像 real / teacher distribution,并推动结果更 crisp。

ADD 的 overall loss:adversarial objective 与 distillation objective 的组合

为什么 adversarial signal 能解决模糊?

MSE/LPIPS regression 关注“这个样本与 target 有多近”;GAN-like objective 关注“这个样本是否落在真实分布的高密度区域”。

当多个细节都是合法答案时,回归容易输出平均结果;discriminator 则会惩罚过度平滑、缺乏纹理或不符合真实图像 statistics 的结果。

ADD 的代价

ADD 训练动态更难控制,常见风险包括:

  • discriminator 与 student 的博弈不稳定;
  • adversarial loss 与 teacher regression 的权重难以平衡;
  • 若在 pixel space 与 latent space 之间频繁转换,训练成本高。

这自然引出 LADD。


LADD 为什么把 adversarial distillation 放到 Latent Space?

Latent Adversarial Diffusion Distillation(LADD)把 adversarial objective 重构到 latent space,减少 pixel-to-latent 的往返转换。

典型流程是:

z_0
 |
 +--> Teacher --> teacher latent trajectory / prediction
 |
 +--> Student --> student latent prediction
                         |
              latent feature extractor + detector
                         |
               real / fake adversarial signal

LADD:在 latent space 中完成 teacher / student 与 detector 的交互

LADD 的核心收益:

  • 减少 VAE encode/decode 往返;
  • 在更低维空间进行 adversarial comparison;
  • 更适合高分辨率图像生成;
  • 将 teacher guidance、feature extraction 与 discrimination 放在同一个 latent pipeline。

但它也不是免费午餐:latent detector 的设计、teacher feature 选择、adversarial stability 和 decoder 最终视觉质量仍需共同调节。


各类 Distillation 方法怎样选择?

方法 学习对象 主要优点 主要限制
Progressive Distillation 局部多步 transition 目标直观,可逐步压缩 NFEs 需要多轮,依赖离散 schedule
InstaFlow 先 straight path,再 student 直线路径适合一步生成 Reflow 计算昂贵
Consistency Models 同一路径不同点映射到同一终点 可做 few-step / one-step L2 regression 可能均值化、模糊
DMD teacher / student output distribution 直接关注分布而非单样本 内嵌 diffusion loop,计算复杂
ADD 分布匹配 + discriminator adversarial signal 更硬,结果更 crisp 对抗训练不稳定
LADD latent-space adversarial distillation 少 pixel-latent 转换,适合高分辨率 latent detector 与训练平衡更复杂

课程的总判断不是“某一个方法永远最好”,而是三个 recurring ingredients:

  1. regression signal:MSE、LPIPS;
  2. distribution / adversarial pressure;
  3. latent-space training。

总结与速查

Image-text data
      |
      v
Data filtering / captioning / resolution mixture
      |
      v
Pre-training
  CFM loss + timestep sampling + resolution shift + REPA
      |
      v
Base generation model
      |
      +--> Continued Training: 增加领域知识
      |
      +--> SFT: 改善 aesthetics / lighting / instruction following
      |
      +--> Preference tuning: ReFL / Flow-GRPO / Diffusion-DPO
      |
      +--> Prompt Enhancement: 推理时把短 prompt 改写为 in-distribution prompt
      |
      v
Post-trained model
      |
      +--> DreamBooth + prior preservation: 记住特定主体
      |
      +--> LoRA: 只学习低秩参数增量
      |
      v
Personalized model / adapter
      |
      +--> Progressive Distillation
      +--> InstaFlow / Reflow
      +--> Consistency Models
      +--> DMD / ADD / LADD
      |
      v
Fast few-step / one-step generator

建议记住的 12 个公式

Flow interpolation

formula

Conditional flow target

formula

Flow Matching loss

formula

Logit transform

formula

Logit-Normal density

formula

Resolution-aware timestep shift

formula

REPA loss

formula

LoRA update

formula

Prior-preservation tuning loss

formula

Consistency property

formula

Distribution matching objective

formula

Adversarial distillation objective

formula

容易混淆的概念

  1. Pre-training 不等于最终对齐。 Pre-training 先让模型学会生成广泛图像,质量、偏好和产品行为还要靠 post-training。
  2. Post-training 也不等于 personalization。 CT/SFT/preference tuning 改善通用模型;DreamBooth/LoRA 针对特定主体或场景。
  3. Continued Training 与 SFT 的区分是知识/行为。 前者补充内容分布,后者调整表达方式、审美和指令遵循。
  4. Preference tuning 不一定需要人工逐张打分。 可以使用 reward model 或自动 pairwise/listwise signal,但 proxy 偏差仍然存在。
  5. Reward 高不等于人类一定满意。 过度优化 reward model 会产生 reward hacking。
  6. Prompt Enhancement 不更新 generation model。 它是在 inference time 改写输入,降低用户 prompt 与训练 caption 的分布差异。
  7. DreamBooth 记住的是特定主体,不是“更强的 teddy bear 类别”。 Prior preservation 用来避免 class concept 被破坏。
  8. LoRA 不是无损压缩全部参数。 它假设任务相关更新可以由低秩增量近似。
  9. Distillation 的 student 不一定更小。 图像生成中常见的是模型规模相近,但 student 的 sampling steps 更少。
  10. Progressive Distillation 与 InstaFlow 的顺序不同。 PD 直接逐轮压缩原路径;InstaFlow 先用 reflow 拉直 path,再做 distillation。
  11. Consistency Model 不是简单让两个输出相等。 必须配合 boundary condition、stop-gradient 或 EMA teacher 防止 trivial collapse。
  12. Consistency regression 容易均值化。 语义有效但像素不同的图像也可能被 L2 惩罚。
  13. DMD 匹配的是 distribution,不是某一张 teacher target。 代价是需要额外 score/velocity advice,训练更昂贵。
  14. ADD 的 discriminator 不等于普通 classifier。 它承担的是 real/fake distribution pressure,同时保留 teacher distillation signal。
  15. LADD 的关键不只是把图片换成 latent。 它要把 feature extraction、teacher/student comparison 和 adversarial objective 全部重构到 latent pipeline。
  16. 本讲的 formula 方向并非所有论文都相同。 课程 flow-matching 图示中 formula 为 noise、formula 为 clean;resolution shift 引用论文的约定可能相反,必须先查清楚。
  17. Uniform timestep sampling 是理论起点,不一定是最佳工程方案。 logit-normal 是训练分布设计,用于提高困难区域的覆盖。
  18. 同一数值噪声不代表同一感知噪声。 分辨率、patch 数和数据内容都会改变 task difficulty。

最简总结

  • 训练一个 text-to-image model 不是单一 loss 的事情,而是一个四阶段生命周期:Pre-training -> Post-training -> Tuning -> Distillation;
  • 课程默认使用 Flow Matching loss,但工程重点在于怎样采样 timestep、处理 resolution,并给模型更好的 representation signal;
  • 中间 timestep 通常最难,logit-normal distribution 可以把训练资源集中到困难区域;
  • 不同 resolution 下的 perceived noise 不同,需要 resolution-aware timestep shift;
  • REPA 借用 pretrained encoder 的 semantic representation,加速 DiT 学会有用的中间表示;
  • Pre-training 重视数据管线和 curriculum learning:从低分辨率、固定方形、短 prompt 逐渐过渡到高分辨率、可变宽高比和复杂 prompt;
  • Post-training 中,CT 补充知识,SFT 改变行为,preference tuning 对齐人类偏好,prompt enhancement 则在推理阶段修正输入分布;
  • DreamBooth 绑定特定主体,prior preservation 防止遗忘,LoRA 用低秩增量降低 tuning 成本;
  • Distillation 的核心目标是减少 function evaluations,而不只是缩小模型;
  • Progressive Distillation 逐轮减半步数,InstaFlow 先拉直 path 再蒸馏,Consistency Models 让路径上不同点指向同一个终点;
  • DMD 从样本匹配转向分布匹配,ADD 再加入 adversarial pressure,LADD 则把它们放进 latent space;
  • 所有方法都在做同一个工程权衡:质量、速度、计算成本、训练稳定性与可控性之间不存在免费午餐。
posted on 2026-09-07 23:14  牛牛的智驾笔记  阅读(29)  评论(0)    收藏  举报