视觉特征-自监督-掩码特征预测【2024-11】:D-JEPA·T2I(通过下一词元预测实现高分辨率图像合成)【相对于D-JEPA的优化:文本条件、流匹配损失、VoPE】

High-Resolution Image Synthesis via Next-Token Prediction

通过下一词元预测实现高分辨率图像合成

Abstract

摘要

Recently, autoregressive models have demonstrated remarkable performance in class-conditional image generation. However, the application of next-token prediction to high resolution text-to-image generation remains largely unexplored. In this paper, we introduce D-JEPA·T2I, an autoregressive model based on continuous tokens that incorporates innovations in both architecture and training strategy to generate high-quality, photorealistic images at arbitrary resolutions, up to 4K. Architecturally, we adopt the denoisingjoint embedding predictive architecture (D-JEPA) while leveraging a multimodal visual transformer to effectively integrate textual and visual features. Additionally, we introduce flow matching loss alongside the proposed Visual Rotary Positional Embedding (VoPE) to enable continuous resolution learning. In terms of training strategy, we propose a data feedback mechanism that dynamically adjusts the sampling procedure based on statistical analysis and an online learning critic model. This encourages the model to move beyond its comfort zone, reducing redundant training on well-mastered scenarios and compelling it to address more challenging cases with suboptimal generation quality. For the first time, we achieve state-of-the-art highresolution image synthesis via next-token prediction.

近年来, 自回归模型(Autoregressive Models)类别条件图像生成(Class-Conditional Image Generation) 任务中展现出了卓越的性能。

然而,将 下一词元预测(Next-Token Prediction) 应用于 高分辨率文本到图像生成(High-Resolution Text-to-Image Generation) 仍然鲜有探索。

本文提出 D-JEPA·T2I,一种基于 连续词元(Continuous Tokens) 的自回归模型。

该模型在架构和训练策略两方面引入了创新,能够以任意分辨率生成高质量、逼真的图像,最高可达 4K

架构方面

  • 我们采用 去噪联合嵌入预测架构(Denoising Joint Embedding Predictive Architecture, D-JEPA
  • 同时利用 多模态视觉 Transformer(Multimodal Visual Transformer) 有效融合文本与视觉特征。
  • 此外,我们引入 流匹配损失(Flow Matching Loss),并结合所提出的 视觉旋转位置嵌入(Visual Rotary Positional Embedding, VoPE),从而实现 连续分辨率学习(Continuous Resolution Learning)

在训练策略方面,

  • 我们提出了一种 数据反馈机制(Data Feedback Mechanism),该机制基于统计分析和 在线学习评论模型(Online Learning Critic Model) 动态调整采样过程。这一机制促使模型突破自身的 舒适区(Comfort Zone),减少对已经充分掌握场景的冗余训练,并迫使模型更多地处理生成质量欠佳、难度更高的案例。

我们首次通过 下一词元预测(Next-Token Prediction) 实现了 最先进水平(State-of-the-Art, SOTA) 的高分辨率图像合成。

  1. Introduction

1. 引言

In recent years, diffusion models have become the dominant approach for generating high-resolution images and videos from natural language inputs, demonstrating exceptional generalization capabilities [12–14, 28, 31, 35, 36, 41, 49, 55, 67, 70, 83, 90, 93, 95, 98, 100, 103, 106, 137]. At the same time, the rise of autoregressive large language models [1, 4, 5, 16, 26, 52, 61, 78, 85, 86, 88, 110, 113, 118, 119, 128, 129] has marked a new era in artificial intelligence, leading to significant advances in artificial general intelligence (AGI) due to their unparalleled versatility and generality.

近年来, 扩散模型(Diffusion Models) 已成为根据自然语言输入生成高分辨率图像和视频的主流方法,并展现出卓越的 泛化能力(Generalization Capabilities) [12–14, 28, 31, 35, 36, 41, 49, 55, 67, 70, 83, 90, 93, 95, 98, 100, 103, 106, 137]。

与此同时, 自回归大语言模型(Autoregressive Large Language Models) [1, 4, 5, 16, 26, 52, 61, 78, 85, 86, 88, 110, 113, 118, 119, 128, 129] 的兴起标志着人工智能进入了一个新时代。

凭借其无与伦比的通用性与普适性,这类模型推动了 通用人工智能(Artificial General Intelligence, AGI) 领域的显著进展。

The success of language models has similarly catalyzed advancements in image generation [69, 89, 109, 130, 131]. Recent works, such as D-JEPA [20], MAR [64], and VAR [116], suggest that autoregressive models can achieve generative performance that rivals or even exceeds that of diffusion models in class-conditioned image synthesis on ImageNet [94]. However, despite their advantages in prompt adherence and computational efficiency over diffusion models [57], autoregressive models still face challenges in generating high-resolution images with finegrained textures and overall visual fidelity.

语言模型的成功同样催生了 图像生成(Image Generation) 领域的发展 [69, 89, 109, 130, 131]。

近期工作,例如 D-JEPA [20]、 MAR [64] 和 VAR [116],表明在 ImageNet [94] 上的 类别条件图像合成(Class-Conditioned Image Synthesis) 任务中,自回归模型能够实现与扩散模型相媲美、甚至超过扩散模型的生成性能。

然而,尽管自回归模型在 提示词遵循能力(Prompt Adherence)计算效率(Computational Efficiency) 方面优于扩散模型 [57],它们在生成具有精细纹理和较高整体 视觉保真度(Visual Fidelity) 的高分辨率图像时,仍然面临挑战。

To further advance autoregressive models for image generation and to foster the development of unified multi-modal models, we focus on two crucial aspects in this work: model architecture and training strategy.

为了进一步推进自回归模型在图像生成领域的发展,并促进 统一多模态模型(Unified Multi-Modal Models) 的发展,我们在本文中重点关注两个关键方面:

  • 模型架构(Model Architecture)
  • 训练策略(Training Strategy)

From an architectural perspective (Sec. 2), we adopt the denoising joint embedding predictive architecture (D-JEPA) [20], building on its success in integrating representational learning to enhance model performance [134]. We also draw inspiration from the successful design principles of diffusion models, incorporating a multimodal visual transformer block, initially introduced by Esser et al., to ensure effective fusion of visual and textual features. Additionally, we leverage the more robust flow matching loss [70] to restore tokens into image patches. Furthermore, we identify that the conventional patchification operation, which segments continuous images into discrete blocks using RoPE [107], limits the model’s ability to handle continuous resolutions and varying aspect ratios. To address these challenges, we introduce the visual rotary positional embedding (VoPE), enabling the model to learn across continuous resolutions and dynamic aspect ratios.

从架构角度来看(第 2 节),我们采用 去噪联合嵌入预测架构(Denoising Joint Embedding Predictive Architecture, D-JEPA [20],并基于其成功经验,将 表征学习(Representational Learning) 融入模型,以提升模型性能 [134]。

我们还借鉴了扩散模型中已取得成功的设计原则,引入由 Esser 等人最初提出的 多模态视觉 Transformer 模块(Multimodal Visual Transformer Block),以确保视觉特征与文本特征能够有效融合。

此外,我们采用更加稳健的 流匹配损失(Flow Matching Loss) [70],将词元恢复为图像块。

进一步地,我们发现,传统的 图像分块操作(Patchification) 使用 旋转位置编码(Rotary Positional Embedding, RoPE) [107] 将连续图像划分为离散块,这限制了模型处理连续分辨率和不同宽高比的能力。

为解决这些问题,我们提出 视觉旋转位置嵌入(Visual Rotary Positional Embedding, VoPE),使模型能够在 连续分辨率(Continuous Resolutions)动态宽高比(Dynamic Aspect Ratios) 下进行学习。

In terms of training strategy (Sec. 3), we propose a novel data feedback mechanism to optimize resource efficiency. Traditional data curation typically involves preprocessing steps, such as filtering low-quality images [46] and refining prompts using multimodal models [65]. While these methods improve data quality, they often introduce biases and fail to adapt to evolving data distributions, particularly in large-scale datasets. Fine-tuning techniques, such as reinforcement learning from human feedback (RLHF) [66, 126] and direct preference optimization (DPO) [87, 121], offer post-hoc adjustments but exhibit inconsistent effectiveness. In contrast, our data feedback mechanism dynamically adjusts the data distribution in real-time based on statistical analysis and model performance, as assessed by the critic model, during training. Specifically, the critic model is trained to evaluate the model’s performance on a sampled data point, providing continuous feedback to guide training.

在训练策略方面(第 3 节),我们提出了一种新颖的 数据反馈机制(Data Feedback Mechanism),以提升资源利用效率。

传统的 数据整理(Data Curation) 通常涉及预处理步骤,例如过滤低质量图像 [46],以及使用多模态模型对提示词进行优化 [65]。

尽管这些方法可以提升数据质量,但它们往往会引入偏差,并且难以适应不断变化的数据分布,尤其是在大规模数据集上。

诸如 基于人类反馈的强化学习(Reinforcement Learning from Human Feedback, RLHF) [66, 126] 和 直接偏好优化(Direct Preference Optimization, DPO) [87, 121] 等微调技术能够进行事后调整,但其有效性并不稳定。

相比之下,我们提出的数据反馈机制能够在训练过程中,根据统计分析以及由 评论模型(Critic Model) 评估得到的模型性能,实时动态调整数据分布。

具体而言,评论模型经过训练后,可评估模型在某个采样数据点上的表现,并提供持续反馈以指导训练。
在这里插入图片描述

Figure 1. D-JEPA·T2I can accurately generate high-fidelity, high-resolution images across various aspect ratios. Refer to the supplementary materials for 4K resolution samples and additional qualitative results.

By integrating the data-feedback training strategy into D-JEPA·T2I, we achieve state-of-the-art performance in high-resolution image synthesis via next-token prediction. Our approach has been validated on the T2I-CompBench [53], GenEval [42], and GenAI-Bench [63] benchmarks, as well as through human evaluations.

通过将 数据反馈训练策略(Data-Feedback Training Strategy) 集成到 D-JEPA·T2I 中,我们首次通过 下一词元预测(Next-Token Prediction)高分辨率图像合成任务上实现了 最先进性能(State-of-the-Art Performance)

我们的方法已在 T2I-CompBench [53]、 GenEval [42] 和 GenAI-Bench [63] 基准测试中得到验证,同时也通过了人工评测。

2 Model Architecture

2. 模型架构

The denoising joint embedding predictive architecture (D-JEPA) [20] builds upon the visual transformer [34] and models the token distribution p ( x i ∣ z i ) p ( x _ { i } | z _ { i } ) p(xizi) , where z i z _ { i } zi represents the predicted features of each token. It employs a combination of feature prediction loss L p r e d \mathcal { L } _ { \mathrm { p r e d } } Lpred and diffusion loss L d i f f { \mathcal { L } } _ { \mathrm { d i f f } } Ldiff . While D-JEPA has demonstrated strong performance in class-conditioned image generation, its applicability remains limited to fixed-resolution image synthesis, typically at 256 × 256 or 512 × 512.

去噪联合嵌入预测架构(Denoising Joint Embedding Predictive Architecture, D-JEPA) [20] 建立在 视觉 Transformer(Visual Transformer) [34] 的基础之上,并对词元分布 p ( x i ∣ z i ) p(x_i \mid z_i) p(xizi) 进行建模,其中, z i z_i zi 表示每个词元的预测特征。

该架构结合使用

  • 特征预测损失(Feature Prediction Loss) L p r e d \mathcal{L}_{\mathrm{pred}} Lpred
  • 扩散损失(Diffusion Loss) L d i f f \mathcal{L}_{\mathrm{diff}} Ldiff

尽管 D-JEPA 在 类别条件图像生成(Class-Conditioned Image Generation) 中展现出了较强的性能,但其适用范围仍局限于固定分辨率的图像合成,通常为 256 × 256 或 512 × 512。

In this work, we introduce D-JEPA·T2I, extending D-JEPA to high-resolution text-to-image generation, as shown in Fig. 2. To achieve this, we adapt a multimodal visual transformer, building upon [36], to more effectively integrate textual and visual features (Sec. 2.1). Additionally, we replace the diffusion loss L d i f f { \mathcal { L } } _ { \mathrm { d i f f } } Ldiff with a more flexible and faster-converging flow matching loss L f l o w { \mathcal { L } } _ { \mathrm { f l o w } } Lflow (Sec. 2.2). Finally, we propose VoPE, a novel positional embedding for continuous-resolution learning (Sec. 2.3).

在本文中,我们提出 D-JEPA·T2I,将 D-JEPA 扩展至 高分辨率文本到图像生成(High-Resolution Text-to-Image Generation),如图 2 所示。

为实现这一目标,我们在 [36] 的基础上对 多模态视觉 Transformer(Multimodal Visual Transformer) 进行了适配,以更加有效地融合文本与视觉特征(第 2.1 节)。

此外,我们将 扩散损失(Diffusion Loss) L d i f f \mathcal{L}_{\mathrm{diff}} Ldiff 替换为更加灵活且收敛速度更快的 流匹配损失(Flow Matching Loss) L f l o w \mathcal{L}_{\mathrm{flow}} Lflow(第 2.2 节)。

最后,我们提出 VoPE,这是一种用于 连续分辨率学习(Continuous-Resolution Learning) 的新型 位置嵌入(Positional Embedding)(第 2.3 节)。

2.1. Multimodal Visual Transformer

2.1. 多模态视觉 Transformer

The multimodal visual transformer draws inspiration from the design of the multimodal diffusion backbone, initially proposed by Esser et al. [36]. The core idea is that text and image embeddings are conceptually quite different, necessitating the use of two separate sets of weights for the two modalities. This approach is equivalent to having two independent transformers for each modality while concatenating their sequences for the attention operation. This setup allows both representations to operate within their own spaces while still incorporating information from the other.1

多模态视觉 Transformer(Multimodal Visual Transformer) 的设计灵感来源于由 Esser 等人 [36] 最初提出的 多模态扩散骨干网络(Multimodal Diffusion Backbone)

其核心思想是,文本嵌入图像嵌入在概念上存在较大差异,因此有必要针对这两种模态使用两套彼此独立的权重

这种方法等价于

  • 为每种模态分别使用一个独立的 Transformer,
  • 同时在执行 注意力操作(Attention Operation) 时将两者的序列拼接起来。

这样的设置使两种表征能够分别在各自的空间中进行处理,同时仍然能够融合来自另一种模态的信息。1

Dehghani et al. [30] observe that the training of large vision transformer models diverges because the attention entropy grows uncontrollably. To avoid this, they propose normalizing Q and K before the attention operation. We follow this approach and use RMSNorm [135] with a learnable scale in both streams of D-JEPA·T2I architecture. The additional normalization prevents attention logit growth instability, confirming findings by previous works[30, 36, 124], and enables efficient training at bf16-mixed precision [19] when combined with the AdamW [72] optimizer.

Dehghani 等人 [30] 观察到,大型 视觉 Transformer(Vision Transformer) 模型的训练会发生发散,其原因在于 注意力熵(Attention Entropy) 会不受控制地增长

为避免这一问题,他们提出在执行注意力操作之前对 Q Q Q K K K 进行归一化。

我们遵循这一方法,在 D-JEPA·T2I 架构的两个数据流中均使用带有可学习缩放参数的 均方根归一化(Root Mean Square Normalization, RMSNorm) [135]。

这种额外的归一化能够防止 注意力 Logit(Attention Logit) 增长所导致的不稳定性,这与此前工作 [30, 36, 124] 的发现一致;同时,当与 AdamW 优化器(AdamW Optimizer) [72] 结合使用时,它还能够支持采用 bf16 混合精度(bf16 Mixed Precision) [19] 进行高效训练。

The primary distinction between the multimodal visual transformer and the multimodal diffusion backbone is that the former does not require handling the additional timestep t introduced by the diffusion process. This omission sidesteps adaptive layer norm [82], which is essential for diffusion models built on top of DiT [80].

For textual tokens, we follow the design principles of large language models and use RoPE [107] as positional encoding. For visual tokens, we introduce VoPE, a positional encoding specifically designed for visual features, which we detail in Sec. 2.3.

多模态视觉 Transformer(Multimodal Visual Transformer)多模态扩散骨干网络(Multimodal Diffusion Backbone) 之间的主要区别在于,

  • 前者无需处理由扩散过程额外引入的时间步 t t t。由于省略了这一时间步,因此也无需使用 自适应层归一化(Adaptive Layer Normalization) [82]; 而对于构建在 DiT [80] 之上的扩散模型而言,自适应层归一化是必不可少的。
  • 对于 文本词元(Textual Tokens),我们遵循 大语言模型(Large Language Models) 的设计原则,并使用 旋转位置编码(Rotary Positional Embedding, RoPE) [107] 作为位置编码。对于 视觉词元(Visual Tokens),我们引入 VoPE,这是一种专为视觉特征设计的位置编码方法,其具体细节将在第 2.3 节中介绍。

在这里插入图片描述

Figure 2. Denoising with a Joint-Embedding Predictive Architecture for text-to-image synthesis. We employ T5-XXL [27] as the text encoder, and the KL-VAE pretrained by Esser et al. [36] as the image encoder. Both textual and visual tokens are trimmed to no more than 256 and 256 2 2 5 6 ^ { 2 } 2562 tokens for efficient training, respectively. The feature predictor γ , \gamma , γ, the context encoder ϕ , \phi , ϕ, and the target encoder ϕ ˉ \bar { \phi } ϕˉ share the same network architecture, each consisting of several multimodal visual transformer blocks. The gradient is detached from the output of the target encoder ϕ , \phi , ϕ, ensuring that it is only updated via exponential moving average (EMA). Both the prediction loss L p r e d \mathcal { L } _ { \mathrm { p r e d } } Lpred and the flow matching loss L f l o w { \mathcal { L } } _ { \mathrm { f l o w } } Lflow are computed only for the masked visual tokens, following Chen et al. [20].

图 2. 用于 文本到图像合成(Text-to-Image Synthesis)基于联合嵌入预测架构的去噪方法(Denoising with a Joint-Embedding Predictive Architecture)。我们采用

  • T5-XXL [27] 作为 文本编码器(Text Encoder)
  • 采用由 Esser 等人 [36] 预训练的 KL-VAE 作为 图像编码器(Image Encoder)
  • 为了实现高效训练,文本词元和视觉词元分别被截断至不超过 256 个和 256 2 256^2 2562 个词元。

特征预测器(Feature Predictor) γ \gamma γ上下文编码器(Context Encoder) ϕ \phi ϕ目标编码器(Target Encoder) ϕ ˉ \bar{\phi} ϕˉ 共享相同的网络架构,每个网络均由若干个 多模态视觉 Transformer 模块(Multimodal Visual Transformer Blocks) 组成。目标编码器 ϕ ˉ \bar{\phi} ϕˉ 输出处的梯度被截断,从而确保其仅通过 指数移动平均(Exponential Moving Average, EMA) 进行更新。

遵循 Chen 等人 [20] 的方法,

  • 预测损失(Prediction Loss) L p r e d \mathcal{L}_{\mathrm{pred}} Lpred流匹配损失(Flow Matching Loss) L f l o w \mathcal{L}_{\mathrm{flow}} Lflow 均仅针对被掩码的视觉词元进行计算。

2.2. Flow Matching Loss

在这里插入图片描述

Flow matching [3, 67, 74, 76] emerges as a simple alternative that linearly interpolates between noise and data along a straight line. In this context, we adhere to the flow matching formulation presented in Gao et al. [41] for modeling the token distribution p ( x i ∣ z i ) p ( x _ { i } | \boldsymbol { z } _ { i } ) p(xizi) . More specifically, given the data x i ∼ p ( x i ∣ z i ) x _ { i } \sim p ( x _ { i } | z _ { i } ) xip(xizi) and Gaussian noise ϵ ∼ N ( 0 , I ) \epsilon \sim \mathcal { N } ( 0 , I ) ϵN(0,I) , we define an interpolation-based forward process:

流匹配(Flow Matching) [3, 67, 74, 76] 是一种简单的替代方案,它沿直线路径在噪声与数据之间进行线性插值。

在这一背景下,我们遵循 Gao 等人 [41] 提出的流匹配形式,对词元分布 p ( x i ∣ z i ) p(x_i \mid \boldsymbol{z}_i) p(xizi) 进行建模。

更具体而言,给定数据 x i ∼ p ( x i ∣ z i ) x_i \sim p(x_i \mid z_i) xip(xizi) 和高斯噪声 ϵ ∼ N ( 0 , I ) \epsilon \sim \mathcal{N}(0,I) ϵN(0,I),我们定义一个基于插值的前向过程

x i t = α t x i + β t ϵ , x _ { i } ^ { t } = \alpha _ { t } x _ { i } + \beta _ { t } \epsilon , xit=αtxi+βtϵ,

where α 0 = 0 , β t = 1 , α 1 = 1 \alpha _ { 0 } = 0 , \beta _ { t } = 1 , \alpha _ { 1 } = 1 α0=0,βt=1,α1=1 , and β 1 = 0 \beta _ { 1 } = 0 β1=0 This interpolation for t ∈ [ 0 , 1 ] t \in [ 0 , 1 ] t[0,1] bridges x i 0   =   ϵ x _ { i } ^ { 0 } \ = \ \epsilon xi0 = ϵ and x i 1   =   x i x _ { i } ^ { 1 } \ = \ x _ { i } xi1 = xi Similar to the diffusion schedule, this interpolation schedule offers flexible choices of α t \alpha _ { t } αt and β t \beta _ { t } βt . In our framework, we adopt a linear interpolation schedule between noise and data for its simplicity: x i t = t x i + ( 1 − t ) ϵ x _ { i } ^ { t } = t x _ { i } + ( 1 - t ) \epsilon xit=txi+(1t)ϵ . This formulation represents a uniform transformation with constant velocity between the data and noise. The corresponding timedependent velocity field is defined as:

其中, α 0 = 0 \alpha_0=0 α0=0 β 0 = 1 \beta_0=1 β0=1 α 1 = 1 \alpha_1=1 α1=1,且 β 1 = 0 \beta_1=0 β1=0。对于 t ∈ [ 0 , 1 ] t\in[0,1] t<

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值