ICCV 2023 · DIFFUSION TRANSFORMER · 中文全文译稿

Scalable Diffusion Models
with Transformers

William Peebles · Saining XieUC Berkeley · New York University
01Patchifyspatial latent → token sequence
02adaLN-Zeroidentity initialization
03Scale Gflopsdepth · width · tokens
04Lower FID2.27 @ ImageNet 256²

这篇论文把问题从“扩散模型必须用 U-Net 吗”改写成“标准 Transformer 在 latent patch 上能否随 forward-pass Gflops 稳定扩展”,并用 12 个架构点、两种分辨率与完整附录给出经验答案。

PDF
25 页
Figures
33
Tables
6
Source blocks
174
References
63
Figure 1ORIGINAL EVIDENCE

采用 Transformer backbone 的扩散模型达到了 state-of-the-art 图像质量。 这里展示两个 class-conditional DiT-XL/2 模型的部分样本;它们分别在 ImageNet 的 512×512512\times512256×256256\times256 分辨率上训练。

摘要

我们探索了一类基于 Transformer 架构的新型扩散模型。我们训练图像 latent diffusion model,用在 latent patch 上运行的 Transformer 替代常用的 U-Net backbone。我们以 Gflops 衡量 forward pass complexity,并据此分析 Diffusion Transformer(DiT)的可扩展性。结果表明,无论是增加 Transformer 的深度/宽度,还是增加输入 token 数,Gflops 更高的 DiT 都持续取得更低的 FID。除了具备良好的扩展特性外,我们最大的 DiT-XL/2 模型还在 class-conditional ImageNet 512×512512\times512256×256256\times256 benchmark 上超过此前所有扩散模型,并在后者达到 state-of-the-art 的 2.27 FID。

1. 引言

在 Transformer 的推动下,机器学习正经历一场复兴。过去五年里,自然语言处理 []、视觉 [] 以及多个其他领域的神经网络架构,已在很大程度上被 Transformer 统一 []。不过,许多 image-level generative model 仍未跟上这一趋势:Transformer 虽已广泛用于 autoregressive model [],在其他生成建模框架中的采用却少得多。例如,扩散模型处于近年图像生成进展的前沿 [],但它们仍无一例外地把卷积 U-Net 当作事实上的 backbone。

Figure 2ORIGINAL EVIDENCE

Diffusion Transformer(DiT)的 ImageNet 生成结果。 气泡面积表示扩散模型的 flops。左:各个 DiT 模型训练 400K iteration 时的 FID-50K(越低越好);随着模型 flops 增加,FID 稳定改善。右:最佳模型 DiT-XL/2 具有较高的计算效率,并超过 ADM、LDM 等此前所有基于 U-Net 的扩散模型。

Ho 等人的奠基工作 [] 首次为扩散模型引入 U-Net backbone。U-Net 此前已在 pixel-level autoregressive model 与 conditional GAN [] 中取得成功;扩散模型从 PixelCNN++ [] 继承了这一结构,并做了少量修改。该模型是卷积式的,主要由 ResNet block [] 组成。与标准 U-Net [] 不同,它在较低分辨率处穿插额外的 spatial self-attention block,而 self-attention 正是 Transformer 的关键组件。Dhariwal 与 Nichol [] 消融了 U-Net 的多项架构选择,例如用 adaptive normalization layer [] 注入条件信息,以及卷积层的 channel 数。不过,Ho 等人提出的 U-Net 顶层设计此后基本保持不变。

本工作旨在澄清扩散模型中架构选择的意义,并为后续生成建模研究提供经验基线。我们表明,U-Net 的 inductive bias 并不是扩散模型性能的关键,它可以直接被 Transformer 等标准设计替换。因此,扩散模型很适合受益于近期的架构统一趋势:既能继承其他领域的最佳实践与训练配方,也能保留可扩展性、鲁棒性和效率等良好性质。标准化架构还会为跨领域研究打开新的可能。

本文聚焦一类基于 Transformer 的新型扩散模型,我们称之为 Diffusion Transformer,简称 DiT。DiT 遵循 Vision Transformer(ViT)[] 的最佳实践;已有研究表明,在视觉识别任务中,ViT 比 ResNet [] 等传统卷积网络更能有效扩展。

更具体地说,我们研究 Transformer 在“网络复杂度与样本质量”关系上的 scaling behavior。我们在 Latent Diffusion Model(LDM)[] 框架下构造并 benchmark DiT design space;该框架在 VAE latent space 中训练扩散模型。结果说明,U-Net backbone 可以成功替换为 Transformer。我们进一步证明 DiT 是可扩展的扩散模型架构:以 Gflops 衡量的网络复杂度,与以 FID 衡量的样本质量之间存在强相关。仅通过扩大 DiT 并用 118.6 Gflops 的高容量 backbone 训练 LDM,我们便在 class-conditional 256×256256\times256 ImageNet 生成 benchmark 上取得 state-of-the-art 的 2.27 FID。

2. 相关工作

Figure 3ORIGINAL EVIDENCE

Diffusion Transformer(DiT)架构。 左:训练 conditional latent DiT;输入 latent 被分解为 patch,再由多个 DiT block 处理。右:DiT block 的细节。我们实验了多种标准 Transformer block 变体,分别通过 adaptive layer norm、cross-attention 和额外输入 token 融入条件;adaptive layer norm 效果最好。

3. Diffusion Transformer

3.1 预备知识

扩散形式。 在介绍架构之前,先简要回顾理解扩散模型(DDPM)[] 所需的基本概念。Gaussian diffusion model 假设存在一个 forward noising process,逐步向真实数据 x0x_0 加噪:q(xtx0)=N(xt;αˉtx0,(1αˉt)I)q(x_t\mid x_0)=\mathcal{N}(x_t;\sqrt{\bar{\alpha}_t}x_0,(1-\bar{\alpha}_t)\mathbf{I}),其中常数 αˉt\bar{\alpha}_t 是超参数。利用 reparameterization trick,可以采样 xt=αˉtx0+1αˉtϵtx_t=\sqrt{\bar{\alpha}_t}x_0+\sqrt{1-\bar{\alpha}_t}\epsilon_t,其中 ϵtN(0,I)\epsilon_t\sim\mathcal{N}(0,\mathbf{I})

扩散模型通过学习 reverse process 来逆转 forward process 的破坏:pθ(xt1xt)=N(μθ(xt),Σθ(xt))p_\theta(x_{t-1}\mid x_t)=\mathcal{N}(\mu_\theta(x_t),\Sigma_\theta(x_t)),其中用神经网络预测 pθp_\theta 的统计量。reverse process model 以 x0x_0 的 log-likelihood 的 variational lower bound [] 训练;忽略一个与训练无关的附加项,它可化为 L(θ)=p(x0x1)+tDKL(q(xt1xt,x0)pθ(xt1xt))\mathcal{L}(\theta)=-p(x_0\mid x_1)+\sum_t\mathcal{D}_{KL}(q^*(x_{t-1}\mid x_t,x_0)\Vert p_\theta(x_{t-1}\mid x_t))。由于 qq^*pθp_\theta 都是 Gaussian,DKL\mathcal{D}_{KL} 可由两分布的均值和协方差求出。把 μθ\mu_\theta 重参数化为噪声预测网络 ϵθ\epsilon_\theta 后,可以用预测噪声 ϵθ(xt)\epsilon_\theta(x_t) 与真实采样噪声 ϵt\epsilon_t 的简单均方误差训练:Lsimple(θ)=ϵθ(xt)ϵt22\mathcal{L}_{\mathrm{simple}}(\theta)=\lVert\epsilon_\theta(x_t)-\epsilon_t\rVert_2^2。不过,要学习 reverse process covariance Σθ\Sigma_\theta,仍需优化完整的 DKL\mathcal{D}_{KL} 项。我们沿用 Nichol 与 Dhariwal [] 的方法:以 Lsimple\mathcal{L}_{\mathrm{simple}} 训练 ϵθ\epsilon_\theta,以完整的 L\mathcal{L} 训练 Σθ\Sigma_\theta。训练好 pθp_\theta 后,先初始化 xtmaxN(0,I)x_{t_{\max}}\sim\mathcal{N}(0,\mathbf{I}),再通过 reparameterization trick 从 pθ(xt1xt)p_\theta(x_{t-1}\mid x_t) 逐步采样新图像。

Classifier-free guidance。 Conditional diffusion model 会接收额外信息,例如类别标签 cc;reverse process 相应变为 pθ(xt1xt,c)p_\theta(x_{t-1}\mid x_t,c),其中 ϵθ\epsilon_\thetaΣθ\Sigma_\theta 都以 cc 为条件。Classifier-free guidance 让采样过程倾向寻找具有较高 logp(cx)\log p(c\mid x)xx []。由 Bayes rule,logp(cx)logp(xc)logp(x)\log p(c\mid x)\propto\log p(x\mid c)-\log p(x),因此 xlogp(cx)xlogp(xc)xlogp(x)\nabla_x\log p(c\mid x)\propto\nabla_x\log p(x\mid c)-\nabla_x\log p(x)。把扩散模型输出解释为 score function 后,可以使用 ϵ^θ(xt,c)=ϵθ(xt,)+s(ϵθ(xt,c)ϵθ(xt,))\hat{\epsilon}_\theta(x_t,c)=\epsilon_\theta(x_t,\emptyset)+s\cdot(\epsilon_\theta(x_t,c)-\epsilon_\theta(x_t,\emptyset)) 引导 DDPM 采样,其中 s>1s>1 是 guidance scale,而 s=1s=1 恢复标准采样。训练时随机丢弃 cc,并用可学习的“null” embedding \emptyset 替换,从而得到 c=c=\emptyset 的无条件预测。Classifier-free guidance 通常比普通采样显著提升样本质量 [],DiT 也遵循这一趋势。

Latent diffusion model。 直接在高分辨率 pixel space 训练扩散模型,计算成本可能高得难以承受。Latent diffusion model(LDM)[] 采用两阶段方案:(1)学习 autoencoder,用 encoder EE 把图像压缩为空间尺寸更小的表示;(2)冻结 EE,训练表示 z=E(x)z=E(x) 的扩散模型,而不是图像 xx 的扩散模型。生成时先从扩散模型采样 zz,再用 decoder 得到 x=D(z)x=D(z)

如 Figure 2 所示,LDM 只用 ADM 等 pixel-space diffusion model 的一小部分 Gflops 就能取得良好性能,因此很适合作为计算效率导向的架构探索起点。本文把 DiT 用在 latent space;当然,不改架构也可用于 pixel space。我们的图像生成 pipeline 因而是混合式的:使用现成的卷积 VAE 与基于 Transformer 的 DDPM。

3.2 Diffusion Transformer design space

我们提出 Diffusion Transformer(DiT),一种新的扩散模型架构。为保留标准 Transformer 的 scaling property,我们尽量忠实于其原始设计。由于研究对象是空间图像表示上的 DDPM,DiT 以处理 patch sequence 的 Vision Transformer(ViT)[] 为基础,并保留 ViT 的多项最佳实践。Figure 3 展示完整架构;下面介绍 DiT forward pass 以及 DiT 架构族 design space 的各组成部分。

Figure 4ORIGINAL EVIDENCE

DiT 的输入规格。 给定 patch size p×pp\times p,形状为 I×I×CI\times I\times C 的空间表示(VAE 输出并加噪后的 latent)被 patchify 成长度 T=(I/p)2T=(I/p)^2、hidden dimension 为 dd 的序列。更小的 pp 会产生更长的序列,因而需要更多 Gflops。

Patchify。 DiT 的输入是空间表示 zz;对于 256×256×3256\times256\times3 图像,zz 的形状为 32×32×432\times32\times4。第一层执行 patchify:对每个输入 patch 做线性 embedding,把空间输入转换成 TT 个维度为 dd 的 token;随后向所有 token 加入标准 ViT 的 sine-cosine positional embedding。Token 数 TT 由 patch size 超参数 pp 决定。如 Figure 4 所示,pp 减半会使 TT 变为四倍,因此 Transformer 总 Gflops 至少变为四倍;但改变 pp 基本不影响下游参数量。

我们把 p=2,4,8p=2,4,8 纳入 DiT design space。

DiT block 设计。 Patchify 之后,输入 token 由一系列 Transformer block 处理。除加噪图像外,扩散模型有时还处理 noise timestep tt、类别标签 cc、自然语言等条件信息。我们探索四种以不同方式处理条件输入的 Transformer block;它们对标准 ViT block 的修改虽小,却很重要,完整结构见 Figure 3。

In-context conditioning。 直接把 ttcc 的 vector embedding 作为两个额外 token 追加到输入序列中,与图像 token 同等处理。这类似 ViT 的 cls token,无需修改标准 ViT block。最后一个 block 之后,再从序列中移除条件 token。该方案新增的 Gflops 可以忽略。

Figure 5ORIGINAL EVIDENCE

不同 conditioning strategy 的比较。 adaLN-Zero 在训练的所有阶段都优于 cross-attention 与 in-context conditioning。

Cross-attention block。ttcc 的 embedding 拼成长度为 2、且独立于图像 token 的序列;在 multi-head self-attention 之后加入额外的 multi-head cross-attention layer。这类似 Vaswani 等人的原始设计 [],也类似 LDM 处理类别条件的方式。Cross-attention 新增 Gflops 最多,约为 15% overhead。

Adaptive layer norm(adaLN)block。 受 GAN [] 与 U-Net 扩散模型 [] 中 adaptive normalization layer [] 的广泛使用启发,我们用 adaLN 替换 Transformer block 的标准 LayerNorm。维度级 scale γ\gamma 和 shift β\beta 不再直接学习,而是由 ttcc embedding 之和回归得到。在前三种设计中,adaLN 新增的 Gflops 最少,因此计算效率最高;它也是唯一对所有 token 应用同一函数的 conditioning mechanism。

adaLN-Zero block。 以 identity function 初始化每个 residual block。已有 ResNet 工作表明这种初始化有益,例如 Goyal 等人 [] 把每个 block 最后一个 BatchNorm 的 scale factor γ\gamma 初始化为零,可加速大规模 supervised training;Diffusion U-Net 也在 residual connection 之前把每个 block 的最后卷积层初始化为零。我们对 adaLN 做类似修改:除回归 γ\gammaβ\beta 外,再回归维度级 scale α\alpha,并在每条 residual connection 之前立即应用。把 MLP 初始化为对所有 α\alpha 输出零向量,整个 DiT block 就被初始化为 identity function。与普通 adaLN 一样,adaLN-Zero 新增 Gflops 可忽略。

我们把 in-context、cross-attention、adaptive layer norm 与 adaLN-Zero 四种 block 纳入 DiT design space。

Table 1语义 HTML 转录

DiT 模型明细。 Small(S)、Base(B)与 Large(L)沿用 ViT [] 配置;另引入 XLarge(XL)作为最大模型。

模型层数 NNHidden size ddHead 数Gflops(I=32,p=4I=32,p=4
DiT-S1238461.4
DiT-B12768125.6
DiT-L2410241619.7
DiT-XL2811521629.1

模型规模。 我们串联 NN 个 DiT block,每个都在 hidden dimension dd 上运行。沿用 ViT,我们使用同时扩展 NNdd 与 attention head 数的标准 Transformer 配置 []:DiT-S、DiT-B、DiT-L 与 DiT-XL。它们覆盖从 0.3 到 118.6 Gflops 的广泛模型规模和 flop 分配,便于衡量 scaling performance;配置明细见 Table 1。

我们把 S、B、L、XL 四档加入 DiT design space。

Transformer decoder。 最后一个 DiT block 之后,需要把 image token sequence 解码为输出噪声预测与对角协方差预测;两者形状都与原始空间输入一致。我们使用标准 linear decoder:先应用最终 LayerNorm(若使用 adaLN,则为 adaptive LayerNorm),再把每个 token 线性解码成 p×p×2Cp\times p\times 2C tensor,其中 CC 是 DiT 空间输入的 channel 数;最后,把解码后的 token 重排回原空间布局,得到预测噪声与协方差。

完整 DiT design space 包含 patch size、Transformer block 架构与模型规模。

4. 实验设置

我们探索 DiT design space,并研究这一模型族的 scaling property。模型名称由配置和 latent patch size pp 组成;例如 DiT-XL/2 表示 XLarge 配置且 p=2p=2

训练。 我们在竞争激烈的生成建模 benchmark ImageNet [] 上,训练 256×256256\times256512×512512\times512 分辨率的 class-conditional latent DiT。最终 linear layer 初始化为零,其余部分采用标准 ViT weight initialization;所有模型都使用 AdamW []。

Figure 6ORIGINAL EVIDENCE

扩展 DiT 模型会在训练的所有阶段改善 FID。 图中展示 12 个 DiT 模型随训练 iteration 变化的 FID-50K。上排:固定 patch size,比较不同模型规模。下排:固定模型规模,比较不同 patch size。无论模型规模与 patch size 如何,扩大 Transformer backbone 都得到更好的生成模型。

学习率恒为 1×1041\times10^{-4},不使用 weight decay,batch size 为 256;唯一的数据增强是 horizontal flip。不同于许多 ViT 工作 [],DiT 不需要 learning-rate warmup 或 regularization 就能达到高性能。即便不用这些技术,所有配置的训练都很稳定,也没有观察到 Transformer 训练中常见的 loss spike。遵循生成建模惯例,我们以 0.9999 的 decay 对 DiT 权重维护 exponential moving average(EMA),所有报告结果都使用 EMA 模型。所有规模和 patch size 共用完全相同的超参数,且训练设置几乎全部沿用 ADM。我们没有调 learning rate、decay/warm-up schedule、Adam β1/β2\beta_1/\beta_2 或 weight decay。

扩散。 我们使用 Stable Diffusion [] 的现成预训练 VAE []。VAE encoder 的 downsample factor 为 8:形状 256×256×3256\times256\times3 的 RGB 图像 xxz=E(x)z=E(x) 后,形状变为 32×32×432\times32\times4。本节所有扩散模型都在这个 Z\mathcal{Z}-space 上运行;采样新 latent 后,再用 x=D(z)x=D(z) 解码回像素。扩散超参数沿用 ADM []:tmax=1000t_{\max}=1000,linear variance schedule 从 1×1041\times10^{-4}2×1022\times10^{-2},协方差 Σθ\Sigma_\theta 的参数化,以及 timestep 与 label embedding 方法也均沿用 ADM。

评估指标。 我们用 Fréchet Inception Distance(FID)[] 衡量 scaling performance,这是图像生成的标准指标。

与先前工作比较时,遵循惯例报告用 250 个 DDPM sampling step 得到的 FID-50K。FID 对实现细节十分敏感 [];为保证比较准确,本文所有数值都先导出样本,再用 ADM 的 TensorFlow evaluation suite [] 计算。除非特别说明,本节 FID 不使用 classifier-free guidance。另报告 Inception Score []、sFID [] 与 Precision/Recall [] 作为次要指标。

计算。 所有模型均以 JAX [] 实现,并在 TPU-v3 pod 上训练。计算量最大的 DiT-XL/2 在 TPU v3-256 pod、global batch size 256 下的训练速度约为每秒 5.7 iteration。

5. 实验

DiT block 设计。 我们训练四个高 Gflop 的 DiT-XL/2,分别使用 in-context(119.4 Gflops)、cross-attention(137.6 Gflops)、adaptive layer norm(adaLN,118.6 Gflops)或 adaLN-Zero(118.6 Gflops),并在训练过程中测量 FID。Figure 5 表明,adaLN-Zero 的 FID 低于 cross-attention 与 in-context,同时计算效率最高。训练 400K iteration 时,adaLN-Zero 的 FID 几乎只有 in-context 的一半,说明 conditioning mechanism 对模型质量至关重要。初始化同样重要:把每个 DiT block 初始化为 identity function 的 adaLN-Zero,显著优于普通 adaLN。本文余下所有模型都使用 adaLN-Zero DiT block。

Figure 7ORIGINAL EVIDENCE

提高 Transformer forward pass 的 Gflops 会提升样本质量。 建议放大查看。12 个 DiT 模型均在训练 400K step 后,使用相同的输入 latent noise 与类别标签采样。无论通过增加 Transformer 深度/宽度,还是增加输入 token 数来提高 Gflops,视觉保真度都会显著改善。

Figure 8ORIGINAL EVIDENCE

Transformer Gflops 与 FID 强相关。 图中把每个 DiT 模型的 Gflops,与其训练 400K step 后的 FID-50K 对应起来。

Figure 9ORIGINAL EVIDENCE

更大的 DiT 模型能更高效地利用大规模计算。 图中绘制 FID 随总训练计算量的变化。

扩展模型规模与 patch size。 我们训练 12 个 DiT,遍历 S、B、L、XL 四档配置以及 8、4、2 三种 patch size。DiT-L 与 DiT-XL 的相对 Gflops 比其他相邻档更接近。Figure 2 左图概括了每个模型的 Gflops 与训练 400K iteration 后的 FID;所有情况下,增大模型、减小 patch size 都显著改善扩散模型。

Figure 6 上排固定 patch size:加深、加宽 Transformer 在所有训练阶段都降低 FID;下排固定模型规模:仅减少 patch size、增加 DiT 处理的 token 数,同样持续降低 FID,而参数量近似不变。

DiT Gflops 是性能提升的关键。 Figure 6 说明参数量不能唯一决定 DiT 质量。固定模型规模并减小 patch size 时,Transformer 总参数几乎不变(实际略微减少),只有 Gflops 增加,性能却提升。这表明真正关键的是扩展模型 Gflops。Figure 8 把训练 400K step 的 FID-50K 与 Gflops 对照:不同配置只要总 Gflops 相近,就得到相似 FID,例如 DiT-S/2 与 DiT-B/4。模型 Gflops 与 FID-50K 呈强负相关,说明更多模型计算是改进 DiT 的关键因素。附录 Figure 12 表明,这一趋势在 Inception Score 等其他指标上也成立。

更大的 DiT 模型具有更高计算效率。 Figure 9 以总训练计算量为横轴绘制所有 DiT 的 FID。训练计算量估为 Gflops×batch size×training steps×3\mathrm{Gflops}\times\mathrm{batch\ size}\times\mathrm{training\ steps}\times3;系数 3 近似认为 backward pass 的计算量是 forward pass 的两倍。小 DiT 即便训练更久,最终也会比训练 step 更少的大模型更低效。即使两模型仅 patch size 不同,在控制训练 Gflops 后,性能曲线仍不同;例如约在 101010^{10} Gflops 后,XL/2 开始超过 XL/4。

可视化 scaling。 Figure 7 直观展示 scaling 对样本质量的影响。训练 400K step 后,我们从 12 个 DiT 分别采样,且使用完全相同的起始噪声 xtmaxx_{t_{\max}}、sampling noise 与类别标签。因此可以直接观察 scaling 的影响:扩大模型规模以及增加 token 数,都明显提升视觉质量。

5.1 State-of-the-art 扩散模型

256×256256\times256 ImageNet。 完成 scaling analysis 后,我们把最高 Gflop 的 DiT-XL/2 继续训练至 7M step,并与 state-of-the-art class-conditional generative model 比较,结果见 Table 2。使用 classifier-free guidance 后,DiT-XL/2 超过此前所有扩散模型,把 LDM 的最佳 FID-50K 从 3.60 降至 2.27。Figure 2 右图还表明,118.6 Gflops 的 DiT-XL/2 相较 latent-space U-Net LDM-4(103.6 Gflops)具有竞争力,且远比 pixel-space U-Net ADM(1120 Gflops)与 ADM-U(742 Gflops)高效。

Table 2语义 HTML 转录

在 ImageNet 256×256256\times256 上 benchmark class-conditional 图像生成。 DiT-XL/2 达到 state-of-the-art FID。

Class-conditional ImageNet 256×256256\times256
模型FID \downarrowsFID \downarrowIS \uparrowPrecision \uparrowRecall \uparrow
BigGAN-deep []6.957.36171.40.870.28
StyleGAN-XL []2.304.02265.120.780.53
ADM []10.946.02100.980.690.63
ADM-U7.495.13127.490.720.63
ADM-G4.595.25186.700.820.52
ADM-G, ADM-U3.946.14215.840.830.53
CDM []4.88158.71
LDM-8 []15.5179.030.650.63
LDM-8-G7.76209.520.840.35
LDM-410.56103.490.710.62
LDM-4-G(cfg=1.25)3.95178.220.810.55
LDM-4-G(cfg=1.50)3.60247.670.870.48
DiT-XL/29.626.85121.500.670.67
DiT-XL/2-G(cfg=1.25)3.225.28201.770.760.62
DiT-XL/2-G(cfg=1.50)2.274.60278.240.830.57
Table 3语义 HTML 转录

在 ImageNet 512×512512\times512 上 benchmark class-conditional 图像生成。 先前工作 [] 在该分辨率上用 1000 个真实样本测 Precision 与 Recall;为保持一致,本文也这样做。

Class-conditional ImageNet 512×512512\times512
模型FID \downarrowsFID \downarrowIS \uparrowPrecision \uparrowRecall \uparrow
BigGAN-deep []8.438.13177.900.880.29
StyleGAN-XL []2.414.06267.750.770.52
ADM []23.2410.1958.060.730.60
ADM-U9.965.62121.780.750.64
ADM-G7.726.57172.710.870.42
ADM-G, ADM-U3.855.86221.720.840.53
DiT-XL/212.037.12105.250.750.64
DiT-XL/2-G(cfg=1.25)4.645.77174.770.810.57
DiT-XL/2-G(cfg=1.50)3.045.02240.820.840.54

我们的方法取得此前所有生成模型中最低的 FID,包括先前 state-of-the-art 的 StyleGAN-XL []。此外,所有测试过的 classifier-free guidance scale 上,DiT-XL/2 的 recall 都高于 LDM-4 与 LDM-8。即便只训练 2.35M step(与 ADM 相近),XL/2 仍以 2.55 FID 超过此前所有扩散模型。

512×512512\times512 ImageNet。 我们用与 256×256256\times256 模型相同的超参数,在 ImageNet 512×512512\times512 上训练新的 DiT-XL/2 3M iteration。Patch size 为 2 时,把 64×64×464\times64\times4 输入 latent patchify 后会得到 1024 个 token,计算量 524.6 Gflops。Table 3 表明 XL/2 再次超过该分辨率下所有先前扩散模型,把 ADM 的最佳 FID 3.85 降至 3.04。即使 token 数增加,XL/2 仍计算高效:ADM 使用 1983 Gflops,ADM-U 使用 2813 Gflops,而 XL/2 只用 524.6 Gflops。高分辨率样本见 Figure 1 与附录。

Figure 10ORIGINAL EVIDENCE

增加 sampling compute 无法弥补 model compute 不足。 对每个训练 400K iteration 的 DiT,分别用 16、32、64、128、256、1000 个 sampling step 计算 FID-10K,并同时绘制 FID 与生成单张图像消耗的 Gflops。即使小模型在 test time 使用比大模型更多的 Gflops,也无法缩小性能差距。

5.2 扩展 model compute 与 sampling compute

扩散模型的独特之处在于:训练结束后,仍可通过增加生成时的 sampling step 使用更多计算。鉴于 model Gflops 对样本质量影响很大,我们检验小 model compute 的 DiT 能否靠更多 sampling compute 超过大模型。12 个模型都在训练 400K step 后,以每张图像 16、32、64、128、256、1000 个 sampling step 计算 FID,主结果见 Figure 10。比较使用 1000 step 的 DiT-L/2 与使用 128 step 的 DiT-XL/2:L/2 每张图像耗 80.7 Tflops;XL/2 的计算量少 5 倍,仅 15.2 Tflops,但 FID-10K 反而更好(23.7 vs. 25.9)。总体而言,增加 sampling compute 不能弥补 model compute 不足。

6. 结论

我们提出 Diffusion Transformer(DiT):一种简单的 Transformer-based diffusion backbone。它超过先前 U-Net 模型,并继承 Transformer 架构族优异的 scaling property。基于本文有希望的 scaling 结果,后续工作应继续把 DiT 扩展到更大模型和更多 token;DiT 也可作为 DALL·E 2、Stable Diffusion 等 text-to-image model 的 drop-in backbone。

致谢。 感谢 Kaiming He、Ronghang Hu、Alexander Berg、Shoubhik Debnath、Tim Brooks、Ilija Radosavovic 与 Tete Xiao 的有益讨论。William Peebles 得到 NSF GRFP 资助。

参考文献

参考文献按原论文编号与英文书目信息完整保留。

  1. James Bradbury, Roy Frostig, Peter Hawkins, Matthew James Johnson, Chris Leary, Dougal Maclaurin, George Necula, Adam Paszke, Jake VanderPlas, Skye Wanderman-Milne, and Qiao Zhang. JAX: composable transformations of Python+NumPy programs, 2018.
  2. Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale GAN training for high fidelity natural image synthesis. In ICLR, 2019.
  3. Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. In NeurIPS, 2020.
  4. Huiwen Chang, Han Zhang, Lu Jiang, Ce Liu, and William T Freeman. Maskgit: Masked generative image transformer. In CVPR, pages 11315--11325, 2022.
  5. Lili Chen, Kevin Lu, Aravind Rajeswaran, Kimin Lee, Aditya Grover, Misha Laskin, Pieter Abbeel, Aravind Srinivas, and Igor Mordatch. Decision transformer: Reinforcement learning via sequence modeling. In NeurIPS, 2021.
  6. Mark Chen, Alec Radford, Rewon Child, Jeffrey Wu, Heewoo Jun, David Luan, and Ilya Sutskever. Generative pretraining from pixels. In ICML, 2020.
  7. Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers. arXiv preprint arXiv:1904.10509, 2019.
  8. Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In NAACL-HCT, 2019.
  9. Prafulla Dhariwal and Alexander Nichol. Diffusion models beat gans on image synthesis. In NeurIPS, 2021.
  10. Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. In ICLR, 2020.
  11. Patrick Esser, Robin Rombach, and Björn Ommer. Taming transformers for high-resolution image synthesis, 2020.
  12. Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In NIPS, 2014.
  13. Priya Goyal, Piotr Dollár, Ross Girshick, Pieter Noordhuis, Lukasz Wesolowski, Aapo Kyrola, Andrew Tulloch, Yangqing Jia, and Kaiming He. Accurate, large minibatch sgd: Training imagenet in 1 hour. arXiv:1706.02677, 2017.
  14. Shuyang Gu, Dong Chen, Jianmin Bao, Fang Wen, Bo Zhang, Dongdong Chen, Lu Yuan, and Baining Guo. Vector quantized diffusion model for text-to-image synthesis. In CVPR, pages 10696--10706, 2022.
  15. Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
  16. Dan Hendrycks and Kevin Gimpel. Gaussian error linear units (gelus). arXiv preprint arXiv:1606.08415, 2016.
  17. Tom Henighan, Jared Kaplan, Mor Katz, Mark Chen, Christopher Hesse, Jacob Jackson, Heewoo Jun, Tom B Brown, Prafulla Dhariwal, Scott Gray, et al. Scaling laws for autoregressive generative modeling. arXiv preprint arXiv:2010.14701, 2020.
  18. Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. 2017.
  19. Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. In NeurIPS, 2020.
  20. Jonathan Ho, Chitwan Saharia, William Chan, David J Fleet, Mohammad Norouzi, and Tim Salimans. Cascaded diffusion models for high fidelity image generation. arXiv:2106.15282, 2021.
  21. Jonathan Ho and Tim Salimans. Classifier-free diffusion guidance. In NeurIPS 2021 Workshop on Deep Generative Models and Downstream Applications, 2021.
  22. Aapo Hyvärinen and Peter Dayan. Estimation of non-normalized statistical models by score matching. Journal of Machine Learning Research, 6(4), 2005.
  23. Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1125--1134, 2017.
  24. Allan Jabri, David Fleet, and Ting Chen. Scalable adaptive computation for iterative generation. arXiv preprint arXiv:2212.11972, 2022.
  25. Michael Janner, Qiyang Li, and Sergey Levine. Offline reinforcement learning as one big sequence modeling problem. In NeurIPS, 2021.
  26. Jared Kaplan, Sam McCandlish, Tom Henighan, Tom B Brown, Benjamin Chess, Rewon Child, Scott Gray, Alec Radford, Jeffrey Wu, and Dario Amodei. Scaling laws for neural language models. arXiv:2001.08361, 2020.
  27. Tero Karras, Miika Aittala, Timo Aila, and Samuli Laine. Elucidating the design space of diffusion-based generative models. In Proc. NeurIPS, 2022.
  28. Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In CVPR, 2019.
  29. Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015.
  30. Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
  31. Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In NeurIPS, 2012.
  32. Tuomas Kynkäänniemi, Tero Karras, Samuli Laine, Jaakko Lehtinen, and Timo Aila. Improved precision and recall metric for assessing generative models. In NeurIPS, 2019.
  33. Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. arXiv:1711.05101, 2017.
  34. Charlie Nash, Jacob Menick, Sander Dieleman, and Peter W Battaglia. Generating images with sparse representations. arXiv preprint arXiv:2103.03841, 2021.
  35. Alex Nichol, Prafulla Dhariwal, Aditya Ramesh, Pranav Shyam, Pamela Mishkin, Bob McGrew, Ilya Sutskever, and Mark Chen. Glide: Towards photorealistic image generation and editing with text-guided diffusion models. arXiv:2112.10741, 2021.
  36. Alexander Quinn Nichol and Prafulla Dhariwal. Improved denoising diffusion probabilistic models. In ICML, 2021.
  37. Gaurav Parmar, Richard Zhang, and Jun-Yan Zhu. On aliased resizing and surprising subtleties in gan evaluation. In CVPR, 2022.
  38. Niki Parmar, Ashish Vaswani, Jakob Uszkoreit, Lukasz Kaiser, Noam Shazeer, Alexander Ku, and Dustin Tran. Image transformer. In International conference on machine learning, pages 4055--4064. PMLR, 2018.
  39. William Peebles, Ilija Radosavovic, Tim Brooks, Alexei Efros, and Jitendra Malik. Learning to learn with generative models of neural network checkpoints. arXiv preprint arXiv:2209.12892, 2022.
  40. Ethan Perez, Florian Strub, Harm De Vries, Vincent Dumoulin, and Aaron Courville. Film: Visual reasoning with a general conditioning layer. In AAAI, 2018.
  41. Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In ICML, 2021.
  42. Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding by generative pre-training. 2018.
  43. Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. Language models are unsupervised multitask learners. 2019.
  44. Ilija Radosavovic, Justin Johnson, Saining Xie, Wan-Yen Lo, and Piotr Dollár. On network design spaces for visual recognition. In ICCV, 2019.
  45. Ilija Radosavovic, Raj Prateek Kosaraju, Ross Girshick, Kaiming He, and Piotr Dollár. Designing network design spaces. In CVPR, 2020.
  46. Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, and Mark Chen. Hierarchical text-conditional image generation with clip latents. arXiv:2204.06125, 2022.
  47. Aditya Ramesh, Mikhail Pavlov, Gabriel Goh, Scott Gray, Chelsea Voss, Alec Radford, Mark Chen, and Ilya Sutskever. Zero-shot text-to-image generation. In ICML, 2021.
  48. Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. High-resolution image synthesis with latent diffusion models. In CVPR, 2022.
  49. Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical image computing and computer-assisted intervention, pages 234--241. Springer, 2015.
  50. Chitwan Saharia, William Chan, Saurabh Saxena, Lala Li, Jay Whang, Emily Denton, Seyed Kamyar Seyed Ghasemipour, Burcu Karagol Ayan, S. Sara Mahdavi, Rapha Gontijo Lopes, Tim Salimans, Jonathan Ho, David J Fleet, and Mohammad Norouzi. Photorealistic text-to-image diffusion models with deep language understanding. arXiv:2205.11487, 2022.
  51. Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, Xi Chen, and Xi Chen. Improved techniques for training GANs. In NeurIPS, 2016.
  52. Tim Salimans, Andrej Karpathy, Xi Chen, and Diederik P Kingma. PixelCNN++: Improving the pixelcnn with discretized logistic mixture likelihood and other modifications. arXiv preprint arXiv:1701.05517, 2017.
  53. Axel Sauer, Katja Schwarz, and Andreas Geiger. Stylegan-xl: Scaling stylegan to large diverse datasets. In SIGGRAPH, 2022.
  54. Jascha Sohl-Dickstein, Eric Weiss, Niru Maheswaranathan, and Surya Ganguli. Deep unsupervised learning using nonequilibrium thermodynamics. In ICML, 2015.
  55. Jiaming Song, Chenlin Meng, and Stefano Ermon. Denoising diffusion implicit models. arXiv:2010.02502, 2020.
  56. Yang Song and Stefano Ermon. Generative modeling by estimating gradients of the data distribution. In NeurIPS, 2019.
  57. Andreas Steiner, Alexander Kolesnikov, Xiaohua Zhai, Ross Wightman, Jakob Uszkoreit, and Lucas Beyer. How to train your ViT? data, augmentation, and regularization in vision transformers. TMLR, 2022.
  58. Aaron Van den Oord, Nal Kalchbrenner, Lasse Espeholt, Oriol Vinyals, Alex Graves, et al. Conditional image generation with pixelcnn decoders. Advances in neural information processing systems, 29, 2016.
  59. Aaron Van Den Oord, Oriol Vinyals, et al. Neural discrete representation learning. Advances in neural information processing systems, 30, 2017.
  60. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NeurIPS, 2017.
  61. Tete Xiao, Piotr Dollar, Mannat Singh, Eric Mintun, Trevor Darrell, and Ross Girshick. Early convolutions help transformers see better. In NeurIPS, 2021.
  62. Jiahui Yu, Yuanzhong Xu, Jing Yu Koh, Thang Luong, Gunjan Baid, Zirui Wang, Vijay Vasudevan, Alexander Ku, Yinfei Yang, Burcu Karagol Ayan, et al. Scaling autoregressive models for content-rich text-to-image generation. arXiv:2206.10789, 2022.
  63. Xiaohua Zhai, Alexander Kolesnikov, Neil Houlsby, and Lucas Beyer. Scaling vision transformers. In CVPR, 2022.
SUPPLEMENTARY MATERIAL附录与完整样本
Figure 11ORIGINAL EVIDENCE

DiT-XL/2 的更多精选样本。 样本来自 512×512512\times512256×256256\times256 两个分辨率的模型;前者使用 classifier-free guidance scale 6.0,后者使用 4.0。二者均使用 ft-EMA VAE decoder。

附录 A:更多实现细节

Table 4 汇总所有 DiT 模型的详细信息,包括 256×256256\times256512×512512\times512 两种分辨率。Figure 13 报告 DiT training loss curve;Table 6 列出 ADM 与 LDM 的 DDPM U-Net Gflop 数。

DiT 模型细节。 输入 timestep 先使用 256 维 frequency embedding [],再经过一个 two-layer MLP;MLP 维度等于 Transformer hidden size,activation 为 SiLU。每个 adaLN layer 把 timestep embedding 与类别 embedding 之和送入 SiLU 和 linear layer;linear layer 的输出神经元数,对于 adaLN 是 hidden size 的 4×4\times,对于 adaLN-Zero 是 6×6\times。核心 Transformer 使用 GELU nonlinearity,并以 tanh 近似 []。

仅在部分 channel 上做 classifier-free guidance。 实验中 guidance 只施加到 latent 的前三个 channel,而不是全部四个。进一步调查发现,只要调整 scale factor,three-channel 与 four-channel guidance 的 FID 相近:three-channel 的 scale 1+x1+x,大致可由 four-channel 的 1+34x1+\frac{3}{4}x 近似。例如 three-channel scale 1.5 的 FID-50K 为 2.27;four-channel scale 1.375 的 FID-50K 为 2.20。只对部分元素施加 guidance 仍能得到良好性能,这一点颇有意思,留待未来研究。

附录 B:模型样本

这里展示两个 DiT-XL/2 的样本:512×512512\times512 模型训练 3M step,256×256256\times256 模型训练 7M step。Figures 1 与 11 是两个模型的精选样本;Figures 14–33 则给出不同 classifier-free guidance scale 与类别标签下的未筛选样本,均使用 250 个 DDPM sampling step 与 ft-EMA VAE decoder 生成。与其他 guidance 工作一致,更大的 scale 会提高视觉保真度,同时降低样本多样性。

Table 4语义 HTML 转录

所有 DiT 模型的明细。 FID-50K 均在不使用 classifier-free guidance 时计算;参数量与 flop 不含 84M 参数的 VAE。两个分辨率的 DiT-XL/2 都未观察到 FID 饱和。表中数值使用 ft-MSE VAE decoder。

模型图像分辨率Flops(G)参数量(M)训练 step(K)Batch sizeLearning rateDiT blockFID-50K(无 guidance)
DiT-S/8256×256256\times2560.36334002561×1041\times10^{-4}adaLN-Zero153.60
DiT-S/4256×256256\times2561.41334002561×1041\times10^{-4}adaLN-Zero100.41
DiT-S/2256×256256\times2566.06334002561×1041\times10^{-4}adaLN-Zero68.40
DiT-B/8256×256256\times2561.421314002561×1041\times10^{-4}adaLN-Zero122.74
DiT-B/4256×256256\times2565.561304002561×1041\times10^{-4}adaLN-Zero68.38
DiT-B/2256×256256\times25623.011304002561×1041\times10^{-4}adaLN-Zero43.47
DiT-L/8256×256256\times2565.014594002561×1041\times10^{-4}adaLN-Zero118.87
DiT-L/4256×256256\times25619.704584002561×1041\times10^{-4}adaLN-Zero45.64
DiT-L/2256×256256\times25680.714584002561×1041\times10^{-4}adaLN-Zero23.33
DiT-XL/8256×256256\times2567.396764002561×1041\times10^{-4}adaLN-Zero106.41
DiT-XL/4256×256256\times25629.056754002561×1041\times10^{-4}adaLN-Zero43.01
DiT-XL/2256×256256\times256118.646754002561×1041\times10^{-4}adaLN-Zero19.47
DiT-XL/2256×256256\times256119.374494002561×1041\times10^{-4}in-context35.24
DiT-XL/2256×256256\times256137.625984002561×1041\times10^{-4}cross-attention26.14
DiT-XL/2256×256256\times256118.566004002561×1041\times10^{-4}adaLN25.21
DiT-XL/2256×256256\times256118.6467523522561×1041\times10^{-4}adaLN-Zero10.67
DiT-XL/2256×256256\times256118.6467570002561×1041\times10^{-4}adaLN-Zero9.62
DiT-XL/2512×512512\times512524.6067513012561×1041\times10^{-4}adaLN-Zero13.78
DiT-XL/2512×512512\times512524.6067530002561×1041\times10^{-4}adaLN-Zero11.93

附录 C:更多 scaling 结果

Scaling 对 FID 之外指标的影响。 Figure 12 展示 DiT scale 对 FID、sFID、Inception Score、Precision 与 Recall 的影响。主文以 FID 为中心的分析可以推广到其他指标:在每项指标上,更大的 DiT 都更具计算效率,model Gflops 与性能高度相关。特别是 Inception Score 与 Precision,会显著受益于更大模型规模。

Scaling 对 training loss 的影响。 Figure 13 检查 scale 对 training loss 的影响。通过扩大 Transformer 或增加输入 token 数来提高 DiT Gflops,会使 training loss 下降得更快,并在更低值处饱和。这与 language model 中的趋势一致:扩大 Transformer 同时改善 loss curve 与 downstream evaluation []。

附录 D:VAE decoder 消融

所有实验使用现成的预训练 VAE。ft-MSE 与 ft-EMA 都是在原始 LDM “f8” 模型上 fine-tune 得到的版本,且只 fine-tune decoder 权重。Section 5 的 scaling analysis 用 ft-MSE decoder 监控指标;Tables 2、3 的最终指标使用 ft-EMA decoder。这里消融三种 decoder:LDM 原始版本,以及 Stable Diffusion 使用的两个 fine-tuned decoder。由于各模型的 encoder 完全相同,decoder 可以直接替换而无需重新训练 diffusion model。Table 5 表明,即使使用 LDM decoder,XL/2 仍超过此前所有扩散模型。

Table 5语义 HTML 转录

Decoder 消融。 三种预训练 VAE decoder 权重在 ImageNet 256×256256\times256 上得到相近结果。

Class-conditional ImageNet 256×256256\times256,DiT-XL/2-G(cfg=1.5)
DecoderFID \downarrowsFID \downarrowIS \uparrowPrecision \uparrowRecall \uparrow
original2.465.18271.560.820.57
ft-MSE2.304.73276.090.830.57
ft-EMA2.274.60278.240.830.57
Table 6语义 HTML 转录

使用 U-Net backbone 的 baseline diffusion model 的 Gflop 数。 这里只计算 DDPM 组件的 flops。

Diffusion U-Net 模型复杂度
模型图像分辨率Base flops(G)Upsampler flops(G)总 flops(G)
ADM128×128128\times128307307
ADM256×256256\times25611201120
ADM512×512512\times51219831983
ADM-U256×256256\times256110632742
ADM-U512×512512\times51230725062813
LDM-4256×256256\times256104104
LDM-8256×256256\times2565757
Figure 12ORIGINAL EVIDENCE

DiT 在多项生成指标上的 scaling behavior。 左:FID、sFID、Inception Score、Precision 与 Recall 随总训练计算量变化。右:12 个 DiT 训练 400K step 后的性能与 Transformer Gflops,所有指标都呈强相关。数值均使用 ft-MSE VAE decoder。

Figure 13ORIGINAL EVIDENCE

所有 DiT 的 training loss curve。 loss 是噪声预测均方误差与 DKL\mathcal{D}_{KL} 之和;图中还突出显示早期训练行为。扩大后的 DiT 具有更低的 training loss。

Figure 14UNCURATED SAMPLE

未经筛选的 512times512512\\times512 DiT-XL/2 样本。 Classifier-free guidance scale = 4.0;类别标签为“arctic wolf”(270)。

Figure 15UNCURATED SAMPLE

未经筛选的 512times512512\\times512 DiT-XL/2 样本。 Classifier-free guidance scale = 4.0;类别标签为“volcano”(980)。

Figure 16UNCURATED SAMPLE

未经筛选的 512times512512\\times512 DiT-XL/2 样本。 Classifier-free guidance scale = 4.0;类别标签为“husky”(250)。

Figure 17UNCURATED SAMPLE

未经筛选的 512times512512\\times512 DiT-XL/2 样本。 Classifier-free guidance scale = 4.0;类别标签为“sulphur-crested cockatoo”(89)。

Figure 18UNCURATED SAMPLE

未经筛选的 512times512512\\times512 DiT-XL/2 样本。 Classifier-free guidance scale = 4.0;类别标签为“cliff drop-off”(972)。

Figure 19UNCURATED SAMPLE

未经筛选的 512times512512\\times512 DiT-XL/2 样本。 Classifier-free guidance scale = 4.0;类别标签为“balloon”(417)。

Figure 20UNCURATED SAMPLE

未经筛选的 512times512512\\times512 DiT-XL/2 样本。 Classifier-free guidance scale = 4.0;类别标签为“lion”(291)。

Figure 21UNCURATED SAMPLE

未经筛选的 512times512512\\times512 DiT-XL/2 样本。 Classifier-free guidance scale = 4.0;类别标签为“otter”(360)。

Figure 22UNCURATED SAMPLE

未经筛选的 512times512512\\times512 DiT-XL/2 样本。 Classifier-free guidance scale = 2.0;类别标签为“red panda”(387)。

Figure 23UNCURATED SAMPLE

未经筛选的 512times512512\\times512 DiT-XL/2 样本。 Classifier-free guidance scale = 2.0;类别标签为“panda”(388)。

Figure 24UNCURATED SAMPLE

未经筛选的 512times512512\\times512 DiT-XL/2 样本。 Classifier-free guidance scale = 1.5;类别标签为“coral reef”(973)。

Figure 25UNCURATED SAMPLE

未经筛选的 512times512512\\times512 DiT-XL/2 样本。 Classifier-free guidance scale = 1.5;类别标签为“macaw”(88)。

Figure 26UNCURATED SAMPLE

未经筛选的 256times256256\\times256 DiT-XL/2 样本。 Classifier-free guidance scale = 4.0;类别标签为“macaw”(88)。

Figure 27UNCURATED SAMPLE

未经筛选的 256times256256\\times256 DiT-XL/2 样本。 Classifier-free guidance scale = 4.0;类别标签为“dog sled”(537)。

Figure 28UNCURATED SAMPLE

未经筛选的 256times256256\\times256 DiT-XL/2 样本。 Classifier-free guidance scale = 4.0;类别标签为“arctic fox”(279)。

Figure 29UNCURATED SAMPLE

未经筛选的 256times256256\\times256 DiT-XL/2 样本。 Classifier-free guidance scale = 4.0;类别标签为“loggerhead sea turtle”(33)。

Figure 30UNCURATED SAMPLE

未经筛选的 256times256256\\times256 DiT-XL/2 样本。 Classifier-free guidance scale = 2.0;类别标签为“golden retriever”(207)。

Figure 31UNCURATED SAMPLE

未经筛选的 256times256256\\times256 DiT-XL/2 样本。 Classifier-free guidance scale = 2.0;类别标签为“lake shore”(975)。

Figure 32UNCURATED SAMPLE

未经筛选的 256times256256\\times256 DiT-XL/2 样本。 Classifier-free guidance scale = 1.5;类别标签为“space shuttle”(812)。

Figure 33UNCURATED SAMPLE

未经筛选的 256times256256\\times256 DiT-XL/2 样本。 Classifier-free guidance scale = 1.5;类别标签为“ice cream”(928)。

LLM WIKI · CONTEXT READER

AI 论文解读

DeepSeek V4 Flash

Enter 发送 · Shift + Enter 换行 · Esc 关闭