← 教学文档主页 Ch1 扩散基础 Ch6 后训练 →
Ch 5 · WFM 预训练(§5)

预训练世界基础模型:扩散 & 自回归 & 评估

Tokenizer(Ch4)把视频压成 latent/token 后,WFM 在其上学"给定历史+条件预测未来"。Cosmos 造了两族:扩散 WFM(连续 token)和自回归 WFM(离散 token)。本章基于论文 §5 原文 + 架构原图。

承上启下:扩散原理见 Ch1;这里看 Cosmos 怎么把它做成视频世界模型。两族对应两种 tokenizer:扩散 ↔ 连续 CV8×8×8、自回归 ↔ 离散 DV8×16×16。

5.1 · 扩散 WFM(Diffusion-based)

Formulation(EDM 框架)§5.1.1

原文:"We build our diffusion-based WFM based on the EDM framework (Karras et al., 2022) ... corrupt a clean video latent x0 ... xσ = x0 + σε ... network Dθ is trained to predict the clean x0 ... objective E[λ(σ)‖Dθ(xσ;σ,c)−x0‖²]"
x_σ = x₀ + σε → loss = E[ λ(σ)·‖ D_θ(x_σ; σ, c) − x₀ ‖² ] (c=条件,如文本)

就是 Ch1 讲的扩散,EDM 版:连续 σ、预测干净 x₀、作用在 tokenizer 的连续 latent 上。推理:纯噪声 → ODE/SDE sampler 去噪 → 干净 latent → 解码器还原视频。

Architecture:DiT 去噪器 §5.1.2

原文:"our denoiser network Dθ ... builds upon DiT (Peebles & Xie, 2023) ... applies repeated blocks of self-attention, cross-attention (integrating input text), and feed-forward MLP layers, modulated by adaptive layer normalization (scale, shift, gate) for a given time step t."

拆解:

Diffusion WFM architecture
Figure 11(原文):Overall architecture of Cosmos-Predict1 World Foundation Model. The model processes an input video through the encoder of Cosmos-Tokenize1-CV8×8×8-720p ... perturbed with Gaussian noise ... 3D patchification ... repeated blocks of self-attention, cross-attention (integrating input text), and feed-forward MLP layers, modulated by adaptive layer normalization (scale, shift, gate) for a given time step t ...

Training Strategy §5.1.3

原文:"Joint image and video training ... interleaves batches of image and video data ... a domain-specific normalization scheme that aligns the latent distributions ... frame-wise and channel-wise standardization ... better approximate an isotropic Gaussian prior."

要点:① 图像+视频交替训(借海量图像数据);② latent 归一化(对齐图/视频分布、逐帧逐通道标准化 → 更接近各向同性高斯先验),带来"信噪比尺度不变"的训练稳定性。

5.2 · 自回归 WFM(Autoregressive-based)

Architecture:Transformer + 3D 位置编码 §5.2.1

原文:"modifications to the standard transformer ... 1) 3D-aware positional embeddings, 2) cross-attention to enable textual inputs ... 3) QK-Normalization ... encoding input video through the encoder of Cosmos-Tokenize1-DV8×16×16 to generate discrete tokens ... 3D RoPE ... cross-attention module that incorporates encoded text prompts (processed via a T5 text encoder)."

拆解:像 GPT 一样逐 token 预测离散视频 token,但加了三样:3D RoPE + 3D 绝对位置编码(让 token 知道自己在时/高/宽的位置)、cross-attention 接 T5 文本(可控)、QK-Norm(稳训练)。用离散 DV8×16×16 tokenizer。

Autoregressive WFM architecture
Figure 14(原文):Architecture of Cosmos-Predict1-Video2World Model ... encoding input video through the encoder of Cosmos-Tokenize1-DV8×16×16-720p to generate discrete tokens ... transformer blocks ... absolute positional embedding and 3D RoPE ... cross-attention module that incorporates encoded text prompts (processed via a T5 text encoder), followed by a two-layer MLP ...

Diffusion Decoder:给离散 token"去糊" §5.2.5

原文:"aggressive compression ... could lead to blurriness and visible artifacts ... especially in the autoregressive WFM ... where only a few integers ... We resort to the diffusion decoder ... by fine-tuning Cosmos-Predict1-7B-Text2Video."
这是重要的系统级细节(呼应 Ch4 的盲区):离散化压得狠 → 重建偏糊。Cosmos 把一个扩散模型微调成"解码器":训练时同一视频tokenize 两次(离散 DV8×16×16 当条件、连续 CV8×8×8 当目标),让扩散 decoder 把模糊的离散 token 精修成清晰视频。所以 AR 链路 = 自回归出 token + 扩散 decoder 精修两段式。
Diffusion decoder training
Figure 15(原文):Cosmos diffusion decoder training. During training, each input video is tokenized twice: one through the target discrete tokenizer (DV8×16×16) and the other through a less-constrained continuous tokenizer (CV8×8×8). The discrete token video is used as the conditional input to the diffusion denoiser.

5.3 · 评估:3D 一致性 + 物理对齐 §5.3

原文:"we evaluate our models on two aspects. First, ... the 3D consistency of the generated videos ... Second, ... the physics alignment ... how well the rendered dynamics adhere to the laws of physics."
维度怎么测(原文)为什么重要
3D 一致性RealEstate10K 选 500 静态场景视频,用多视图几何工具测生成视频是否几何自洽世界模型要模拟几何合理的 3D 世界,不能"穿帮"
物理对齐看生成动态是否符合物理定律(如运动、碰撞)Physical AI 的根本要求

论文也坦承:"Evaluation of WFMs is a highly nontrivial task ... We leave a more comprehensive evaluation as future work." —— 呼应 Ch4 盲区:像素重建好 ≠ 世界模型强,3D/物理一致性才是关键且难测。

physics rollouts
Figure 20(原文):Physics-scenario rollouts in simulation vs. pre-trained WFM ... reference (physically correct) simulation vs Cosmos-Predict1-7B-Video2World rollouts ... conditioned on 9 frames and a prompt focusing on the kinematic state of the simulated objects.

小结:两族 WFM 对照

扩散 WFM (§5.1)自回归 WFM (§5.2)
输入 token连续 latent (CV8×8×8)离散 token (DV8×16×16)
骨架DiT(去噪)Transformer(逐 token 预测)
条件self+cross-attn(text)+adaLN(t)3D RoPE/APE + cross-attn(T5) + QK-Norm
出图ODE/SDE 去噪 → 解码逐 token + diffusion decoder 精修
特点质量高可流式/实时,但需 decoder 去糊
诚实边界:本章 formulation/架构/训练/评估均引自论文 §5 原文(标注小节);DiT/adaLN/RoPE/T5/QK-Norm 为通用组件术语。原图 fig11/14/15/20(按 figs.json 校准)配逐字英文 caption。具体超参、层数、λ(σ) 权重论文未全列,以官方 cosmos-predict1 源码为准。