Skip to content


Genie:生成式交互环境

Abstract

We introduce Genie, the first generative interactive environment trained in an unsupervised manner from unlabelled Internet videos. The model can be prompted to generate an endless variety of action-controllable virtual worlds described through text, synthetic images, photographs, and even sketches. At 11B parameters, Genie can be considered a foundation world model. It is comprised of a spatiotemporal video tokenizer, an autoregressive dynamics model, and a simple and scalable latent action model. Genie enables users to act in the generated environments on a frame-by-frame basis despite training without any ground-truth action labels or other domain-specific requirements typically found in the world model literature. Further the resulting learned latent action space facilitates training agents to imitate behaviors from unseen videos, opening the path for training generalist agents of the future.

我们提出 Genie,这是首个以无监督方式从无标签互联网视频中训练得到的 生成式交互环境 用户可以通过文本、合成图像、照片甚至草图提示该模型,生成种类无穷、可由动作控制的虚拟世界。 Genie 拥有 110 亿参数,可以被视为一个 基础世界模型 它由时空视频分词器、自回归动力学模型,以及简单且可扩展的潜在动作模型组成。 尽管训练时没有任何真实动作标签,也没有世界模型研究中常见的其他领域特定要求,Genie 仍使用户能够逐帧操控生成的环境。 此外,由此学习到的潜在动作空间有助于训练智能体模仿未见视频中的行为,为训练未来的通用智能体开辟了道路。

1. Introduction

The last few years have seen an emergence of generative AI, with models capable of generating novel and creative content. Driven by breakthroughs in architectures such as transformers, advances in hardware, and a recent focus on scaling models and datasets, we can now generate coherent, conversational language, as well as crisp and aesthetically pleasing images from a text prompt. Early signs indicate video generation will be yet another frontier, with recent results suggesting that such models may also benefit from scale. Still, there remains a gulf between the level of interactions and engagement of video generative models and language tools such as ChatGPT, let alone more immersive experiences.

过去几年见证了 生成式人工智能 的兴起,相关模型已经能够生成新颖而富有创造性的内容。 在 Transformer 等架构突破、硬件进步以及近期对模型与数据集规模扩展的共同推动下,我们现在不仅能生成连贯且具有对话性的语言,也能根据文本提示生成清晰且美观的图像。 早期迹象表明,视频生成将成为另一个前沿方向,近期结果说明此类模型同样可能从规模扩展中受益。 尽管如此,视频生成模型与 ChatGPT 等语言工具在交互程度和参与感上仍存在巨大差距,更不用说更具沉浸感的体验了。

What if, given a large corpus of videos from the Internet, we could not only train models capable of generating novel images or videos, but entire interactive experiences? We propose generative interactive environments, a new paradigm for generative AI whereby interactive environments can be generated from a single text or image prompt. Our approach, Genie, is trained from a large dataset of over 200,000 hours of publicly available Internet gaming videos and, despite training without action or text annotations, is controllable on a frame-by-frame basis via a learned latent action space (see Table 1 for a comparison to other approaches). At 11B parameters, Genie exhibits properties typically seen in foundation models---it can take an unseen image as a prompt making it possible to create and play entirely imagined virtual worlds (e.g. Figure 1).

如果给定一个大规模互联网视频语料库,我们不仅能训练生成新图像或视频的模型,还能生成完整的交互体验,会怎样? 我们提出 生成式交互环境,这是一种生成式人工智能新范式,能够根据单个文本或图像提示生成交互环境。 我们的方法 Genie 使用超过 20 万小时的公开互联网游戏视频组成的大型数据集进行训练;尽管训练时 没有动作或文本标注,它仍能通过学习到的潜在动作空间实现逐帧控制(与其他方法的比较见 表1)。 Genie 拥有 110 亿参数,展现出基础模型通常具有的性质:它可以把未见图像作为提示,从而创建并游玩完全由想象生成的虚拟世界(例如 图1)。

由生成图像和手绘草图提示的 Genie 可控平台游戏轨迹
图1:多样化轨迹。Genie 是一种可用作交互环境的生成模型。模型可以接受多种提示,包括生成图像(上)或手绘草图(下)。在每个时间步,模型接收用户提供的潜在动作并生成下一帧,由此产生包含有趣且多样角色动作的轨迹。

Genie builds on ideas from state-of-the-art video generation models, with a core design choice being spatiotemporal (ST) transformers which are used in all of our model components. Genie utilizes a novel video tokenizer, and extracts latent actions via a causal action model. Both the video tokens and latent actions are passed to a dynamics model, which autoregressively predicts the next frame using MaskGIT. We provide a rigorous scaling analysis of our architecture with respect to both batch and model size, which we vary from 40M to 2.7B parameters. The results show that our architecture scales gracefully with additional computational resources, leading to a final 11B parameter model. We train Genie on a filtered set of 30,000 hours of Internet gameplay videos from hundreds of 2D platformer games, producing a foundation world model for this setting.

Genie 建立在先进视频生成模型的思想之上,其核心设计选择是在所有模型组件中使用时空(ST)Transformer。 Genie 使用一种新的视频分词器,并通过因果动作模型提取潜在动作。 视频词元和潜在动作都会传入动力学模型,该模型使用 MaskGIT 自回归地预测下一帧。 我们从批大小和模型规模两方面对架构进行了严格的扩展分析,其中模型参数量从 4000 万变化到 27 亿。 结果表明,随着计算资源增加,我们的架构能够平稳扩展,最终得到一个 110 亿参数的模型。 我们使用从数百款二维平台游戏中筛选出的 3 万小时互联网游戏视频训练 Genie,从而为这一场景构建了基础世界模型。

To demonstrate the generality of our approach, we also train a separate model on action-free robot videos from the RT1 dataset, learning a generative environment with consistent latent actions. Finally, we show that latent actions learned from Internet videos can be used for inferring policies from unseen action-free videos of simulated reinforcement learning (RL) environments, indicating that Genie may hold the key to unlocking unlimited data for training the next generation of generalist agents.

为了证明我们方法的通用性,我们还在 RT1 数据集的无动作标签机器人视频上训练了一个独立模型,学习具有一致潜在动作的生成环境。 最后,我们表明,从互联网视频中学习到的潜在动作可用于根据模拟强化学习(RL)环境中未见过的无动作标签视频推断策略,这说明 Genie 可能是释放无限数据、训练下一代通用智能体的关键。

Genie 视频分词器、潜在动作模型与动力学模型训练架构
图2:Genie 模型训练。Genie 接收 T 帧视频作为输入,使用视频分词器将其编码为离散词元 z,并用潜在动作模型推断各帧之间的潜在动作。随后,二者被传入动力学模型,以迭代方式生成后续帧的预测。
表1:一种新的生成模型类别。Genie 是一种新型视频与世界模型,可逐帧控制,并且训练时只需要视频数据。
Model ClassTraining DataControllability
World ModelsVideo + ActionsFrame-level
Video ModelsVideo + TextVideo-level
GenieVideoFrame-level

2. Methodology

Genie is a generative interactive environment trained from video-only data. In this section we begin with preliminaries before explaining the main components of our model.

Genie 是一种仅用视频数据训练的生成式交互环境。 本节先介绍预备知识,然后说明模型的主要组件。

Several components in the Genie architecture are based on the Vision Transformer (ViT). Notably, the quadratic memory cost of transformers poses challenges for videos, which can contain up to O(104) tokens. We thus adopt a memory efficient ST-transformer architecture (see Figure 3) across all model components, balancing model capacity with computational constraints.

Genie 架构中的多个组件都基于视觉 Transformer(ViT)。 值得注意的是,Transformer 的内存成本呈二次增长,这给最多可包含 O(104) 个词元的视频带来了挑战。 因此,我们在所有模型组件中采用内存高效的 ST-Transformer 架构(见 图3),以平衡模型容量和计算约束。

由空间注意力、时间注意力与前馈层构成的 ST-Transformer
图3:ST-Transformer 架构。该架构由 L 个时空块组成,每个块包含空间层、时间层和前馈层。每种颜色表示一张自注意力图:空间层关注同一时间步内的 H×W 个词元,时间层则关注跨 T 个时间步的同一位置词元。

Unlike a traditional transformer where every token attends to all others, an ST-transformer contains L spatiotemporal blocks with interleaved spatial and temporal attention layers, followed by a feed-forward layer (FFW) as standard attention blocks. The self-attention in the spatial layer attends over the 1×H×W tokens within each time step, and in the temporal layer attends over T×1×1 tokens across the T time steps. Similar to sequence transformers, the temporal layer assumes a causal structure with a causal mask. Crucially, the dominating factor of computation complexity (i.e. the spatial attention layer) in our architecture scales linearly with the number of frames rather than quadratically, making it much more efficient for video generation with consistent dynamics over extended interactions. Further, note that in the ST block, we include only one FFW after both spatial and temporal components, omitting the post-spatial FFW to allow for scaling up other components of the model, which we observe to improve results significantly.

传统 Transformer 中每个词元都会关注所有其他词元;与之不同,ST-Transformer 包含 L 个时空块,其中空间注意力层和时间注意力层交替排列,之后接一个与标准注意力块相同的前馈层(FFW)。 空间层中的自注意力关注每个时间步内的 1×H×W 个词元,而时间层则关注跨越 T 个时间步的 T×1×1 个词元。 与序列 Transformer 类似,时间层采用带因果掩码的因果结构。 关键在于,我们架构中计算复杂度的主导因素(即空间注意力层)随帧数线性而非二次增长,因此在长时间交互中生成动力学一致的视频时效率高得多。 此外,ST 块只在空间和时间组件之后设置一个 FFW,省略空间组件之后的 FFW,以便扩展模型的其他组件;我们观察到这会显著改善结果。

2.1 Model Components

As shown in Figure 2, our model contains three key components: 1) a latent action model that infers the latent action a between each pair of frames and 2) a video tokenizer that converts raw video frames into discrete tokens z and 3) a dynamics model that, given a latent action and past frame tokens, predicts the next frame of the video. The model is trained in two phases following a standard autoregressive video generation pipeline: we train the video tokenizer first, which is used for the dynamics model. We then co-train the latent action model (directly from pixels) and the dynamics model (on video tokens).

图2 所示,我们的模型包含三个关键组件:1)推断每对相邻帧之间潜在动作 a潜在动作模型;2)将原始视频帧转换为离散词元 z视频分词器;3)根据潜在动作和历史帧词元预测下一视频帧的 动力学模型 模型遵循标准的自回归视频生成流程,分两个阶段训练:首先训练供动力学模型使用的视频分词器。 然后,我们联合训练潜在动作模型(直接使用像素)和动力学模型(使用视频词元)。

Latent Action Model (LAM). To achieve controllable video generation, we condition each future frame prediction on the action taken at the previous frame. However, such action labels are rarely available in videos from the Internet and action annotation can be costly to obtain. Instead, we learn latent actions in a fully unsupervised manner (see Figure 4).

潜在动作模型(LAM)。 为了实现可控视频生成,我们让每个未来帧的预测都以先前一帧执行的动作为条件。 然而,互联网视频很少提供此类动作标签,而获取动作标注的成本可能很高。 因此,我们以完全无监督的方式学习 潜在动作(见 图4)。

Genie 潜在动作模型编码器、量化器与解码器
图4:潜在动作模型:从无标签视频帧中以无监督方式学习动作 a_t。

First, an encoder takes as inputs all previous frames x1:t=(x1,xt) as well as the next frame xt+1, and outputs a corresponding set of continuous latent actions a~1:t=(a~1,a~t). A decoder then takes all previous frames and latent actions as input and predicts the next frame x^t+1.

首先,编码器接收所有先前帧 x1:t=(x1,xt) 以及下一帧 xt+1,并输出对应的一组连续潜在动作 a~1:t=(a~1,a~t) 随后,解码器接收所有先前帧和潜在动作,并预测下一帧 x^t+1

To train the model, we leverage a VQ-VAE-based objective, which enables us to limit the number of predicted actions to a small discrete set of codes. We limit the vocabulary size |A| of the VQ codebook, i.e. the maximum number of possible latent actions, to a small value to permit human playability and further enforce controllability (we use |A|=8 in our experiments). As the decoder only has access to the history and latent action, a~t should encode the most meaningful changes between the past and the future for the decoder to successfully reconstruct the future frame. Note that this decoder exists only to give the LAM training signal. In fact, apart from the VQ codebook, the entire LAM is discarded at inference time and replaced with actions from the user.

为了训练该模型,我们采用基于 VQ-VAE 的目标,使预测动作的数量能够限制在一个较小的离散代码集合中。 我们将 VQ 码本的词表大小 |A|,即潜在动作的最大可能数量,限制为较小的值,以便人类能够游玩并进一步增强可控性(实验中使用 |A|=8)。 由于解码器只能访问历史信息和潜在动作,a~t 应编码过去与未来之间最有意义的变化,使解码器能够成功重建未来帧。 需要注意的是,该解码器只用于向 LAM 提供训练信号。 事实上,除 VQ 码本外,整个 LAM 在推理时都会被丢弃,并由用户动作取代。

We utilize our ST-transformer architecture for the latent action model. The causal mask in the temporal layer allows us to take the entire video x1:T as input and generate all latent actions between each frame a~1:T1.

我们在潜在动作模型中使用 ST-Transformer 架构。 时间层中的因果掩码使我们能够将完整视频 x1:T 作为输入,并生成各帧之间的全部潜在动作 a~1:T1

Video Tokenizer. Following prior work, we compress videos into discrete tokens to reduce dimensionality and enable higher quality video generation (see Figure 5). We again make use of VQ-VAE, which takes in T frames of video x1:T=(x1,x2,,xT)RT×H×W×C as input, generating discrete representations for each frame z1:T=(z1,z2,,zT)IT×D, where D is the size of the discrete latent space. The tokenizer is trained using a standard VQ-VQAE objective over the entire video sequence.

视频分词器。 沿用先前工作,我们将视频压缩为离散词元,以降低维度并实现更高质量的视频生成(见 图5)。 我们再次使用 VQ-VAE,它接收 T 帧视频 x1:T=(x1,x2,,xT)RT×H×W×C 作为输入,并为每一帧生成离散表示 z1:T=(z1,z2,,zT)IT×D,其中 D 是离散潜在空间的大小。 分词器使用覆盖整个视频序列的标准 VQ-VQAE 目标进行训练。

采用 ST-Transformer 编码器与解码器的 Genie 视频分词器
图5:视频分词器:采用 ST-Transformer 的 VQ-VAE。

Unlike prior works that focus on spatial-only compression in the tokenization phase, we utilize the ST-transformer in both the encoder and decoder to incorporate temporal dynamics in the encodings, which improves the video generation quality. By the causal nature of the ST-transformer, each discrete encoding zt contains information from all previously seen frames of the video x1:t. Phenaki also uses a temporal-aware tokenizer, C-ViViT, but this architecture is compute intensive, as the cost grows quadratically with the number of frames---in comparison, our ST-transformer based tokenizer (ST-ViViT) is much more compute efficient with the dominating factor in its cost increasing linearly with the number of frames.

先前工作在分词阶段主要关注纯空间压缩;与之不同,我们在编码器和解码器中都使用 ST-Transformer,将时间动力学纳入编码,从而提高视频生成质量。 由于 ST-Transformer 具有因果性质,每个离散编码 zt 都包含来自视频中此前所有已见帧 x1:t 的信息。 Phenaki 同样使用具有时间感知能力的分词器 C-ViViT,但该架构的计算成本很高,因为成本随帧数二次增长;相比之下,我们基于 ST-Transformer 的分词器 ST-ViViT 的成本主导项随帧数线性增长,因此计算效率高得多。

Genie MaskGIT 动力学模型
图6:动力学模型:接收视频词元和动作嵌入,并预测未来被掩码的视频词元。

Dynamics Model. The dynamics model is a decoder-only MaskGIT transformer (Figure 6). At each time step t[1,T], it takes in the tokenized video z1:t1 and stopgrad latent actions a~1:t1 and predicts the next frame tokens z^t. We again utilize an ST-transformer, whose causal structure enables us to use tokens from all (T1) frames z1:T1 and latent actions a~1:T1 as input, and generate predictions for all next frames z^2:T. The model is trained with a cross-entropy loss between the predicted tokens z^2:T and ground-truth tokens z2:T. At train time we randomly mask the input tokens z2:T1 according to a Bernoulli distribution masking rate sampled uniformly between 0.5 and 1. Note that a common practice for training world-models, including transformer-based models, is to concatenate the action at time t to the corresponding frame. However, we found that treating the latent actions as additive embeddings for both the latent action and dynamics models helped to improve the controllability of the generations.

动力学模型。 动力学模型是一个仅含解码器的 MaskGIT Transformer(图6)。 在每个时间步 t[1,T],它接收分词后的视频 z1:t1 和停止梯度的潜在动作 a~1:t1,并预测下一帧词元 z^t 我们再次使用 ST-Transformer,其因果结构使我们能够将全部 (T1) 帧的词元 z1:T1 和潜在动作 a~1:T1 作为输入,并生成所有后续帧的预测 z^2:T 模型通过预测词元 z^2:T 与真实词元 z2:T 之间的交叉熵损失进行训练。 训练时,我们根据从 0.51 均匀采样的伯努利分布掩码率,随机掩码输入词元 z2:T1 需要注意的是,训练世界模型时,包括基于 Transformer 的模型,常见做法是将时间 t 的动作与对应帧拼接。 然而,我们发现,在潜在动作模型和动力学模型中都将潜在动作作为 加性嵌入,有助于提高生成结果的可控性。

2.2 Inference: Action-Controllable Video Generation

Genie 动作可控视频生成推理流程
图7:Genie 推理。提示帧先被分词,再与用户采取的潜在动作组合,并传入动力学模型进行迭代生成。预测帧词元随后通过分词器解码器还原到图像空间。

We now describe how to use Genie for action-controllable video generation at inference time (see Figure 7). A player first prompts the model with an image x1 that serves as the initial frame. The model can be conditioned on a varying number of prompt frames. Here we start from one image as an example. The image is tokenized using the video encoder, yielding z1. The player then specifies a discrete latent action a1 to take by choosing any integer value within [0,|A|). When first interacting with the model, it is unclear how each latent action will impact the next frame generation. However, we found that the meaning of each action remained consistent across different inputs. Hence, interpreting the mapping of latent actions is akin to learning the buttons on a new controller.

下面介绍如何在推理时使用 Genie 进行动作可控的视频生成(见 图7)。 玩家首先用图像 x1 提示模型,该图像作为初始帧。 模型可以使用数量不等的提示帧作为条件。 这里以单张图像作为起点进行说明。 视频编码器将图像分词,得到 z1 随后,玩家从 [0,|A|) 中选择任意整数值,指定要执行的离散潜在动作 a1 首次与模型交互时,尚不清楚每个潜在动作会如何影响下一帧生成。 然而,我们发现,每个动作的含义在不同输入之间 保持一致 因此,理解潜在动作的映射就像学习新控制器上的各个按钮。

The dynamics model takes the frame tokens z1 and corresponding latent action a~1, which is obtained by indexing into the VQ codebook with the discrete input a1, to predict the next frame tokens z2. This process is repeated to generate the rest of the sequence z^2:T in an autoregressive manner as actions continue to be passed to the model, while tokens are decoded into video frames x^2:T with the tokenizer's decoder. Note that we can regenerate ground truth videos from the dataset by passing the model the starting frame and inferred actions from the video, or generate completely new videos (or trajectories) by changing the actions.

动力学模型接收帧词元 z1 和对应的潜在动作 a~1;后者通过使用离散输入 a1 索引 VQ 码本得到,模型据此预测下一帧词元 z2 随着动作持续传入模型,这一过程不断重复,以自回归方式生成序列的其余部分 z^2:T,同时分词器的解码器将词元解码为视频帧 x^2:T 需要注意的是,我们可以将起始帧和从视频中推断出的动作传给模型,以重新生成数据集中的真实视频;也可以改变动作,生成全新的视频或轨迹。

3. Experimental Results

Genie 模型规模和批大小扩展结果
图8:扩展结果。左:不同模型规模的训练曲线;中:各模型规模在最后 300 次更新上的平均最终训练损失;右:批大小不同时,23 亿参数模型的最终训练损失。

Datasets. We train Genie on a large-scale dataset collected from publicly available Internet videos of 2D Platformer games (referred to from here on as “Platformers”). We construct the Platformers dataset by filtering publicly available videos for keywords relating to platformers, yielding 55M 16s video clips at 10FPS, with 160x90 resolution. The final dataset contains 6.8M 16s video clips (30k hours), within an order of magnitude of other popular Internet video datasets. More details can be found in the appendix. Unless otherwise specified, results are with a 11B-parameter model trained on this dataset.

数据集。 我们使用从公开互联网二维平台游戏视频中收集的大规模数据集训练 Genie,下文将该数据集称为“Platformers”。 我们根据与平台游戏相关的关键词筛选公开视频,构建 Platformers 数据集,得到 5500 万段时长 16 秒、帧率 10 FPS、分辨率 160×90 的视频片段。 最终数据集包含 680 万段 16 秒视频片段,共计 3 万小时,其规模与其他常用互联网视频数据集处于同一个数量级。 更多细节见附录。 除非另有说明,所有结果都来自在该数据集上训练的 110 亿参数模型。

To verify the generality of our method, we also consider the robotics datasets used to train RT1, combining their dataset of 130k robot demonstrations with a separate dataset of simulation data and the 209k episodes of real robot data from prior work. Note that we do not use actions from any of these datasets, and simply treat them as videos. For simplicity, from here on we refer to this dataset as “Robotics”.

为了验证我们方法的通用性,我们还考虑用于训练 RT1 的机器人数据集,将其中约 13 万段机器人示范,与一个独立的模拟数据集及先前工作中的 20.9 万段真实机器人数据合并。 需要注意的是,我们不使用这些数据集中的任何动作,而只是将它们视为视频。 为简洁起见,下文将该数据集称为“Robotics”。

Metrics. We examine the video generation performance of Genie via two factors, namely video fidelity, i.e. the quality of video generation, and controllability, i.e. how much impact the latent actions have in video generation. For video fidelity we use the Frechet Video Distance (FVD), a video-level metric, which has been shown to have a high level of alignment to human evaluation on video quality. For controllability, we devise a metric based on peak signal-to-noise ratio (PSNR) which we call ΔtPSNR, that measures how much the video generations differ when conditioned on latent actions inferred from ground-truth (x^t) vs. sampled from a random distribution (x^t):

指标。 我们从两个因素考察 Genie 的视频生成性能,即 视频保真度,也就是视频生成质量,以及 可控性,也就是潜在动作对视频生成的影响程度。 对于视频保真度,我们使用 Fréchet 视频距离(FVD),这是一项视频级指标,已被证明与人类对视频质量的评价高度一致。 对于可控性,我们设计了一项基于峰值信噪比(PSNR)的指标,称为 ΔtPSNR;它衡量以真实数据推断的潜在动作(x^t)为条件和以随机分布采样的潜在动作(x^t)为条件时,视频生成结果之间的差异:

ΔtPSNR=PSNR(xt,x^t)PSNR(xt,x^t).

Here xt denotes the ground-truth frame at time t, x^t denotes the frame from latent actions a~1:t inferred from ground-truth frames, and x^t the same frame generated from a sequence of latent actions randomly sampled from a categorical distribution. As such, the greater ΔtPSNR is, the more the video generated from random latent actions differs from ground-truth, which indicates a higher level of controllability from the latent actions. For all experiments we report ΔtPSNR with t=4.

其中,xt 表示时间 t 的真实帧,x^t 表示由真实帧推断出的潜在动作 a~1:t 所生成的帧,而 x^t 表示由从类别分布随机采样的潜在动作序列所生成的同一帧。 因此,ΔtPSNR 越大,随机潜在动作生成的视频与真实数据的差异就越大,说明潜在动作具有更高的可控性。 所有实验都报告 t=4 时的 ΔtPSNR

Training Details. Our video tokenizer uses 200M parameters, a patch size of 4 and a codebook with embedding size 32 and 1024 unique codes, which we found to be the most effective given the trade-off between reconstruction quality of the tokenizer and downstream performance of video prediction. The latent action model has 300M parameters, a patch size of 16, and a codebook with embedding size 32 and 8 unique codes (latent actions). For all modelling components we use a sequence length of 16 frames with an FPS of 10. Further, we employ bfloat16 and QK norm for training our dynamics model, which has been shown to stabilize training at large scale. At inference time, we perform 25 MaskGIT steps for the sampling of each frame with a temperature of 2 using random sampling. See the appendix for more details.

训练细节。 我们的视频分词器包含 2 亿参数,补丁大小为 4,码本嵌入维度为 32,并包含 1024 个唯一代码;考虑分词器重建质量与下游视频预测性能之间的权衡,我们发现这一配置最为有效。 潜在动作模型包含 3 亿参数,补丁大小为 16,码本嵌入维度为 32,并包含 8 个唯一代码,即潜在动作。 所有建模组件都使用 16 帧序列长度和 10 FPS 帧率。 此外,我们使用 bfloat16 和 QK 归一化训练动力学模型,这已被证明能够稳定大规模训练。 推理时,我们采用随机采样,以温度 2 对每一帧执行 25 步 MaskGIT 采样。 更多细节见附录。

3.1 Scaling Results

In this section, we investigate the scaling behavior of our model. To this end, we conduct studies that explore the impact of both model size and batch size. See the appendix for more details on architecture and compute usage.

本节研究模型的扩展行为。 为此,我们开展实验,探索模型规模和批大小的影响。 有关架构和计算资源使用的更多细节见附录。

从合成图像、草图和真实照片提示 Genie 后的角色动作
图9:从图像提示开始游玩。我们可以用文生图模型生成的图像、手绘草图或真实照片提示 Genie。每个示例都展示提示帧,以及连续四次执行某一潜在动作后的第二帧。尽管部分图像在视觉上与数据集差异显著,但每个示例中都能看到清晰的角色运动。

Scaling Model Size. Given a fixed video tokenizer and action model architecture, we train a series of dynamics models ranging from 40M to 2.7B parameters. Figure 8 shows our architecture scales gracefully with model parameters, with each increase in size corresponding to a consistent decrease in the final training loss. This is a strong indication that our approach benefits from scaling, which we exploit with our main Genie model.

扩展模型规模。 在固定视频分词器和动作模型架构的情况下,我们训练了一系列参数量从 4000 万到 27 亿的动力学模型。 图8 表明,我们的架构能够随模型参数平稳扩展,每次增大规模都会使最终训练损失稳定下降。 这强有力地说明我们的方法能够从规模扩展中受益,并被我们用于主 Genie 模型。

Scaling Batch Size. We also investigate the effect of scaling the batch size, considering a 2.3B model with batch sizes of 128, 256, and 448, equating to 1.9M, 3.8M and 6.6M tokens. As shown in Figure 8, increasing the batch size leads to a similarly favorable gain in terms of model performance.

扩展批大小。 我们还研究了扩大批大小的影响,在一个 23 亿参数模型上分别使用 128、256 和 448 的批大小,对应 190 万、380 万和 660 万个词元。 图8 所示,增大批大小同样能带来有利的模型性能提升。

Genie Model. It is clear that increasing both model size and batch size helps improve model performance. As a result, for our final model, we train a 10.1B dynamics model with a batch size of 512, for a total of 125k steps, using 256 TPUv5p. When combined with the tokenizer and action model this brings the total to 10.7B parameters, trained on 942B tokens, which we refer to as the Genie model. For our website, we train a larger decoder mapping tokens to 360p videos, adding additional parameters.

Genie 模型。 显然,同时增大模型规模和批大小有助于改善模型性能。 因此,对于最终模型,我们使用 256 个 TPUv5p,以 512 的批大小训练一个 101 亿参数的动力学模型,共进行 12.5 万步训练。 结合分词器和动作模型后,总参数量达到 107 亿,并在 9420 亿个词元上训练;我们将其称为 Genie 模型。 对于项目网站,我们还训练了一个更大的解码器,将词元映射为 360p 视频,因此增加了额外参数。

3.2 Qualitative Results

We now present qualitative results from the Genie model. We showcase a 11B parameter model trained on the Platformers dataset and a smaller model trained on the Robotics dataset. Our model generates high-quality, controllable videos across diverse domains. Notably, we qualitatively evaluate our Platformers-trained model using only out-of-distribution (OOD) image prompts, including those generated from text-to-image models, hand-drawn sketches, and even realistic photos. The ability to generalize to such significantly OOD inputs underscores the robustness of our approach and the value of training on large-scale data, which would not have been feasible with real actions as input.

下面展示 Genie 模型的定性结果。 我们展示一个在 Platformers 数据集上训练的 110 亿参数模型,以及一个在 Robotics 数据集上训练的较小模型。 我们的模型能够跨多种领域生成高质量、可控的视频。 值得注意的是,我们 只使用分布外(OOD)图像提示 对 Platformers 训练模型进行定性评估,其中包括文生图模型生成的图像、手绘草图,甚至真实照片。 对这种差异显著的 OOD 输入进行泛化的能力,凸显了我们方法的稳健性和大规模数据训练的价值;如果将真实动作作为输入,这种训练将无法实现。

Genie 模拟薯片袋变形的十步轨迹
图10:学习模拟可变形物体。图中展示模型连续执行相同动作时,一段十步轨迹中的各帧。Genie 能够学习薯片袋等物体的物理性质。

Platformers-trained model. Figure 9 showcases examples of our model's generations prompted from OOD images, including (top row) images generated from Imagen2, (second row) hand-drawn sketches and (bottom row) real-world photos. Genie is able to bring these imagined worlds to life, as we see game-like behaviour when interacting with each example. We showcase more generations by our model in the appendix, additionally highlighting the consistency of the latent actions.

Platformers 训练模型。 图9 展示了由 OOD 图像提示得到的模型生成示例,其中包括 Imagen2 生成的图像(第一行)、手绘草图(第二行)和真实照片(最后一行)。 Genie 能够让这些想象世界鲜活起来,因为与每个示例交互时都能观察到类似游戏的行为。 附录展示了模型的更多生成结果,并进一步突出潜在动作的一致性。

Genie 在二维平台游戏场景中模拟不同景深层的视差
图11:模拟视差,这是平台游戏中的常见特征。从这张文本生成的初始图像开始,红色前景的移动幅度大于青色近处中景和绿色远处中景,而紫色背景只发生轻微移动。

Another emergent capability of our model is its ability to understand 3D scenes and emulate parallax, which is commonly seen in platformer games. In Figure 11 we show an image generated by Imagen2, where taking a latent action moves the foreground at a different rate to the background (as indicated by the length of different colored arrows).

我们模型的另一项涌现能力是理解三维场景并模拟平台游戏中常见的视差。 图11 展示了一张由 Imagen2 生成的图像;执行某一潜在动作时,前景与背景以不同速率移动,这由不同颜色箭头的长度表示。

Genie 在不同机器人提示帧中学习到一致的向下、向上和向左潜在动作
图12:Robotics 中可控且一致的潜在动作。三条轨迹分别从 Robotics 数据集中的不同起始帧开始,每列展示连续五次执行同一潜在动作后的结果帧。尽管训练时没有动作标签,相同动作在不同提示帧之间仍保持一致并具有语义含义:向下、向上和向左。

Robotics-trained model. We trained a 2.5B-parameter model on the Robotics dataset using the same hyperparameters found to be best on Platformers, achieving an FVD of 82.7 on the test split. As shown in Figure 12, this model successfully learns distinct and consistent actions from video data, requiring neither text nor action labels. Notably, our model learns not only the controls of the robotic arm but also the interactions and deformations of various objects (Figure 10). We believe this shows our approach presents a path to using larger video datasets from the Internet to create a foundational world model for robotics, with low-level controllable simulation that could be used for a variety of applications.

Robotics 训练模型。 我们使用在 Platformers 上表现最佳的相同超参数,在 Robotics 数据集上训练了一个 25 亿参数模型,并在测试集上取得 82.7 的 FVD。 图12 所示,该模型成功地从视频数据中学习到相互区分且保持一致的动作,不需要文本标签或动作标签。 值得注意的是,我们的模型不仅学习机器人手臂的控制,还学习各种物体的交互与变形(图10)。 我们认为,这表明我们的方法为利用更大规模的互联网视频数据创建机器人基础世界模型提供了一条路径;该模型具备低层次可控模拟能力,可用于多种应用。

3.3 Training Agents

We believe Genie could one day be used as a foundation world model for training generalist agents. In Figure 13 we show that the model can already be used for generating diverse trajectories in unseen RL environments given starting frames. We further investigate if latent actions learnt from Internet videos can be used for imitating behaviors from unseen videos. We use a frozen LAM to label a sequence of expert videos from a target environment with discrete latent actions and then train a policy that predicts the likelihood of the expert taking a latent action given an observation. We then use a small dataset with expert ground-truth actions for mapping latent to real actions (see the appendix for more details).

我们相信,Genie 有朝一日可以作为训练通用智能体的基础世界模型。 图13 表明,给定起始帧,该模型已经可以在未见过的强化学习环境中生成多样化轨迹。 我们进一步研究从互联网视频中学习到的潜在动作能否用于模仿未见视频中的行为。 我们使用冻结的 LAM,以离散潜在动作标注来自目标环境的一系列专家视频,然后训练一个策略,使其根据观测预测专家采取某一潜在动作的可能性。 随后,我们使用包含专家真实动作的小型数据集,将潜在动作映射到真实动作,更多细节见附录。

Genie 根据 CoinRun 起始帧生成多样化轨迹
图13:从强化学习环境开始游玩。给定未见强化学习环境中的一张图像,Genie 可以生成多样化轨迹。

We evaluate in both hard and easy settings of a procedurally generated 2D-platformer environment, CoinRun, and compare against an oracle behavioral cloning (BC) model that has access to expert actions as an upper bound, and a random agent as a lower bound (Figure 14). The LAM-based policy achieves the same score as the oracle given as few as 200 expert samples to adapt, despite almost certainly never seeing CoinRun before. This provides evidence that the learnt latent actions are consistent and meaningful for transfer, as the mapping from latent to real contains no information about the current observation.

我们在程序生成的二维平台环境 CoinRun 的困难和简单设置中进行评估,并与两种基线比较:能够访问专家动作的预言机行为克隆(BC)模型作为上界,随机智能体作为下界(图14)。 尽管 LAM 几乎肯定从未见过 CoinRun,但基于 LAM 的策略只需 200 个专家样本进行适配,便能取得与预言机相同的分数。 这证明学习到的潜在动作具有一致性和有意义的迁移能力,因为从潜在动作到真实动作的映射不包含当前观测的任何信息。

Genie LAM 策略、行为克隆预言机与随机策略在 CoinRun 上的结果
图14:行为克隆结果。在 100 个样本上计算关卡完成率的均值,并在 5 个随机种子上取平均;误差线表示 95% 置信区间。

3.4 Ablation Studies

Design choices for latent action model. In designing our latent action model, we carefully considered the type of input to use. While we ultimately chose to use the original images (pixels), we evaluated this choice against the alternative of using tokenized images (replacing x with z in Figure 4). We refer to this alternative approach as the “token-input” model (see Table 2).

潜在动作模型的设计选择。 在设计潜在动作模型时,我们仔细考虑了应使用哪种输入。 尽管最终选择使用原始图像,即像素,但我们也将其与使用分词图像的替代方案进行比较,后者相当于在 图4 中用 z 替换 x。 我们将这一替代方法称为“词元输入”模型(见 表2)。

While this model achieved a slightly lower FVD score on the Platformers dataset, it did not maintain this advantage on the Robotics dataset. More importantly, in both environments, the token-input model exhibited worse controllability (as measured by ΔtPSNR). This suggests that some information about video dynamics and movement might have been lost during tokenization, and as a result it is beneficial for the latent action model to take in raw videos as input.

尽管该模型在 Platformers 数据集上取得略低的 FVD 分数,但在 Robotics 数据集上未能保持这一优势。 更重要的是,在两个环境中,词元输入模型都表现出更差的可控性,这由 ΔtPSNR 衡量。 这说明视频动力学和运动的部分信息可能在分词过程中丢失,因此潜在动作模型使用原始视频作为输入更有利。

表2:潜在动作模型输入消融。Genie 取得了更高的可控性。
Dataset#ParamsFVD ↓ΔtPSNR ↑
Token-inputPlatformers2.3B38.81.33
Pixel-input (Genie)Platformers2.5B40.11.91
Token-inputRobotics1B257.81.65
Pixel-input (Genie)Robotics1B136.42.07

Tokenizer architecture ablations. We compare the performance of three choices of tokenizers, including 1) (spatial-only) ViT, 2) (spatial-temporal) ST-ViViT and 3) (spatial-temporal) C-ViViT (Table 3). For comparison we use similar number of parameters for all tokenizers, with patch size 10, batch size 128 and sequence length 16. We then train the same dynamics and latent action model on these three different tokenizers, and report their FVD as well as ΔtPSNR.

分词器架构消融。 我们比较三种分词器的性能,包括 1)仅使用空间信息的 ViT,2)使用时空信息的 ST-ViViT,以及 3)使用时空信息的 C-ViViT(表3)。 为便于比较,所有分词器都使用相近的参数量,补丁大小为 10,批大小为 128,序列长度为 16。 随后,我们在这三种不同分词器上训练相同的动力学模型和潜在动作模型,并报告其 FVD 和 ΔtPSNR

表3:分词器架构消融。我们提出的 ST-ViViT 架构得到性能最佳的分词器。
#ParamsMemoryFVD ↓ΔtPSNR ↑
ViT230M0.3GB114.51.39
C-ViViT225M1.6GB272.71.37
ST-ViViT (ours)205M0.9GB81.41.66

Our proposed ST-ViViT architecture provides both improved video generation (FVD) and ΔtPSNR, for a reasonable trade-off in memory, as compared to to C-ViViT and the spatial-only ViT. This demonstrates its ability to generate videos of high fidelity and controllability, respectively. While C-ViViT employs a full space-time attention mechanism, resulting in significantly higher memory consumption compared to the other two architectures at the same parameter count, this does not translate to improved performance. In fact, C-ViViT exhibits a tendency towards overfitting, necessitating strong regularization during training, which might explain its considerably lower performance.

与 C-ViViT 和仅使用空间信息的 ViT 相比,我们提出的 ST-ViViT 架构在合理的内存权衡下,同时改善了视频生成性能(FVD)和 ΔtPSNR 这分别证明了它生成高保真、高可控视频的能力。 C-ViViT 采用完整的时空注意力机制,在参数量相同的情况下,其内存消耗显著高于另外两种架构,但这并未转化为性能提升。 事实上,C-ViViT 表现出过拟合倾向,训练期间需要较强的正则化,这可能解释了它明显较低的性能。

World models. Generative interactive environments can be considered a class of World Models, which enable next-frame prediction that is conditioned on action inputs. Such models can be useful for training agents, as they can be used for learning policies without direct environment experience at agent training time. However, learning the models themselves typically requires action-conditioned data obtained directly from the environment. In contrast, our approach seeks to learn a world model in an unsupervised fashion from videos alone. Recently, there has been renewed emphasis on scaling world models. GAIA-1 and UniSim learn world models for autonomous driving and robotic manipulation respectively. These approaches require both text and action labels, while we focus on training from video-only data from publicly available Internet videos.

世界模型。 生成式交互环境可以被视为一类 世界模型,它能够以动作输入为条件预测下一帧。 此类模型有助于训练智能体,因为在智能体训练阶段,无需直接体验环境即可用它们学习策略。 然而,学习模型本身通常需要直接从环境中获得以动作为条件的数据。 相比之下,我们的方法试图仅从视频中以无监督方式学习世界模型。 近期,世界模型的规模扩展再次受到重视。 GAIA-1 和 UniSim 分别学习用于自动驾驶和机器人操控的世界模型。 这些方法同时需要文本和动作标签,而我们专注于只使用公开互联网视频数据进行训练。

Video models. Our work is related to video models, which typically condition on initial frames (or text) and predict the remaining frames in a video. Our approach most resembles recent transformer based models such as Phenaki, TECO and MaskViT, as we use MaskGIT and an ST-Transformer over tokenized images. While video models are becoming increasingly controllable, we seek a more agentic goal and explicitly learn a latent action space from data, allowing users or agents to “play” the model using latent action-conditioned predictions.

视频模型。 我们的工作与 视频模型 相关;此类模型通常以初始帧或文本为条件,预测视频中的其余帧。 我们的方法与 Phenaki、TECO 和 MaskViT 等近期基于 Transformer 的模型最为相似,因为我们在分词图像上使用 MaskGIT 和 ST-Transformer。 尽管视频模型正变得越来越可控,但我们追求更具智能体性质的目标,并显式地从数据中学习 潜在动作空间,使用户或智能体能够使用以潜在动作为条件的预测来“游玩”模型。

Playable Video Generation. Genie generalizes beyond Playable Video Generation (PVG), where latent actions are used for controlling world models learnt directly from videos. In contrast to Genie, PVG considers domain-specific static examples, rather than generating entirely new environments via prompting. Thus, scaling beyond this setting required non-trivial architectural changes, dropping inductive biases in exchange for a general method.

可游玩视频生成。 Genie 的适用范围超越了可游玩视频生成(PVG);后者使用潜在动作控制直接从视频中学习到的世界模型。 与 Genie 不同,PVG 考虑领域特定的固定示例,而不是通过提示生成全新的环境。 因此,要超越这一设置进行扩展,需要进行非平凡的架构改动,以舍弃归纳偏置换取通用方法。

Environment generation. Our work is also related to Procedural Content Generation (PCG) where machine learning has proven highly effective for generating game levels, recently via language models that directly write game code. Language models themselves can also be considered to be interactive environments, albeit lacking a visual component. By contrast in our setting the levels can be learnt and generated directly from pixels, which enables us to utilize the diversity of Internet video data.

环境生成。 我们的工作还与 程序化内容生成(PCG)相关;机器学习已被证明在生成游戏关卡方面非常有效,近期方法还使用语言模型直接编写游戏代码。 语言模型本身也可以被视为交互环境,只是缺少视觉组件。 相比之下,在我们的设置中,可以直接从像素学习并生成关卡,从而利用互联网视频数据的多样性。

Training agents with latent actions. Prior works have used latent actions for imitation from observation, planning and pre-training RL agents. These approaches have similar objectives to our latent action model, though have not been applied at scale. VPT is a recent approach that uses an inverse dynamics model learnt from human-provided action labeled data, to label Internet-scale videos with actions that can then be used for training a policy. We showed, in contrast, that we can use latent actions learnt from Internet videos to infer policies for arbitrary environments, avoiding the need for ground-truth actions that are costly and may not generalize.

使用潜在动作训练智能体。 先前工作已将潜在动作用于观测模仿、规划和强化学习智能体预训练。 这些方法与我们的潜在动作模型具有相似目标,但尚未得到大规模应用。 VPT 是一种近期方法,它从人类提供的带动作标签数据中学习逆动力学模型,再用该模型为互联网规模的视频标注动作,随后用于训练策略。 相比之下,我们表明,可以使用从互联网视频中学习到的 潜在 动作为任意环境推断策略,从而避免依赖成本高昂且可能无法泛化的真实动作。

5. Conclusion and Future Work

We proposed Genie, a new form of generative AI that enables anyone, even children, to dream up, create, and step into generated worlds as we can with human-designed simulated environments. Genie can be prompted to generate a diverse set of interactive and controllable environments despite training from video-only data.

我们提出 Genie,这是一种新的生成式人工智能形式,使任何人,甚至儿童,都能像进入人类设计的模拟环境一样,构想、创建并进入生成的世界。 尽管只使用视频数据训练,Genie 仍可在提示下生成多种交互式、可控环境。

There are clear improvements that can be made to the model. Genie inherits some of the weaknesses of other autoregressive transformer models, and can hallucinate unrealistic futures. And while we have made progress with spatiotemporal representations, we are still limited to 16 frames of memory which makes it challenging to get consistent environments over long horizons. Finally, Genie currently operates around 1FPS and requires future advances to achieve an efficient frame rate for interaction.

该模型显然仍有改进空间。 Genie 继承了其他自回归 Transformer 模型的部分弱点,可能会产生不真实的未来幻觉。 尽管我们在时空表示方面取得了进展,但记忆仍局限于 16 帧,这使长时间跨度内保持环境一致性颇具挑战。 最后,Genie 当前运行速度约为 1 FPS,未来仍需进一步发展才能达到适合交互的高效帧率。

Still, we believe Genie opens up vast potential for future research. Given its generality, the model could be trained from an even larger proportion of Internet videos to simulate diverse, realistic, and imagined environments. Furthermore, we only briefly touched upon the capabilities of using Genie for training agents, but given that the lack of rich and diverse environments is one of the key limitations in RL, we could unlock new paths to creating more generally capable agents.

尽管如此,我们相信 Genie 为未来研究开启了巨大潜力。 鉴于其通用性,该模型可以在更大范围的互联网视频上训练,以模拟多样、真实和想象中的环境。 此外,我们对使用 Genie 训练智能体的能力只做了简要探索;考虑到缺少丰富且多样的环境是强化学习的关键限制之一,这项工作可能为创建能力更加通用的智能体开辟新路径。

Broader Impact

Societal Impact. Genie could enable a large amount of people to generate their own game-like experiences. This could be positive for those who wish to express their creativity in a new way, for example children who could design and step into their own imagined worlds. We also recognize that with significant advances, it will be critical to explore the possibilities of using this technology to amplify existing human game generation and creativity---and empowering relevant industries to utilize Genie to enable their next generation of playable world development.

社会影响。 Genie 可以使大量用户生成自己的类游戏体验。 这会给希望以新方式表达创造力的人带来积极影响,例如儿童可以设计并进入自己想象的世界。 我们也认识到,随着技术取得重大进展,探索如何使用该技术放大人类现有的游戏创作与创造力,并赋能相关产业利用 Genie 开发下一代可游玩世界,将至关重要。

Training Data and Weights. We have chosen not to release the trained model checkpoints, the model's training dataset, or examples from that data to accompany this paper or the website. We would like to have the opportunity to further engage with the research (and video game) community and to ensure that any future such releases are respectful, safe and responsible.

训练数据与权重。 我们选择不随论文或网站发布训练后的模型检查点、模型训练数据集或该数据中的示例。 我们希望有机会进一步与研究界及电子游戏社区交流,并确保未来任何此类发布都尊重相关群体,同时安全且负责任。

Reproducibility. We understand that it may be challenging for researchers with fewer computational to reproduce our main results. In order to mitigate this issue, we describe a smaller scale, fully reproducible example in the appendix that can run on a single mid-range TPU (or GPU). Given that many design choices translate between the two settings, we believe this will make it possible for the broader community to investigate future architectural improvements as well as additional research directions resulting from our work.

可复现性。 我们理解,计算资源较少的研究者可能难以复现我们的主要结果。 为了缓解这一问题,我们在附录中描述了一个规模更小、完全可复现的示例,它可以在单个中端 TPU 或 GPU 上运行。 由于许多设计选择可以在两种设置之间迁移,我们相信这将使更广泛的研究社区能够探索未来的架构改进,以及由本工作引出的其他研究方向。