Let us define what it means to generate something. In machine learning, we call a data distribution as the space of data itself, and denote it as pdata. Mathematically, one can think of pdata as a probability density, i.e. a function
pdata:Rd→R⩾0
A generative model is a machine learning model that allows us to generate samples from pdata. When generating a new object z, we say that we sample it from the data distribution pdata.
A dataset consists of a finite number of samples z1,⋯,zN∼pdata. In many cases, we want to generate an object conditioned on some data y. We can rephrase this as sampling from a conditional distribution pdata(⋅∣y), where y is a conditioning variable.
In the following chapters, we will talk about how to realize this sampling process.
Flow and ODEs
We start by defining ordinary differential equations (ODEs). Every ODE is defined by a vector field u, which has both spatial feature x∈Rd and temporal feature t∈[0,1] as follows
u:Rd×[0,1]→Rd,(x,t)↦ut(x)
An ODE imposes a condition on a trajectory: we want a trajectory X=Xt that follows along the lines of the vector field ut, starting at the point x0. This could be described as an ODE equation
dtdXt=ut(Xt),X0=x0
We may now ask: if we start at X0=x0 at t=0, where are we at time t (what is Xt)? This question is answered by a function called the flow, which is a solution to the ODE
ψ:Rd×[0,1]→Rd,ψt(X0)=Xt
Therefore, vector fields, ODEs, and flows are, intuitively, three descriptions of the same object: vector fields define ODEs whose solutions are flows.
也就是说,速度场 ut(x) 定义了一个常微分方程 ODE,其解可以表示为流函数 ψ。
[{"url":"/img/world/flow1.png","alt":"Vector Field and ODE","title":""}]
If u:Rd×[0,1]→Rd is continuously differentiable with a bounded derivative, then the ODE above has a unique solution given by a flow ψt.
We can now construct a generative model via an ODE by making the vector field a neural network vector field utθ. Specifically, we choose an initial distribution pinit∼N(0,Id) for simplicity. A flow model is then described by the following ODE
X0∼pinit,dtdXt=utθ(Xt)
Our goal is to make the endpoint X1 of the trajectory have distribution pdata, i.e.
X1=ψ1θ(X0)∼pdata
where ψtθ describes the flow induced by utθ. In order to compute the flow, we need to simulate the ODE. One way is to use the Euler method with the iteration steps Xt+h=Xt+hut(Xt), which h is very small.
Diffusion and SDEs
Stochastic differential equations (SDEs) extend the deterministic trajectories from ODEs with stochastic trajectories. A stochastic trajectory is commonly called a stochastic process (Xt)0⩽t⩽1 and is given by
X:[0,1]→Rd,t↦Xt is a random trajectory for every random X
SDEs are constructed via a Brownian motion. You can think of a Brownian motion as a continuous random walk. Specifically, A Brownian motion W=(Wt)0⩽t⩽1 is a stochastic process such that W0=0, the trajectories t↦Wt are continuous, with the following 3 features
Wt−Ws∼N(0,(t−s)Id) for all 0⩽s⩽t.
For any 0⩽t0⩽t1⩽⋯⩽tn⩽1, the increments Wti−Wti−1 are independent random variables.
We can easily simulate a Brownian motion approximately with step size h>0 by setting W0=0 and updating Wt+h=Wt+hε, where ε∼N(0,Id) is a random Gaussian noise.
A stochastic differential equation(SDE) is usually denoted in the following symbolic notation
X0=x0,dXt=ut(Xt)dt+σtdWt
where σt⩾0 describes the diffusion coefficient. Finally, note that every ODE is also an SDE – simply with a diffusion coefficient σt=0. Therefore, when we speak about SDEs, we consider ODEs as a special case.
How might we simulate an SDE? The simplest such scheme is known as the Euler-Maruyama method, and is essentially to SDEs what the Euler method is to ODEs. Using the Euler-Maruyama method, we initialize X0=x0 and update iteratively via
Xt+h=Xt+hut(Xt)+σthε,ε∼N(0,Id)
SDE generative models
Throughout this chapter, a diffusion model consists of a neural network utθ with parameters θ that parameterize a vector field and a fixed diffusion coefficient σt as follows
Neural networkutθ:Rd×[0,1]→Rd,(x,t)↦utθ(x)
Diffusion coefficientσt:[0,1]→[0,+∞),t↦σt
To obtain samples from our SDE model (i.e. generate objects), the procedure is as follows
Initialization:X0∼pinit
Simulation:dXt=utθ(Xt)dt+σtdWt
Goal:X1∼pdata
where a diffusion model with σt=0 is call a flow model.
L2. Training Target
Key ideas
As we discussed, our goal is that X1 is distributed according to the data distribution pdata, i.e. X1∼pdata. But how do we optimize θ such that simulating the diffusion model results in samples from the data distribution X1∼pdata?
One way is to minimize the mean squard error between our neural network utθ and the target vector field uttarget, shown as:
L(x,θ)=∥utθ(x)−uttarget(x)∥2
However, we don’t yet know what the target uttarget looks like. So in this chapter, we will introduce how to construct a training target uttarget with some math tricks. Before that, here are two key terminology necessary to understand
Conditional means per single data point
Marginal means across distribution of data points
Conditional and marginal probability path
The first step is to specify a probability path. Intuitively, a probability path specifies a gradual interpolation between noise pinit and data pdata. A simple distribution called Dirac distribution δz is defined that X∼δz,X=z i.e. the Dirac distribution always gives one single certain output z.
A conditional probability path is a set of distribution pt(x∣z) over Rd such that
p0(x∣z)=pinit,∀z∈Rdp1(⋅∣z)=δz
In other words, a conditional probability path gradually converts the initial distribution pinit into a single data point. One particularly popular probability path is the Gaussian probability path. This is the probability path used by most state-of-the-art models. Let αt,βt be two noise schedulers: two continuously differentiable, monotonic functions with α0=β1=0 and α1=β0=1. We then define the conditional probability path (usually with αt=t and βt=1−t)
pt(⋅∣z)∼N(αtz,βt2Id)
Every conditional probability path pt(x∣z) induces a marginal probability pathpt(x) defined as the distribution that we obtain by first sampling a data point z∼pdata from the data distribution and then sampling from pt(⋅∣z), such that
pt(x)=∫pt(x∣z)pdata(z)dz
The marginal probability path pt satisfies that
p0(x)=pinit,p1(x)=pdata
We can express sampling from the marginal Gaussian path pt as
z∼pdata,ε∼pinit=N(0,Id)⇒x=αtz+βε∼pt
这两种概率路径可以这样理解
条件概率路径: 已知一个具体样本 z,如何构造从噪声到该样本的概率分布变化过程
边缘概率路径: 考虑整个数据集时,整体概率分布如何从噪声分布演化到真实数据分布
Conditional and marginal vector fields
For every data point z∈Rd, let uttarget(⋅∣z) denote a conditional vector field. This can be any vector field such that corresponding ODE yields the conditional probability path pt(⋅∣z), i.e. such that it holds
X0∼pinit,dtdXt=uttarget(Xt∣z)⇒Xt∼pt(⋅∣z)
We can often find a conditional vector field uttarget(⋅∣z) analytically by hand. This means that all endpoints of the ODE X1 will collaspe to X1=z, but we can use a marginalization trick to transform the conditional vector field into the marginal vector fielduttarget(x) defined as
Let’s gain some intuition for the marginal vector field.
Bayes’ rule says that pt(x)pt(x∣z)pdata(z) describes a posterior distribution. The marginal vector field then is simply an average: for every possible data point z, it takes the velocity ut(x∣z) (i.e. the direction that would bring us to z) and then weighs this velocity by how much we believe that x comes from z. Averaging over all data points, we obtain the marginal vector field.
Mathematically, an flow model with vector field uttarget(x) with X0∼pinit satisfies Xt∼pt if and only if the continuity equation below holds. This could give out the only form of uttarget in (7)
∀x∈Rd,t∈[0,1]∂tpt=−div(ptuttarget)(x)
As before, let pt(⋅∣z)=N(αtz,βt2Id) for noise schedulers αt,βt. Let α˙t=∂tαt,β˙t=∂tβt denote respective time derivatives of αt,βt. Here, we want to show that the conditional Gaussian vector field given by
uttarget(x∣z)=(α˙t−βtβ˙tαt)z+βtβ˙tx
Conditional and marginal score functions
Diffusion models take a different perspective focused on score functions. Therefore, in this section, we will rephrase what we have learned here in the language of score functions. Let q(x) be an arbitrary probability distribution. Then the score function of q is defined as ∇logq(x), i.e. as the gradient of the log-likelihood of q with respect to x.
Let us return to the setting of conditional probability paths pt(x∣z) and marginal probability paths pt(x). Then we can equivalently define the conditional score function as ∇xlogpt(x∣z) and the marginal score function as ∇logpt(x). the marginal score can be expressed via the conditional score function ∇xlogpt(x∣z) via
For any diffusion coefficient σt⩾0, we may construct an SDE by adding stochastic dynamics to the dynamics of the original ODE. By doing so, we could combine the stochastic continuity equation and get
In a flow model, our goal is to set utθ(x)≈uttarget(x). If this holds, we know that the endpoints X1∼pdata. In the following, we denote U[0,1] as the uniform distribution on the interval [0,1], and E the expected value of a random variable. An intuitive way of obtaining utθ(x)≈uttarget(x) is to use a mean-squared error, i.e. to use the flow matching loss defined as
LFM=Et∼U[0,1],x∼pt[∥utθ(x)−uttarget(x)∥2]
Intuitively, this loss describes the following workflow:
Draw a random time t∈[0,1]
Draw a random point z from our data set, sample from pt(⋅∣z) and compute utθ(x)
Compute the loss between the output of our neural network and the marginal vector field uttarget(x)
Conditional flow matching loss
While we do know the formula for uttarget(x) by (7), we cannot compute it efficiently as the
integral is intractable in high dimensions. Instead, we will exploit the fact that the conditional velocity field uttarget(x) is tractable. To do so, let us define the conditional flow matching loss as
Note the difference to (12): we use the conditional vector field uttarget(x∣z) instead of the marginal vector uttarget(x). As we have an analytical formula for uttarget(x∣z), we can minimize the above loss easily.
Actually, we could proof that the marginal flow matching loss equals the conditional flow matching loss up to a constant, that is
LFM(θ)=LCFM(θ)+C
here C is independent of θ. Therefore, their gradients coincide:
∇θLFM(θ)=∇θLCFM(θ)
In particular, for the minimizer θ∗ of LCFM(θ), it will hold that utθ∗(x)=uttarget(x), i.e. the
neural network will equal the marginal vector field. This is an exploding result, which shows that we can simply minimizing LCFM(θ) to get the solution of flow matching ODE.
Proof of Equation (13)
The proof works by expanding the mean-squared error into three components and removing constants:
It’s easy to see that C=C2−C3 is not relied on θ, thus we get to the end
∇θLFM(θ)=∇θLCFM(θ)
Flow matching algorithm
Now we could discuss the algorithm of training a flow model. For a Gaussian CondOT pathpt(x∣z)=N(tz,(1−t)2) (i.e. αt=t,βt=1−t), suppose we have a dataset of samples z∼pdata and a untrained neural network utθ. Here’s the training algorithm below.
Algorithm 1 Flow Matching Training for CondOT path
for each mini-batch of data do
Sample a data example z from the dataset
Sample a random time t∼U[0,1]
Sample noise ε∼N(0,Id)
Compute x=tz+(1−t)ε∼pt(x∣z)
Compute LCFM(θ)=∥utθ(x)−(z−ε)∥2 where (z−ε)=uttarget(x∣z)
Update θ←grad_algorithm(LCFM(θ))
end for
When we’ve trained a flow matching model, we could simply draw a sample X0∼pinit and simulate the ODE defined by our neural network utθ(x). By doing so, we could generate new data X1.
In previous chapters, we’ve introduced vector fields and score functions. Now let’s consider their relationships: For the Gaussian path pt(x∣z)=N(αtz,βt2Id), we can use the form of the Gaussian probability density that
∇xlogpt(x∣z)=∇xN(αtz,βt2Id)=−βt2x−αtz
Note that the score function for a Gaussian probability path is a linear function of x and z. The same is true for the conditional vector field uttarget(x∣z) in (9). It is thus possible to convert between the two, shown as
uttarget(x∣z)=at∇xlogpt(x∣z)+btx
where at,bt are
at=(αtα˙tβt2−β˙tβt),bt=αtα˙t
Notice that the marginal vector field uttarget(x) and marginal score function ∇logpt(x) shares the same form of intergrals, thus we could also get the following equation
uttarget(x)=at∇logpt(x)+btx
This is striking because it says that once we’ve learned uttarget(x) we’ve also learned the score function ∇logpt(x), and vice versa. We can illustrate with the following equation:
vector(x,z)=at⋅score(x,z)+btx
Score matching loss
Before, we’ve introduced how to train and use a flow model. Now we consider a diffusion model corresponding to a certain SDE. A quick recap is that
where ∇logpt(Xt) is the marginal score function. In flow matching algorithm, we train the neural network utθ(x) to get close to marginal vector field uttarget(x). What if we train the score function stθ(x) to approximate the marginial score ∇logpt(x)? In the same way as before, we can design a score
matching loss and a denoising score matching loss:
As before, we ideally would want to minimize the score matching loss but can’t because we don’t know ∇logpt(x). But similarly as before, the denoising score matching loss is a tractable alternative, i.e. holds
∇θLSM(θ)=∇θLCSM(θ)
This is easy to proof promised by (13),(17).
Denoising diffusion model
Denoising Diffusion Probabilitic Models, known as DDPM or General Diffusion Model is designed based on score matching algorithm. When referring to the original paper, you could learn a different way of approching using Markov chain. In this section, we proof it using score matching theory.
Note that the network stθ essentially learns to predict the noise that was used to corrupt a data sample z. This explains why the above training loss is called denoising score matching. Now we construct a neural network εtθ to predict noise ε instead of stθ, i.e. using reparameterization trick:
−βtstθ(x)=εtθ(x)
If βt≈0, the loss is numerically unstable, thus we drop the constant term 1/βt2 that
So far, the generative models we considered were unguided, e.g. an image model would simply generate some image. Mathematically speaking, this meant that our model returned samples from an unconditional data distribution pdata(z). However, in most cases, our goal is not to merely generate an arbitrary object, but to generate an object conditioned on some additional information.
In other words, we want to guide the model to generate objects of a certain kind. For example, one might imagine a generative model for images which takes in a text prompty, and then generates an image x that fits to the text prompt y.
Unconditional prompt: Generate an image.
Conditional prompt: Generate an image of a cat baking a cake.
In the following chapters, we will use y for conditional information.
Vanilla guidance
Let’s consider a common way for conditional generation. Think of a conditioning variable or prompt y to live in a space Y. We define a guided diffusion model to consist of a guided vector field utθ(⋅∣y), parameterized by a neural network, and a time-dependent diffusion coefficient σt⩾0, together given by
Essentially, we are sampling (z,y)∼pdata rather than just z∼pdata.
Classifier guidance
In theory, vanilla guidance should lead to a faithful generation procedure of pdata(⋅∣y). However, it was soon empirically realized that images samples with this procedure did not fit well enough to the desired label y. This can have a diversity of reasons:
The model might underfit (i.e. we do not actually learn the true marginal vector field)
Our data might be imperfect (e.g. text-image pairs from the world wide web have a lot of errors).
Therefore, to truly generate samples that fit better to a prompt, we have to find a way to artificially reinforce the prompt variable y. The main technique for doing so is called classifier-free guidance(CFG) that is widely used in the context of state-of-the-art diffusion models, and which we discuss next. Before that, we introduce the classifier guidance method.
Recap that the vector field uttarget and ∇logpt are connected by the following
uttarget(x)=at∇logpt(x)+btx
Now, rewrite the above equation using conditional variable y
uttarget(x∣y)=at∇xlogpt(x∣y)+btx
Using Bayes’ rule on the term ∇logpt(x∣y), we get
Notice the shape of the above equation: The guided vector field uttarget(x∣y) is a sum of the unguided vector field uttarget(x) plus a gradient of the likelihood pt(y∣x) of the guidance variable y.
As people observed that their image x did not fit their prompt y well enough, it was a natural idea to scale up the contribution of the ∇xlogpt(y∣x) term, yielding
u~(x∣y)=uttarget(x)+wat∇xlogpt(y∣x)
where w>1 is known as the guidance scale. How can we learn the term logpt(y∣x)? Note that this can be considered as a sort of classifier of noised data (i.e. it gives the log-likelihoods of y given x). So we can simply learn it via supervised learning. This is called classifier guidance method.
Classifier-free guidance
While classifier guidance is possible in principle, it comes with difficulties
We need to train a classifier alongside a flow/diffusion model- so we have 2 networks instead of 1. This increases the cost for training and generating process.
If the y is high-dimensional, e.g. a text prompt and not just a class, then pt(y∣x) might be very hard to learn and the gradient ∇logpt(y∣x) hard to obtain.
For this reason, classifier-free guidance was introduced. Classifier-free guidance results in the theoretically equivalent effect as classifier guidance but without having to train a separate classifier. We could do some algebra appling the equality ∇xlogpt(x∣y)=∇logpt(x)+∇xlogpt(y∣x) into (23),(24):
We may therefore express the scaled guided vector field u~t(x∣y) as the linear combination of the unguided vector field uttarget(x) with the guided vector field uttarget(x∣y). It seems that we need to train both uttarget(x) and uttarget(x∣y), but we can use the additional label ∅ that denotes the absence of conditioning, i.e.
uttarget(x)=uttarget(x∣∅)
This approach of training a conditional and unconditional model in one is known as classifier-free guidance(CFG). In short, we’ve create a new way to train both uttarget(x) and uttarget(x∣y) in one single network uttarget(x∣⋅):
u~t(x∣y)=(1−w)uttarget(x∣∅)+wuttarget(x∣y)
When w=1, it’s easy to get u~t(x∣y)=uttarget(x∣y).
Training with CFG
We must now amend the guided conditional flow matching objective to account for the possibility of y=∅. The challenge is that when sampling (z,y)∼pdata, we will never obtain y=∅. It follows that we must introduce the possibility of y=∅ artificially. To do so, we will define a hyperparameter η to be the probability that we discard the original label y, and replace it with ∅.
We thus arrive at our CFG conditional flow matching training objective as
LCFMguided(θ)=E□[∥utθ(x∣y)−uttarget(x∣z)∥2]
□=(z,y)∼pdata(z,y),t∼U[0,1],replace y=∅ with prob. η
Algorithm 3 Flow Matching Training for Gaussian path
For diffusion model with CFG, we simply do the same thing for simulating SDEs. Actually, almost any image or video that you see that is AI-generated relied heavily on classifier-free guidance w⩾4.
L6. Architectures
Key ideas
In the previous sections, we learned how to train a flow matching or diffusion model to sample from a distribution pdata(x∣y). This recipe is general and can be applied to a variety of different data types and applications. Some well-known models such as FLUX 2.0, Stable Diffusion 3, Nano Banana and VEO-3 or Meta Movie Gen Video are designed with awesome model architectures, which we’ll introduce in this chapter.
To handle with image information, an image with RGB channels is simply described as a vector x∈R3×H×W. In the remain part of this chapter, we will explore ways of realizing the neural network θ with some tricks, bringing out a workable model for image generations.
Embedding informations
First, we’ll consider how the raw conditioning information (the time t and the conditioning variable y) are embedded into a vector-valued form digestible by the actual model.
Embedding time
In practice, the scalar time t is often embedded in a higher dimensional space using Fourier features, allowing the model to more faithfully capture high-frequency time dependence. The embedding trick of Fourier features is first used in the famous paper Attention is all you need, usually described as
Where wmax,wmin are manually set. This choice of TimeEmb is a standard choice but this exact form is not strictly necessary. Rather, the above is simply a convenient way of obtaining a normed embedding of dimension d, i.e.
∥TimeEmb(t)∥=1
Embedding class labels
When yraw∈Y={0,...,N} is just a class label, then it is often easiest to simply
learn a separate embedding vector for each of the N+1 possible values of yraw, and set y to this embedding vector. One would consider the parameters of these embeddings to be included in the parameters of utθ(x∣y), and would therefore learn these during training.
类别标签通常采用可学习式嵌入法。
Embedding textual input
When yraw is a text-prompt, the situation is more complex, and approaches largely rely on frozen, pre-trained models. One such model is known as CLIP (Contrastive Language-Image Pre
training).
CLIP is trained to learn a shared embedding space for both images and text-prompts, using a training loss designed to encourage image embeddings to be close to their corresponding prompts, while being farther from the embeddings of other images and prompts.
Therefore, one usually take y=CLIP(yraw) as the embedding vector produced by a frozen, pre-trained CLIP model. In certain cases, it may be undesirable to compress the entire sequence into a single representation. In this case, one might additionally consider embedding the prompt using a pre-trained transformer so as to obtain a sequence of embeddings.
Diffusion transformers
One particularly prominent architectural class are so-called diffusion transformers (DiTs), and their variants, which use the attention mechanism to construct the network. For query Q, key K and value V, their scaled dot product attention is usually calculated by
Attention(Q,K,V)=softamx(d/hQKT)V
Where d is the hidden dimension, and h denotes the number of attention heads. We do patchify similar to ViT and get N patches Patchify(X)∈RN×C′ of the image input X∈RC×H×W, then we apply a linear transformation to get the patch embedding
PatchEmb(X)=Patchify(X)⋅WP∈RN×d
DiT has several units, so-called DiT blocks. The inputs to the diffusion transformer are then the time embedding, the prompt embedding, and the patchified image tensor given by
After these DiT blocks, we depatchify the output to get the image representation of the output. Now consider a certain DiT block: the query, key and value matrix are projections of given inputs, that is
Q(h)=xWQ(h),K(h)=zWK(h),V(h)=zWV(h)
where z=x do self-attention and z=y do cross-attention to the prompt. The headh do attention operations by (28), then we concatenate heads and apply an output projection as
MultiHeadAttention=Concat(headi)i=1h⋅WO∈RN×d
We also consider the adaptive normalization layer, that gives scale/shift parameters by MLPs
The U-net architecture is an alternative architecture to the DiT architecture and is a specific type of convolutional neural network. A U-net consists of a series of encoders Ei, and a corresponding sequence of decoders Di, along with a latent processing block in between, which we shall refer to as a midcoder M.
The U-Net derives its name from the U-like shape formed by its encoders and decoders (see the figure below). Both the encoder and the decoder usually consist of a series of convolutional layers (with activation functions, pooling operations, etc. in between).
The cost of modeling directly within such an image space Rd quickly becomes prohibitively expensive as one scales to increasingly higher resolution images. For example, a 1024×1024
image with three RGB color channels corresponds to a total dimension of d=3HW≈3×106. The important question thus becomes: How can we model high-dimensional images within a reasonable memory and computation budget?
A variational autoencoder (VAE) is obtained from a standard autoencoder formulation by relaxing the constraint that the encoder and decoder are deterministic functions. It’s basic ideas is that we compress our high-dimension input x into a latent space variable z (with low-dimension), then we decode it into high dimension space.
The encoder and decoder are parameterized by
z∼qϕ(⋅∣x),x∼pθ(⋅∣z)
More details about VAE are omitted here, but it gives us an inspiration: what if we use a VAE-encoder to get x~=E(z), then we do flow or diffusion operations on x~, and decode it to get the generation of x=D(x~). Using this architecture to do diffusion process is called a latent diffusion.
L7. Case Study
Stable diffusion 3
Stable Diffusion is a series of state-of-the-art image generation models. These models were among the first to use large-scale latent diffusion models for image generation.
Stable Diffusion 3 uses the same conditional flow matching model that we study in this work. It follows the approach by training within the latent space of a pre-trained autoencoder. Training a good autoencoder was a big contribution of the first stable diffusion papers.
To enhance text conditioning, Stable Diffusion 3 makes use of both 3 different types of text embeddings (including CLIP embeddings as well as the sequential outputs produced by a pretrained instance of the encoder of Google’s T5-XXL). They modified DiT referred to as a multi-modal DiT (MM-DiT), shown in the figure below.
The final, largest model has 8 billion parameters. For sampling, they use 50 steps (i.e. they have to evaluate the network 50 times) using a Euler simulation scheme and a classifier-free guidance weight between 2.0−5.0
MovieGen
Next, we discuss Meta’s video generator, Movie Gen Video. As the data are not images but videos, the data x lie in the space RT×C×H×W where T represents the new temporal dimension (i.e. the number of frames).
Movie Gen Video utilizes the conditional flow matching objective with the same straight line schedulers αt=t,βt=1−t. Like Stable Diffusion 3, Movie Gen Video also operates in the latent space of frozen, pretrained autoencoder.
Specifically, the authors propose to handle the added time dimension by introducing a temporal autoencoder
(TAE) which maps a raw video xt′∈RT′×3×H′×W′ to a latent xt∈RT×C×H×W with
TT′=HH′=WW′=8
To accomodate long videos, a temporal tiling procedure is proposed by which the video is chopped up into pieces, each piece is encoder separately, and the latents are sticthed together.
For text conditioning, Movie Gen Video employs three types of text embeddings:
UL2 embeddings: for granular, text-based reasoning
ByT5 embeddings: for attending to character-level details (for e.g., prompts explicitly requesting specific text tobe present)
MetaCLIP embeddings: trained in a shared text-image embedding space.
Their final, largest model has 30 billion parameters.