EmergentTwilight's picture
|
download
raw
34.9 kB
# Information-Gain Learning for Unified Multimodal Chain-of-Thought
本文是统一多模态模型的 SFT、on-policy distillation(OPD)与 RL 方法定义。目标是在交替生成的文本与视觉状态之间建立可用的信息依赖,适用于离散 autoregressive(AR)视觉生成和连续 flow matching(FM)视觉生成。前三种训练方式共享轨迹与干预定义,但分别使用监督预测、教师分布匹配和奖励优化,不能相互混称。
第 1–5 节只定义方法;协议、模型适配、运行约束与实现状态集中在第 6 节。信息依赖不等于状态正确性:方法有效性仍须由生成状态正确性、下游语义使用与任务迁移共同验证。
## 1. Unified multimodal policy
给定初始问题及观测 $q$,模型生成交替的文本、图像与最终答案,记完整轨迹为 $\xi=(B_1,\ldots,B_K)$,历史为 $h_i=(q,B_{<i})$。将整个历史作为状态,每个生成 block 作为宏观动作:
$$\Pi_\theta(d\xi\mid q)=\prod_{i=1}^{K}\pi_\theta(dB_i\mid h_i).$$
这一写法表示条件概率测度,不假设所有 block 都有可直接计算的 likelihood。宏观 block 内部采用各模态原生的生成过程:
- **Text / discrete visual AR:**依次预测离散变量;一个视觉位置可以包含多个独立或条件自回归的 factors。
- **Continuous visual FM:**从噪声积分条件速度场,得到整张图像的 latent;denoising time 不是文本 token index。
统一采用 data-to-noise 时间约定。对 clean image latent $x_0\in\mathbb R^d$,
$$x_t=(1-t)x_0+t\epsilon,\qquad \epsilon\sim\mathcal N(0,I),\qquad u=\epsilon-x_0,\quad t\in(0,1).$$
模型 $v_\theta(x_t,h,t)$ 学习速度 $u$,生成时从 $t=1$ 向 $t=0$ 积分。上述插值定义 forward-noising 的监督/评分分布,不等于数值 reverse solver 的实际路径。不同 backbone 的时间方向、prediction parameterization 和 noise schedule 必须先转换到一致约定;本文不假定确定性 ODE 的单步转移具有普通连续密度。
这种 block-level 决策、模态内部 AR/denoising 两层分解参考 [BRAID §4](https://arxiv.org/html/2607.03748v1#S4)。它提供统一 RL 视角,不直接提供下面的 IG-OPD 方法。
## 2. Cross-modal information gain
### 2.1 Matched interventions
对相邻跨模态事件 $e:S_e\to Y_e$,$S_e$ 为当前 source,$Y_e$ 为待预测的下一 block,$H_e$ 为 source 之前的生成历史。方向记为 $\rho(e)\in\{\mathsf T\to\mathsf V,\mathsf V\to\mathsf T\}$。构造四个条件:
| View | Earlier generated history $H_e$ | Current source $S_e$ |
|---|---|---|
| $11$ | visible | visible |
| $10$ | visible | blind |
| $01$ | blind | visible |
| $00$ | blind | blind |
精确定义为 $c^{11}=(q,H_e,S_e)$、$c^{10}=(q,H_e,\operatorname{Blind}(S_e))$、$c^{01}=(q,\operatorname{Blind}(H_e),S_e)$、$c^{00}=(q,\operatorname{Blind}(H_e),\operatorname{Blind}(S_e))$。所有 views 始终保留初始观测 $q$、结构、位置和相同 target/prefix;只改变生成内容的可见性。
**Necessity** 比较 $(c^+,c^-)=(c^{11},c^{10})$,衡量完整历史中移除当前 source 的影响;**Sufficiency** 比较 $(c^+,c^-)=(c^{01},c^{00})$,衡量移除早期生成历史后当前 source 的独立贡献。它们是操作性依赖指标,不是逻辑必要性或充分性的证明。没有更早生成历史时,不另计 sufficiency,以免重复 necessity。
单张生成图的 $q\to T_1\to I_1\to T_2$ 已包含双向 necessity,且 V→T sufficiency 可移除 $T_1$;不要求多张生成图。$q$ 可含多张输入图,但拆分、遮蔽 query 图文的 grounding interventions 留待独立研究,不纳入当前目标。
### 2.2 Modality-native scores
**AR target。**令 $J_e$ 为 target 位置数,$F_j$ 为位置 $j$ 的 factor 数,$y_{j,m}$ 为已观测的 factor。定义 per-unit log score
$$s_e^{ab}=\frac1{J_e}\sum_{j=1}^{J_e}\frac1{F_j}\sum_{m=1}^{F_j}\log p_\theta(y_{j,m}\mid c^{ab},y_{<j},y_{j,<m}).$$
Text 的 $F_j=1$;条件 factorization 必须保留同位置的已观测前序 factors,独立 factors 则忽略该条件。视觉 factor mean 消除编码宽度造成的机械尺度差,但不是整张图的 joint log likelihood。
**FM target。**在完全相同的 $x_0,t,\epsilon$ 上比较速度预测误差:
$$E_e^{ab}=\mathbb E_{t\sim\nu,\epsilon}\left[\frac1d\|v_\theta(x_t,c^{ab},t)-u\|_2^2\right],\qquad s_e^{ab}=-E_e^{ab}.$$
$\nu$ 是预先固定的时间采样分布,full/blind 共用所有随机量。这里的 gain $s_e^+-s_e^-=E_e^--E_e^+$ 是 **flow prediction-error reduction**,不是精确 image LL、surprisal 或 mutual information。V→T 在 FM backbone 上仍使用文本 LL,不需要估计 image likelihood。
理想条件互信息可写为 $I(Y;S\mid H)=\mathbb E\log[p(Y\mid H,S)/p(Y\mid H)]$,但 masked model 通常不等于真实边缘条件分布。本文的 AR likelihood contrast 和 FM error contrast 都是可操作的 IG surrogate,不宣称无偏 CMI 估计或普遍的下界。
## 3. Supervised learning with IG
### 3.1 Native supervision
在可信的完整标注轨迹上,保留 backbone 的原生监督目标:text CE,以及 discrete visual CE 或 continuous visual flow MSE。记其组合为 $\mathcal L_{\mathrm{native}}$;原生模态权重与归一化由 backbone 定义。SFT 只额外引入 IG,不包含教师蒸馏目标。
SFT IG 比较完整历史中的 source 可见/不可见,即 $11/10$。Blind branch stop-gradient;full branch 接收梯度。两方向独立计算,并先对同一轨迹内的 events 平均,再对该方向有事件的轨迹平均,记该 reduction 为 $\mathcal R_\rho[\cdot]$。
### 3.2 Relative per-unit IG
采用第 2 节的 per-unit score,定义 detached blind 难度尺度与相对增益:
$$D_e=\max\{-\operatorname{sg}[s_e^-],\epsilon_\rho\},\qquad z_e=\frac{s_e^+-\operatorname{sg}[s_e^-]}{D_e},$$
$$\mathcal L_{\mathrm{IG,rel}}^{(e)}=D_e\tau_\rho\operatorname{softplus}\!\left(-\frac{z_e}{\tau_\rho}\right),\qquad \tau_\rho>0.$$
AR 的 $D_e$ 来自 blind per-unit surprisal;FM 的 $D_e$ 来自 blind mean velocity error。$\epsilon_\rho>0$ 固定,防止极小 blind error 主导归一化。FM 实际用固定数量的 matched Monte Carlo probes 估计 $E^\pm$,再代入非线性 loss;这不保证得到无限采样目标的无偏估计。
该 loss 满足 $\partial\mathcal L/\partial s_e^+=-\sigma(-z_e/\tau_\rho)$:它依据相对 gap 重加权 full-view 的预测梯度,不直接恶化 blind。Per-factor/coordinate mean 与 relative gap 缓解尺度失配,但不保证 text/image 的参数梯度范数相等。
### 3.3 Absolute alternative and total objective
保留原有 absolute Softplus 作为对照:
$$\mathcal L_{\mathrm{IG,abs}}^{(e)}=\tau_\rho\operatorname{softplus}\!\left(\frac{\operatorname{sg}[s_{e,\mathrm{abs}}^-]-s_{e,\mathrm{abs}}^+}{\tau_\rho}\right).$$
为保持已有 AR 配置语义,$s_{e,\mathrm{abs}}$ 在每个位置内对 factors **求和**,再对位置平均;text 不变。FM absolute 对照使用 $s_{e,\mathrm{abs}}=-E_e$。Absolute temperature 因而依赖原生尺度,不应跨 backbone 直接复制。
$$\mathcal L_{\mathrm{SFT}}=\mathcal L_{\mathrm{native}}+\sum_{\rho}\lambda_{\mathrm{IG},\rho}\,\mathcal R_\rho[\mathcal L_{\mathrm{IG}}^{(e)}].$$
两方向的 $\lambda_{\mathrm{IG},\rho}$、$\tau_\rho$ 保持可独立配置。共享设置可取 $\lambda_{\mathrm{IG},\rho}=\lambda_{\mathrm{IG}}/2$、$\tau_\rho=\tau$,得到两个方向等权的 IG branch;归一化不消除 IG 相对原生 SFT 的权衡。
## 4. Information-gain on-policy distillation
### 4.1 Student occupancy and teacher
每次更新前冻结当前 student 为 behavior $\theta_b$,生成硬轨迹 $\widehat\xi\sim\Pi_{\theta_b}$。EMA teacher $\bar\theta$ 在实际生成的 histories 上构造 IG target;trajectory、teacher 与 target shaping 全部 detach,只更新 student。一次成功更新后再执行 $\bar\theta\leftarrow\kappa_{\mathrm{EMA}}\bar\theta+(1-\kappa_{\mathrm{EMA}})\theta$,$0\le\kappa_{\mathrm{EMA}}<1$;采样与同次更新内的 teacher 保持不变。
另保留 run 开始时 student 的冻结副本 $\theta_{\mathrm{ref}}=\theta_{\mathrm{init}}$,作为第 4.4 节的长期 reference。EMA teacher 提供平滑且可演进的目标,reference 保留初始分布/速度场;两者不可混用。OPD 不对离散 rollout 或整条去噪求解路径反向传播。
Necessity student 使用 $11$,sufficiency student 使用 $01$;对应 teacher 分别比较 $11/10$ 与 $01/00$。两种 criterion 和两个方向均可独立启用,使用各自的有效事件集合。
### 4.2 Discrete targets: JSD and KL
省略 event/position/factor 下标,令 $q^+,q^-$ 为 matched teacher distributions。保留当前 positive clipped contrast:
$$r(w)=\log q^+(w)-\log q^-(w),\qquad \phi(r)=\min\{\max(r,0),r_{\max}\},$$
$$\widetilde q(w)=\frac{q^+(w)\exp[\alpha_c\phi(r(w))]}{\sum_{w'}q^+(w')\exp[\alpha_c\phi(r(w'))]},\qquad \alpha_c\ge0.$$
$c\in\{\mathrm{nec},\mathrm{suf}\}$。这已在每个位置、每个候选词/factor outcome 上自适应塑形,不额外引入 token-selection loss。它有意改变 teacher distribution,不是无偏的信息增益估计;$\alpha_c=0$ 退化为 plain teacher target。
以 $Q=\operatorname{sg}[\widetilde q]$、$P=p_\theta^+$ 定义三种可选匹配目标:
$$D_{\mathrm{JS}}(Q,P)=\tfrac12D_{\mathrm{KL}}(Q\|M)+\tfrac12D_{\mathrm{KL}}(P\|M),\qquad M=\tfrac12(Q+P),$$
$$D_{\mathrm{FKL}}(Q,P)=D_{\mathrm{KL}}(Q\|P),\qquad D_{\mathrm{RKL}}(Q,P)=D_{\mathrm{KL}}(P\|Q).$$
JSD 是对称、有界的 baseline;KL 必须明确方向,不能只写未定向的“KL loss”。支持集必须匹配。每个位置先对 factor divergence 平均,再对 target positions 平均,得到 event loss $\mathcal L_{e,c}^{\mathrm{AR}}$。条件 factors 均使用相同的已采样 factor prefix;此局部平均不是整段序列的 joint divergence。
### 4.3 Flow targets: on-trajectory guided velocity matching
FM image OPD 在 **student 实际 reverse denoising trajectory** 上查询 teacher。对 event $e$,保存 behavior 在原始完整上下文中访问的状态 $\{(x_{t_j},t_j)\}_{j=0}^{N_e-1}$,按预先固定的索引分布 $\eta_e$ 选取查询位置。所有 teacher views 和 student 共用该 detached 状态与时间,不为 blind/local view 另跑轨迹,也不将最终生成图像重新加噪来代替这些状态。
在相同查询点计算 $v_{\bar\theta}^+=v_{\bar\theta}(x_{t_j},c^+,t_j)$ 与 $v_{\bar\theta}^-=v_{\bar\theta}(x_{t_j},c^-,t_j)$,构造
$$\widetilde v_c=v_{\bar\theta}^++\alpha_c\bigl(v_{\bar\theta}^+-v_{\bar\theta}^-\bigr),\qquad \mathcal L_{e,c}^{\mathrm{FM}}=\mathbb E_{j\sim\eta_e}\left[\frac1d\left\|v_\theta(x_{t_j},c^+,t_j)-\operatorname{sg}[\widetilde v_c]\right\|_2^2\right].$$
Necessity 强化 full teacher,sufficiency 强化只保留当前 source 的 local teacher。$\alpha_c=0$ 是 plain teacher matching;$\alpha_c>0$ 沿 source 引起的速度变化外推。这里使用 signed、unclipped velocity contrast,不等同于离散 target 的 positive-clipped shaping。监督是 teacher velocity,而不是把学生图像当 GT 后构造 $\epsilon-\hat x_0$。
这是 on-policy field distillation:在学生访问的状态上,直接回归增强的 teacher 速度。局部 Gaussian 推导可将其解释为特定同 covariance KL 的尺度化形式,但不证明终局 image KL 等价或语义质量改善;推导与 JSD 扩展边界见第 6.3 节。首版直接使用 coordinate-mean MSE,不要求构造、采样或估计辅助概率分布。
状态查询与直接速度匹配参考 [DiffusionOPD](https://arxiv.org/html/2605.15055v1) 和 [DanceOPD](https://arxiv.org/html/2606.27377v1);外推形式与 [DreOPD §4](https://arxiv.org/html/2608.09233v1#S4) 一致,但此处 contrast 来自 MMCoT 的 full/blind context,而非不同能力的 teacher/reference。上述文献的效果不构成本组合的验证;BRAID/NFT 用于第 5 节的 reward learning。
### 4.4 Frozen-reference anchoring
EMA teacher 与 guided target 都会演进,持续贴近它们不代表保留了初始能力。Discrete 与 FM 分支因此都支持独立的 frozen-reference penalty;基线采用 EMA teacher 加初始 reference,reference 权重可置零作消融。它是限制累计漂移的软约束,不是防止遗忘、图像崩溃或错误推理的保证。
Reference 始终在实际 full-visible $11$ 条件、相同 sampled prefix/denoising state 上计算,不读取 answer privilege,不做 full/blind shaping。AR event 使用第 4.2 节的 factor/position mean,比较 $p_\theta^{11}$ 与 $\operatorname{sg}[p_{\mathrm{ref}}^{11}]$;divergence 默认 JSD,也可明确选择 $D_{\mathrm{FKL}}(p_{\mathrm{ref}},p_\theta)$ 或 $D_{\mathrm{RKL}}(p_{\mathrm{ref}},p_\theta)$。FM event 使用
$$\mathcal L_{\mathrm{ref},e}^{\mathrm{FM}}=\mathbb E_{j\sim\eta_e}\left[\frac1d\left\|v_\theta(x_{t_j},c^{11},t_j)-\operatorname{sg}[v_{\mathrm{ref}}(x_{t_j},c^{11},t_j)]\right\|_2^2\right].$$
Reference 对 routing 接受、至少属于一个启用 criterion 的已选完整 events 各计算一次,先做 event/trajectory reduction,再对启用的 target 方向等权平均,得到 $\mathcal L_{\mathrm{ref}}^{\mathrm{OPD}}$;不因 necessity/sufficiency 同时开启而重复计数。它约束实际可见策略,而非额外锚定 blind/local views。缺失某方向事件的轨迹不进入该方向分母,空分量为零;方向集合在 run 前固定。
这种独立质量约束参考 [Flow-OPD 的 MAR](https://arxiv.org/html/2605.08063v5#S5),但我们冻结的是各 backbone 的初始模型(下一阶段为 ThinkMorph),不是其专门训练的审美 teacher。对单个 necessity 查询点,若单位权重的 OPD MSE 加上系数为 $\beta$ 的同一个 full EMA teacher MSE,最优 target 仅将 guidance 缩为 $\alpha_{\mathrm{nec}}/(1+\beta)$;这不提供固定的长期基准,故 reference 必须与 EMA 分开。
### 4.5 Routing, replay and total objective
Routing 可选择结构有效的全部 rollouts、仅正确 rollouts,或为错误 rollout 的 teacher 提供正确答案。采用 answer privilege 时,每对 full/blind teacher 都看到相同答案,student 永远不可见;否则 contrast 会混入答案泄漏,而非 source 贡献。
$$\mathcal L_{\mathrm{OPD}}=\sum_{\rho,c}\lambda_{\mathrm{OPD},\rho,c}\,\mathcal R_{\rho,c}[\mathcal L_{e,c}]+\beta_{\mathrm{ref}}^{\mathrm{OPD}}\mathcal L_{\mathrm{ref}}^{\mathrm{OPD}}+\lambda_{\mathrm{replay}}\mathcal L_{\mathrm{native}}^{\mathrm{GT\ replay}},\qquad \beta_{\mathrm{ref}}^{\mathrm{OPD}}\ge0.$$
$\mathcal R_{\rho,c}$ 先在每条 accepted trajectory 内平均该类 events,再平均有事件的 trajectories;空分量不产生梯度。$\mathcal L_{e,c}$ 对 discrete targets 选 JSD/KL,对 FM targets 选速度 MSE;两种原生目标不强制使用同一 divergence。默认不依据实际 sampled token 的 gain 正负丢弃 OPD positions,因为 sampled token 不是 GT。
Replay 可关闭、固定预算均匀采样,或优先使用本次 rollout 失败题目的完整 GT 轨迹;它独立于 sampled trajectory,只计算原生 SFT。不能将错误 sampled image 拼接原 GT continuation。Teacher 的平滑、privilege 或低 distillation loss 都不保证状态正确;需区分 OPD 与 replay 的梯度及任务收益。
## 5. Reward-based on-policy learning
### 5.1 Reward vector
每个问题采样 $G\ge2$ 条 fresh trajectories,由同一冻结 behavior snapshot 在 no-grad 下评分。保留现有 reward vector:
$$\mathbf r=(r_{\mathrm{fmt}},r_{\mathrm{acc}},r_{\mathrm{IG}},r_{\mathrm{img}},r_{\mathrm{cost}}).$$
- $r_{\mathrm{fmt}}\in\{0,1\}$:完整轨迹遵守预先固定的多模态协议。
- $r_{\mathrm{acc}}\in\{0,1\}$:最终答案通过任务 verifier;无法判断或未完成时为零。
- $r_{\mathrm{IG}}\in[0,0.5]$:下面定义的双向 necessity/sufficiency self-score。
- $r_{\mathrm{img}}\in[0,1]$:预留的外部图像质量/对齐奖励,**首版关闭**,$w_{\mathrm{img}}=r_{\mathrm{img}}=0$;尚未选定 scorer。
- $r_{\mathrm{cost}}\in[0,1]$:可选的资源代价,默认关闭;只惩罚格式和答案均正确的轨迹。
不新增 state/use reward。未来启用 image reward 时,冻结、校准后的 scorer 为每张生成图给出 $r_{q,n,k}^{\mathrm{img}}\in[0,1]$;只能读取该图及其生成前的上下文,不能读取 GT answer 或未来 continuation。默认先做 trajectory 内多图平均得到 $r_{\mathrm{img}}$(无图为零);也保留第 5.3 节的 per-image advantage 分配选项。首版两种 image-reward 路径均关闭。
### 5.2 Normalized self-scored IG
沿实际 sampled targets,用 behavior 的四视图 scores 计算 $\ell_e^{ab}=-s_e^{ab}\ge0$。AR 使用 per-factor LL 并设固定 log-probability floor;FM 使用 coordinate-mean velocity error,四视图共用 $t,\epsilon$。这里不使用 EMA teacher、answer privilege 或 OPD shaped target。
$$\gamma_e^{\mathrm{nec}}=\operatorname{clip}_{[0,1]}\!\left(\frac{\ell_e^{10}-\ell_e^{11}}{\max(\ell_e^{10},\epsilon_{\rho,\mathrm{nec}})}\right),\qquad \gamma_e^{\mathrm{suf}}=\operatorname{clip}_{[0,1]}\!\left(\frac{\ell_e^{00}-\ell_e^{01}}{\max(\ell_e^{00},\epsilon_{\rho,\mathrm{suf}})}\right).$$
$\epsilon_{\rho,c}>0$ 是 run 前校准并冻结的有效难度下限,而非单纯机器 epsilon。AR 的比值表示 blind surprisal reduction,FM 表示 blind prediction-error reduction;两者共享有界尺度,不声称共享精确信息量单位。
令 $\Gamma_{\rho,c}(\xi)$ 为 trajectory 内该类有效 events 的 $\gamma$ 均值,无该类 event 时为零。对 run 前固定的 enabled components $\mathcal K$ 与 $a_{\rho,c}\ge0$、$\sum_{\mathcal K}a_{\rho,c}=1$,
$$r_{\mathrm{IG}}(\xi)=\frac12\sum_{(\rho,c)\in\mathcal K}a_{\rho,c}\Gamma_{\rho,c}(\xi).$$
Necessity、sufficiency 和两个方向均可独立关闭;默认 joint setting 同时包含两种 criterion。缺失 event 记零,不按单条 rollout 的实际覆盖重新归一化。评分窗口与 horizon 预先固定;adaptive-depth 实验另报 coverage/depth,区分多生成 block 与提高 event 质量。IG 关闭时直接置零,无需四视图计算。
所有 reward 与 normalization 均 detach,RL actor 只在真实 full-visible 条件更新;blind views 没有直接梯度。但共享参数和跨更新的采样选择仍可能导致 blind drift、复制或隐蔽编码,不能据此宣称消除了 reward hacking。必须保留四个 raw scores,而不只报告 gain。
### 5.3 Cost, return and group advantage
对可控资源 $k$ 的消耗 $N_k$、固定正预算 $B_k$ 和权重 $\omega_k\ge0$、$\sum_k\omega_k=1$,
$$C(\xi)=\operatorname{clip}_{[0,1]}\!\left(\sum_k\omega_k\frac{N_k}{B_k}\right),\qquad r_{\mathrm{cost}}=r_{\mathrm{fmt}}r_{\mathrm{acc}}C(\xi).$$
资源可包含文本长度、视觉生成计算量和图像数;固定不可控的开销不提供优化信号。即使 accuracy bonus 关闭,cost 开启仍需计算 correctness gate。
$$R=w_{\mathrm{fmt}}r_{\mathrm{fmt}}+r_{\mathrm{fmt}}\bigl(w_{\mathrm{acc}}r_{\mathrm{acc}}+w_{\mathrm{IG}}r_{\mathrm{IG}}+w_{\mathrm{img}}r_{\mathrm{img}}\bigr)-w_{\mathrm{cost}}r_{\mathrm{cost}}.$$
权重非负;关闭 format bonus 不关闭 validity gate。Invalid/truncated trajectories 仍留在 group 中,按零有效奖励参与比较。若需要保证有效正确答案总胜过有效错误答案,可要求 $w_{\mathrm{acc}}>w_{\mathrm{IG}}/2+w_{\mathrm{img}}+w_{\mathrm{cost}}$。
默认共享 trajectory-return 模式只对合成后的 return 做一次 group normalization:
$$\mu_q=\frac1G\sum_nR_{q,n},\quad \sigma_q^2=\frac1G\sum_n(R_{q,n}-\mu_q)^2,\qquad A_{q,n}=\operatorname{sg}\!\left[\frac{R_{q,n}-\mu_q}{\max(\sigma_q,\sigma_{\min})+\epsilon_A}\right].$$
同组 reward 完全相等时显式置 $A=0$。有界 IG 不限制标准化后 advantage:其他 reward 相同时,IG 仍可决定整个 group 的排序。
**Optional per-image credit assignment。**未来启用逐图 image reward 时,可参考 [BRAID §4.4](https://arxiv.org/html/2607.03748v1#S4.SS4),只给每张图自己的附加 advantage。令 $R^{\mathrm{base}}$ 为上式去掉 $w_{\mathrm{img}}r_{\mathrm{img}}$ 项后的 return,$A_{q,n}^{\mathrm{base}}$ 为它在完整 rollout group 上的 advantage;fmt、acc、IG、cost 的组合与门控不变。对同一问题 group 中格式有效完整轨迹的全部生成图组成 $\mathcal I_q$,将逐图 reward 单独中心化、标准化得到 detached 的 $\Delta A_{q,n,k}^{\mathrm{img}}$,再分配
$$A_{q,n}^{\mathrm{text}}=A_{q,n}^{\mathrm{base}},\qquad A_{q,n,k}^{\mathrm{image}}=A_{q,n}^{\mathrm{base}}+\lambda_{\mathrm{img}}^{\mathrm{adv}}\Delta A_{q,n,k}^{\mathrm{img}},\qquad \lambda_{\mathrm{img}}^{\mathrm{adv}}\ge0.$$
图像标准化沿用上面的 std floor 与 epsilon 规则;pool 少于两张图或 scores 全相等时,附加 advantage 显式为零。无效轨迹的附加项为零,但其失败仍通过 $A^{\mathrm{base}}$ 学习。同一轨迹内不同图片可以获得不同附加信号;不将其均值再次加入 $R^{\mathrm{base}}$,也不把该附加信号广播给文本。双向 IG 仍留在共享基础 reward 中,不随此选项改成 image-only。
全局多图平均与逐图附加 advantage 是互斥的 reward 分配方式,不同时计入同一 image reward。后者在独立标准化之后组合信号,不等价于默认的单次 total-return normalization;$\lambda_{\mathrm{img}}^{\mathrm{adv}}$ 独立控制局部信号强度,不能直接照搬 $w_{\mathrm{img}}$ 或单一 return 的权重优先级条件。首版 $w_{\mathrm{img}}=\lambda_{\mathrm{img}}^{\mathrm{adv}}=0$;逐图分配保留为后续 scorer 可用时的设计选择,也不指定 BRAID 的 VLM judge 或四项评分。
### 5.4 AR branch: clipped policy optimization
令 $\mu_b,\mu_\theta$ 为实际 behavior 与当前 actor 的采样分布,$\varrho=\mu_\theta(y\mid h)/\mu_b(y\mid h)$,定义
$$\Psi(\varrho,A)=\min\{\varrho A,\operatorname{clip}(\varrho,1-\varepsilon_l,1+\varepsilon_h)A\}.$$
Text action 使用 categorical ratio。Composite visual position 使用各 factor 的 ratio,先算 $\Psi$ 再取 factor mean;其后所有 model-owned AR positions 等权取 trajectory mean $\overline\Psi$。不设额外 visual policy-gradient 权重,也不把宽视觉编码展开成更多等权时间步。
默认所有 actions 使用共享 $A_{q,n}$。若启用 per-image 分配,text actions 使用 $A_{q,n}^{\mathrm{text}}$,属于图像 $k$ 的所有 visual positions/factors 使用该图的 $A_{q,n,k}^{\mathrm{image}}$;原有 factor/step reduction 不变。
Factor-wise clipping 是明确的 surrogate,不是 composite joint-ratio clipping。条件 factors 保留实际采样的 factor prefix;temperature、CFG 必须在 behavior/actor probability 定义中一致。默认使用 full support;若截断,须冻结 behavior/current 共用的支持集或另外处理绝对连续性,不能默许随参数变化的 top-k/top-p support。
### 5.5 FM branch: BRAID-style NFT
每张图使用分配给自身的 $A_k^{\mathrm{image}}$(省略 $q,n$;默认等于共享 trajectory advantage,逐图模式使用第 5.3 节的组合)。参考 [BRAID §4.3](https://arxiv.org/html/2607.03748v1#S4.SS3) 与 [DiffusionNFT §3](https://arxiv.org/html/2509.16117v2#S3),对 detached 的 sampled $x_0$ 重新 forward-noise,取全可见上下文上的 $v_b=\operatorname{sg}[v_{\theta_b}(x_t,h,t)]$,定义
$$r_{\mathrm{NFT}}=\operatorname{sg}[\sigma(A_k^{\mathrm{image}}/T_{\mathrm{NFT}})],\qquad v_\theta^\pm=v_b\pm\beta_{\mathrm{NFT}}(v_\theta-v_b),$$
$$\mathcal L_{\mathrm{NFT}}^{(\mathrm{image})}=\mathbb E_{t,\epsilon}\left[r_{\mathrm{NFT}}\frac{\|v_\theta^+-u\|_2^2}{d}+(1-r_{\mathrm{NFT}})\frac{\|v_\theta^--u\|_2^2}{d}\right].$$
$T_{\mathrm{NFT}},\beta_{\mathrm{NFT}}>0$。同一图的全部 forward probes 使用该图自己的 soft label;先在 trajectory 内平均生成图像,再平均 trajectories,不因图多而按图数求和。无生成图像的轨迹贡献零。$A_k^{\mathrm{image}}=0$ 映射到中性 $1/2$,不能直接用原始 $r_{\mathrm{IG}}$ 或 $r_k^{\mathrm{img}}$ 作为 NFT soft label。
这是 likelihood-free reward regression,不要求对 reverse sampling path 反向传播,也不是第 4 节的 teacher distillation。这里的 $v_\theta-v_b$ 是由 reward 学出的 policy displacement,不是预先计算的 full/blind teacher guidance;NFT 继续使用 sampled clean image 的 forward noising,而 OPD 查询实际 reverse-path states。共享基础 advantage 与可选逐图附加项借鉴 BRAID 的分配思路,但不预设其 VLM process-reward backend。
### 5.6 Combined objective and reference
$$\mathcal L_{\mathrm{RL}}=-\mathbb E[\overline\Psi]+\lambda_{\mathrm{NFT}}\mathcal L_{\mathrm{NFT}}+\beta_{\mathrm{ref}}^{\mathrm{RL}}\mathcal L_{\mathrm{ref}}^{\mathrm{RL}}.$$
纯 AR 模型没有 NFT 项。Hybrid 模型的 $\overline\Psi$ 只含其 AR actions,$\lambda_{\mathrm{NFT}}$ 校准不同原生目标的尺度;它不是 AR visual-step 内的可调权重,也不改变上述 factor/step reduction。
Reference 在 RL run 开始时冻结,与每轮 behavior snapshot 区分;regularization 只在实际 full-visible 条件计算。AR 沿用 factor/position mean 的 symmetric JSD;FM 在 NFT 的同一 forward-noised state 上计算 current/reference coordinate-mean velocity MSE,按图像、轨迹平均(无图轨迹为零),其局部 Gaussian KL 解释见第 6.3 节。Hybrid reference 将原生 AR 与 FM reference 分量相加;它是损失正则,不改变 reward vector 或 group advantage。$\beta_{\mathrm{ref}}^{\mathrm{RL}}=0$ 可关闭 reference,但 NFT 中的 behavior anchoring 仍存在。
Old policy/clipping 与 NFT behavior anchoring 约束近期更新,不能替代相对固定初始模型的长期约束。Reference 正则常用于保留能力,但不是所有 OPD/RL 的必需项,权重过大也会妨碍学习。Verifier、scorer、reward、reference 参数和采样轨迹均不接收梯度;reference loss 的梯度只流向当前 actor。
## 6. Implementation details and status
### 6.1 Payload, target and model-owned actions
**Payload** 是可被干预的生成语义内容,不包括 protocol scaffold。Text payload 包含 reasoning 内容或最终回答内容;visual payload 包含图像的全部生成表示。原问题及输入图像永不屏蔽。
**Target** 是事件中要预测/匹配的下一 block。AR target 包含该 block 内模型自主输出的终止/转模态 tokens,而不只包含 payload。FM 的 SFT/IG scoring 使用 clean latent 及 matched forward probes;FM-OPD 的监督 target 则是实际学生去噪状态上的 $\widetilde v_c$,不是最终学生图像,也不是以该图重建的真实速度。结构 tokens 可保持可见而同时是 prediction targets,这两种角色不矛盾。
UniAR v2 中,`<think>`、`</think>`、`<image_gen> generate image H W<|vision_start|>`、`<|vision_end|>` 都不做 source masking。学生自主生成前述 image scaffold,**包括 `<|vision_start|>`**;text scoring 算至该 token,或最终回答结束的 `<|im_end|>`。视觉评分覆盖所有已知长度的 generated positions;controller 插入的 `<|vision_end|>` 不进入 target/action。BAGEL、LatentUM 使用各自 typed protocol,不强制套用 UniAR token 字面量。
Blind 必须屏蔽 source 向后文传递信息的全部通道,并重算受影响上下文;仅替换像素、清空一个 embedding 或复用 full-view cached states 不足以保证匹配干预。BAGEL 生成图进入后文的 VAE 与 ViT 两条路径必须一起处理。Positions、target prefix、结构、精度与 dropout 行为在 views 间一致;FM scoring 共用 forward-noising 的 $t,\epsilon$,FM-OPD 则共用实际 rollout 的 $x_{t_j},t_j$。
### 6.2 Backbone adapters and reductions
| Family | Native visual prediction | Objective adapter | Workflow owner |
|---|---|---|---|
| UniAR | 每个 spatial AR position 的 1,024 个 Bernoulli factors | AR joint score / per-factor score,factor-mean distillation/PPO | [uniar.md](uniar.md)、[zebra_cot.md](zebra_cot.md) |
| LatentUM | 每图 256 positions,每位置 8 个条件 categorical factors | 保留 codebook-prefix conditioning;不是 8 个独立 bits | [latentum.md](latentum.md) |
| BAGEL / ThinkMorph | text AR + image-latent flow matching | 文本 categorical;OPD 用 reverse-path velocity MSE,scoring/NFT 用 forward probes | [thinkmorph.md](thinkmorph.md) |
SFT/OPD 的 event losses 采用 trajectory-first reduction;RL 按问题采样 group 后平均 trajectories。跨 rank/microbatch 必须还原同一个全局分母,而不是平均局部均值。图像 factor/coordinate mean 不除 vocabulary size。原生 SFT 的 corruption 与 IG clean-view 分支分离,不以训练噪声代替 matched blindness。
AR OPD 若为显存节省使用 support restriction,需要明确固定的共享 support、renormalization 和 support 外质量;teacher target 与 reference penalty 各自的支持集必须明确,受限支持上的接近不能代表全词表不漂移。完整 categorical JSD/KL 和 visual factor reduction 不改变。
FM-OPD 配置记录 student solver/schedule、查询索引分布 $\eta_e$、每图查询数、guidance strength、EMA decay 与 reference weight;只在查询点重建梯度图,不对 solver 反传。SFT/IG score 和 NFT 单独配置 forward-noising 分布/probe 数,不能共用一个含糊的“time sampling”设置。首版 velocity MSE 不引入辅助 Gaussian variance 或 JSD MC 超参数。
Rollout、teacher target 与 reference 的 CFG/velocity parameterization 必须显式记录并保持可比较;不能静默混用 raw 与 CFG-combined fields。训练内化 guidance 后仍须评估推理 CFG 的叠加影响。EMA 只在成功 optimizer update 后更新;reference 从初始 checkpoint 构建并始终冻结,resume 必须恢复其身份/权重,不得以当前 student 或 parent continuation 的最新权重重置 reference。
### 6.3 Local Gaussian interpretation and limits
在固定查询状态定义同 covariance 的辅助局部核
$$Q^\pm=\mathcal N(x_t-\delta_t v_{\bar\theta}^\pm,\sigma_t^2I),\qquad P_\theta^+=\mathcal N(x_t-\delta_t v_\theta^+,\sigma_t^2I),\qquad \delta_t,\sigma_t>0.$$
Signed tilt $\widetilde Q_c\propto(Q^+)^{1+\alpha_c}(Q^-)^{-\alpha_c}$ 的指数系数和为 1,因此仍为 Gaussian,均值恰为 $x_t-\delta_t\widetilde v_c$。这给第 4.3 节的速度外推提供局部分布解释,而非终局质量保证。两个 KL 方向相同,且
$$\frac1dD_{\mathrm{KL}}(\operatorname{sg}[\widetilde Q_c]\|P_\theta^+)=\frac{\delta_t^2}{2\sigma_t^2}\frac{\|v_\theta^+-\operatorname{sg}[\widetilde v_c]\|_2^2}{d}.$$
Plain MSE 对应常数尺度的辅助核解释;若采用真实 SDE 的 covariance 与 drift,须推导并保留其时间权重。该等价仅适用于固定状态的条件分布,不把 detached-state regression 等同于整个 trajectory KL 的完整梯度。确定性 ODE 单步是 Dirac 分布,不可通过“令 $\sigma_t\to0$”把真实 Dirac KL 变成有限 MSE。
Gaussian 不是首版执行依赖。若未来尝试 continuous JSD,必须显式定义核/尺度并对两侧分布及 mixture log-density 做数值估计;MSE 不能称为 JSD,coordinate-wise JSD mean 也不同于 joint JSD。当前只保留 discrete JSD/KL 和 FM velocity MSE;这些局部匹配都不自动保证状态正确性或能力保持。
### 6.4 Routing, replay and runtime ownership
非法或 cap-truncated rollout 不进入完整事件 OPD,可进入 failure replay;RL 则保留这些失败 group members。Uniform replay 避开当前 raw rollout indices;failure-first replay 只暂存本次 update 的失败 indices,按固定预算优先选取,不足时用 batch 外样本补足,不保留陈旧 rollout。Replay 重新读取完整 GT,绝不拼接 sampled state 和 GT continuation。
Teacher、reference 与 student 同权重、无 privilege 且 $\alpha_c=0$ 时,plain matching 和 reference penalty 初始均为零;reference 本身不提供改进方向。对照至少区分 plain teacher、IG-shaped teacher、reference on/off 与 replay-only,并固定 rollout/replay 预算;loss value 的大小不能代替梯度贡献分析。分别监测相对初始模型的分布/速度偏离、生成图像质量/多样性、semantic-state correctness 和最终任务准确率,不能把低 OPD loss 或非零 view gap 当作质量保证。
UniAR 的 worker pools、routing/replay 组合、全局梯度归一化、RL replay guards、validation commits 与 identical-argv resume 由 [uniar.md](uniar.md#training-runtime-contracts) 管理。BAGEL/LatentUM 分别沿用上表 workflow owner;任务提交与续跑见 [submission_snapshots.md](submission_snapshots.md),输出见 [artifacts.md](artifacts.md),离线图像质量评估见 [visual_quality.md](visual_quality.md)。Method 不承担历史实验流水账或机器配置。
### 6.5 Implemented versus specified
RL 的 per-image reward/advantage 分配仅是预留设计;当前没有 image-reward backend,两种分配路径均未启用。未来实现须记录分配模式、逐图 scorer/calibration、normalization pool、局部权重与每图 advantage;不能将文档中的选项视为已有配置字段或改变现有运行。
| Path | 当前状态 | 本文新增而尚未实现的部分 |
|---|---|---|
| `OURS/` | UniAR SFT IG、JSD OPD、AR GRPO 已实现;保留部分 legacy SFT auxiliaries,但不属本文方法 | 新增 OPD KL/初始-reference penalty 不能视为已实现;不改变现有 RL reference |
| `OURS-LatentUM/` | Native SFT + 双向 absolute/relative IG 已实现 | OPD/RL 均为预留边界 |
| `OURS-Bagel/` | Native SFT;LoRA OPD 已实现 text JSD/FKL/RKL、reverse-path flow MSE、双向 nec/suf、EMA、frozen reference、routing/replay 与恢复 | FM SFT-IG、NFT RL 尚待实现;OPD 首版只支持 raw Euler velocity(CFG=1),GPU 验证记录见 thinkmorph.md |
| `ThinkMorph-OPD/` | Legacy native V→T JSD + replay prototype | 待审计迁移至 `OURS-Bagel/`;不在这里新增 FM 功能 |
`OURS-Bagel/config/opd/thinkmorph_joint.yaml` 以 `models/ThinkMorph-7B` 为默认起点,提供上述 OPD 基线及显式的 divergence、guidance、reference、routing/replay 配置。实现与运行证据分别记录在 [thinkmorph.md](thinkmorph.md);代码可执行、runtime 验证通过和学习有效性是三个不同结论。Reference/guidance 的权重仍须通过对照实验选择。

Xet Storage Details

Size:
34.9 kB
·
Xet hash:
e2d9794e3a5b87bd7758741113b8db625909d1b0f8cbff20dcd6d02091bbb94b

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.