Scaling Laws for Diffusion Transformers

## Abstract

Abstract Diffusion transformers (DiT) have already achieved appealing synthesis and scaling properties in content recreation, e.g., image and video generation.
However, scaling laws of DiT are less explored, which usually offer precise predictions regarding optimal model size and data requirements given a specific compute budget.
Therefore, experiments across a broad range of compute budgets, from 1e17 to 6e18 FLOPs are conducted to confirm the existence of scaling laws in DiT for the first time . Concretely, the loss of pretraining DiT also follows a power-law relationship with the involved compute.
Based on the scaling law, we can not only determine the optimal model size and required data but also accurately predict the text-to-image generation loss given a model with 1B parameters and a compute budget of 1e21 FLOPs.
Additionally, we also demonstrate that the trend of pretraining loss matches the generation performances ( e.g., FID), even across various datasets, which complements the mapping from compute to synthesis quality and thus provides a predictable benchmark that assesses model performance and data quality at a reduced cost.

## 1 Introduction

Scaling laws in large language models (LLMs) (Kaplan et al., ; Hestness et al., ; Henighan et al., ; Hoffmann et al., ) have been widely observed and validated, suggesting that pretraining performance follows a power-law relationship with the compute $C$. The actual compute could be roughly calculated as $C=6ND$, where $N$ is the model size and $D$ is the data quantity.
Therefore, determining the scaling law helps us make informed decisions about resource allocation to maximize computational efficiency, namely, figure out the optimal balance between model size and training data (*i.e.,* the optimal model and data scale) given a fixed compute budget.
However, scaling laws in diffusion models remain less explored.

The scalability has already been demonstrated in diffusion models, especially for diffusion transformers (DiT). Specifically, several prior works (Mei et al., ; Li et al., ) reveal that larger models always result in better visual quality and improved text-image alignment.
However, the scaling property of diffusion transformers is *clearly observed but not accurately predicted*.
Besides, the absence of explicit scaling laws also hinders a comprehensive understanding of how training budget relate to model size, data quantity, and loss.
As a result, we cannot determine accordingly the optimal model and data sizes for a given compute budget and accurately predict training loss.
Instead, heuristic configuration searches of models and data are required, which are costly and challenging to ensure optimal balance.

In this work, we characterize the scaling behavior of diffusion models for text-to-image synthesis, resulting in the explicit scaling laws of DiT *for the first time*.
To investigate the explicit relationship between pretraining loss and compute, a wide range of compute budgets from 1e17 to 6e18 FLOPs are used. Models ranging from 1M to 1B are pretrained under given compute budgets.
As shown in Fig. 1, for each compute budget, we can fit a parabola and extract an optimal point that corresponds to the optimal model size and consumed data under that specific compute constraint.
Using these optimal configurations, we derive scaling laws by fitting a power-law relationship between compute budgets, model size, consumed data, and training loss.
To evaluate the derived scaling laws, we extrapolate the compute budget to 1.5e21 FLOPs that results in the compute-optimal model size (approximately 1B parameters) and the corresponding data size.
Therefore, a 1B-parameter model is trained under this budget and the final loss matches our prediction, demonstrating the effectiveness and accuracy of our scaling laws.

To make the best use of the scaling laws, we demonstrate that the generation performances (*e.g.,* FID (Fréchet Inception Distance)) also match the trend of pretraining loss. Namely, the synthesis quality also follows the power-law relationship with the compute budget, making it predictable.
More importantly, this observation is transferable across various datasets. We conduct additional experiments on the COCO validation set (Lin et al., ), and the same scaling patterns hold, even when tested on out-of-domain data.
Accordingly, scaling laws could serve as a predictable benchmark where we can assess the quality of both models and datasets at a significantly reduced computational cost, enabling efficient evaluation and optimization of the model training process.

Figure: Figure 1: IsoFLOP and Model/Data Scaling Curves. For each training budget, we train multiple models of varying sizes. A parabola is fitted to the loss for each training budget, and the minimum point on each parabola (represented by the purple dots) corresponds to the optimal allocation of model size and data for that specific budget. By identifying the model and data sizes at these optimal points, we can plot the scaling trends of model parameters, tokens, and training budgets. The power-law curves shown allow us to predict the optimal configurations for larger compute budgets, such as 1.5e21 FLOPs.
Refer to caption: x1.png

To summarize,
we at first confirm the presence of scaling laws in diffusion transformers during training, revealing a clear power-law relationship between compute budget and training losses. Next, we establish a connection between pretraining loss and synthesis evaluation metrics.
Finally, We conducted preliminary experiments that demonstrate the potential of using scaling laws to evaluate both data and model performance. By conducting scaling experiments at a relatively low cost, we can assess and validate the effectiveness of different configurations based on the fitted power-law coefficients.

## 2 Related Work

#### Diffusion Transformers

Transformers have become the de facto model architecture in language modeling (Radford, ; Radford et al., ; Devlin, ), and they have also achieved significant success in computer vision tasks (Dosovitskiy et al., ; He et al., ). Recently, Transformers have been introduced into diffusion models (Peebles & Xie, ), where images are divided into patches (tokens), and the diffusion process is learned on these tokens. Additional conditions, such as timestep and text, are incorporated into the network via cross-attention (Chen et al., ), Adaptive Normalization (Perez et al., ), or by concatenating them with image tokens (Bao et al., ).
Zheng et al. () proposed masked transformers to reduce training costs, while Lu et al. () introduced techniques for unrestricted resolution generation. Diffusion Transformers (DiTs) inherit the scalability, efficiency, and high capacity of Transformer architectures, positioning them as a promising backbone for diffusion models. Motivated by this scalability, we investigate the scaling laws governing these models in this work. To ensure robust and clear conclusions, we adopt a vanilla Transformer design (Vaswani, ),
using a concatenation of image, text, and time tokens as input to the models.

#### Scaling Laws

Scaling laws (Hestness et al., ) have been fundamental in understanding the performance of neural networks as they scale in size and data. This concept has been validated across several large pretraining models (Dubey et al., ; Bi et al., ; Achiam et al., ). Kaplan et al. (); Henighan et al. () were the first to formalize scaling laws in language models and extend them to autoregressive generative models, demonstrating that model performance scales predictably with increases in model size and dataset quantity. Hoffmann et al. () further highlighted the importance of balancing model size and dataset size to achieve optimal performance. In the context of diffusion models, prior works (Mei et al., ; Li et al., ) have empirically demonstrated their scaling properties, showing that larger compute budgets generally result in better models. These studies also compared the scaling behavior of various model architectures and explored sampling efficiency. However, no previous works provide an explicit formulation of scaling laws for diffusion transformers to capture the relationship between compute budget, model size, data, and loss. In this paper, we aim to address this gap by systematically investigating the scaling behavior of diffusion transformers (DiTs), offering a more comprehensive understanding of their scaling properties.

## 3 method

### 3.1 Basic Settings

Unless otherwise stated, all experiments in this paper adhere to the same basic settings. While the training techniques and strategies employed may not be optimal, they primarily affect the scaling coefficients rather than the scaling trends. In this section, we outline the critical settings used in our experiments. Additional details are provided in Appendix C.

#### Diffusion Formulation

All experiments are conducted using the Rectified Flow (RF) formulation (Liu et al., ; Lipman et al., ; Albergo et al., ) with $\mathbf{v}$-prediction. For timestep sampling, we adopt the Logit-Normal (LN) Sampling scheduler $\pi_{ln}(t;m,s)$, as proposed in Esser et al. (). A detailed ablation study of this choice can be found in Appendix F.1.

#### Models & Dataset

As noted in Kaplan et al. (), the model design does not significantly impact scaling trends unless the architecture is extremely shallow or slim. We employ a vanilla transformer architecture (Vaswani, ) with minimal modifications. The text, image, and timestep tokens are concatenated as input (in-context conditioning (Peebles & Xie, )). A dataset of 108 million image-text pairs is randomly sampled from Laion-Aesthetic (Schuhmann et al., ). This subset is then re-captioned using LLAVA 1.5 (Liu et al., ). A validation set consisting of 1 million pairs is created from this subset. Further details can be found in Appendix C.1 and C.2.

Figure: Figure 2: Scaling Curves for Different Metrics. We present the scaling curves for training and validation loss, offset VLB, and offset likelihood. Validation metrics are evaluated on the COCO 2014 validation set. The metrics display consistent trends and similar shapes, all adhering to a power-law relationship. This demonstrates that each of these metrics can be used to observe scaling laws effectively. For simplicity, we primarily focus on training loss in subsequent analyses.
Refer to caption: x2.png

#### Scaling Metrics

A natural question arises when investigating scaling laws during training: What metrics should be selected to observe scaling behavior? In the context of Large Language Models (LLMs), the standard approach is autoregressive training (Radford, ; Radford et al., ), where the model is trained to predict the next token in a sequence, directly optimizing the likelihood of the training data. This has proven to be a reliable method for measuring model performance as the compute budget scales up. Inspired by this approach, we extend the concept of scaling laws to diffusion models, using loss and likelihood as our key metrics.

Loss is the primary metric chosen to observe scaling behavior during training. Unlike autoregressive models, diffusion models do not directly optimize likelihood. Instead, the objective is to match a time-conditioned velocity field (Ma et al., ; Liu et al., ; Lipman et al., ; Albergo et al., ). Specifically, the velocity $\mathbf{v}(x_{t},t)$ at timestep $t$ is defined as:

$$ $\displaystyle\mathbf{v}(x_{t},t)=x_{t}^{\prime}=\alpha_{t}^{\prime}x_{0}+\beta _{t}^{\prime}\epsilon,$ (1) $$

where $x_{0}$ represents the original data and $\epsilon$ denotes the noise. Here, the prime symbol ^′ indicates the derivative with respect to time $t$. In the rectified flow framework, the coefficients $\alpha_{t}$ and $\beta_{t}$ are defined as $\alpha_{t}=1-t,\beta_{t}=t$. Thus, the velocity $\mathbf{v}$ can be further simplified as:

$$ $\displaystyle\mathbf{v}(x_{t},t)=-x_{0}+\epsilon.$ (2) $$

The corresponding loss function is expressed in terms of the expected value:

$$ $\displaystyle\mathcal{L}(\theta,\mathbf{x},t)=\mathbb{E}_{t\sim[1,T],\epsilon \sim\mathcal{N}(0,\emph{I})}\left[\left\|\mathbf{v}_{\theta}(x_{t},t)+x_{0}- \epsilon\right\|^{2}\right]\approx\frac{1}{N}\sum_{i=1}^{N}\left[\left\| \mathbf{v}_{\theta}(x_{t},t)+x_{0}-\epsilon\right\|^{2}\right].$ (3) $$

The training loss is estimated using a Monte Carlo method, which involves timesteps and noise sampling. The stochasticity inherent in this process can cause significant fluctuations, which are mitigated by employing a larger batch size of 1024 and applying Exponential Moving Average (EMA) smoothing. In our experiments, we set $\alpha_{\text{EMA}}=0.9$, which is found to produce stable results. A detailed ablation study on the choice of EMA coefficients is provided in Appendix F.2. This smoothing procedure helps reduce variance and provides clearer insights into training dynamics.

In addition to the training loss, validation loss is also computed on the COCO 2014 dataset (Lin et al., ). To ensure consistency with the training loss, timesteps are sampled using the LN timestep sampler $\pi_{ln}(t;m,s)$, and evaluation is performed on 10,000 data points, with 1,000 timesteps sampled per point.

Likelihood is our secondary metric. The likelihood over the dataset distribution $P_{\mathcal{D}}$ given model parameters $\theta$ is represented as $\mathbb{E}_{x\sim P_{\mathcal{D}}}[p_{\theta}(x)]$, which can be challenging to compute directly. In this paper, we measure likelihood using two different methods. The first method is based on the Variational Autoencoder (VAE) framework (Kingma et al., ; Song et al., ; Vahdat et al., ), which approximates the lower bound of log-likelihood using the Variational Lower Bound (VLB). Since the VAE component in our experiments is fixed to Stable Diffusion 1.5, terms related to the VAE remain constant and are ignored in our computation, as they do not affect the scaling behavior. The second method uses Neural Ordinary Differential Equations (ODEs) (Chen et al., ; Grathwohl et al., ), enabling the computation of exact likelihood through reverse-time sampling.

#### Variational Lower Bound (VLB)

We estimate the VLB following the approach in Kingma et al. (), where it is treated as a reweighted version of the validation loss. The process starts by converting the estimated velocity into a corresponding estimate of $x_{0}$, after which the loss is computed based on the difference between the estimated $x_{0}$ and the original sample. To obtain the VLB, this loss is further reweighted with the weighting coefficient being the derivative of signal-to-noise ratio of noisy samples with respect to time $t$, *i.e.,* $\text{SNR}^{{}^{\prime}}(t)$. More details can be found in Appendix D. All models are evaluated on the COCO 2014 validation set using 10,000 data pairs. For each data point, 1,000 timesteps are sampled to ensure accurate estimations of the VLB.

#### Exact Likelihood

The exact likelihood is computed using reverse-time sampling, where a clean sample is transformed into Gaussian noise. The accumulated likelihood transition is calculated using the instantaneous change of variables theorem (Chen et al., ):

$$ $\log p_{\theta}(x)=\log p_{\theta}(x_{T})-\int_{0}^{T}\nabla\cdot f_{\theta}(x _{t},t)\,dt,$ $$

where $f_{\theta}(x_{t},t)$ represents the model’s output, and $\log p_{\theta}(x_{T})$ is the log density of the final Gaussian noise. The reverse process evolves $t$ from 0 (data points) to $T$ (noise). The reverse sampling is performed over 500 steps using the Euler method.

Following model training, we evaluate models on the validation set to assess their compute-optimal performance. As illustrated in Fig. 2, all four metrics (training loss, validation loss, offset VLB, and offset exact likelihood ) exhibit similar trends and shapes as the training budget increases, showing their utility in observing scaling laws. These consistent patterns suggest that any of these metrics can be effectively used to monitor scaling behavior. However, to simplify our experimental workflow, we prioritize training loss as the primary metric. Training loss can be observed directly during the training process, without the need for additional evaluation steps, making it a more practical choice for tracking scaling laws in real-time.

### 3.2 Scaling Laws in Training Diffusion Transformers

#### Scaling Laws

In this section, we investigate the scaling laws governing diffusion transformers, which describe the relationships between several key quantities: the objective function, model parameters, tokens, and compute. The objective measures discrepancy between the data and model’s predictions. The number of parameters $N$ reflects model’s capacity, while tokens $D$ denote the total amount of data (in tokens) processed during training. Compute $C$, typically measured in Floating Point Operations (FLOPs), quantifies the total computational resources consumed. In our experiments, the relationship between compute, tokens, and model size is formalized as $C=6ND$, directly linking the number of parameters and tokens to the overall compute budget.

Building on this, we hypothesize that power law equations can effectively capture the scaling relationships between these quantities. Specifically, we represent the optimal model size and token count as functions of the compute budget as follows:

$$ $\displaystyle N_{\text{opt}}\propto C^{a}\quad\text{and}\quad D_{\text{opt}} \propto C^{b},$ (4) $$

where $N_{\text{opt}}$ and $D_{\text{opt}}$ denote the optimal number of parameters and tokens for a given compute budget $C$, with $a$ and $b$ as scaling exponents that describe how these quantities grow with compute.

Figure: Figure 3: Performance Scaling Curves. The plot shows the relationship between training loss, FID, and compute budget, with both axes displayed on a logarithmic scale. The orange lines represent the fitted power-law curves for both metrics across various budgets, while the purple dots mark the performance of compute-optimal models at smaller budgets. In both cases, the blue pentagons indicate the predicted performance at a budget of 1.5e21 FLOPs, demonstrating highly accurate predictions for large-scale models.
Refer to caption: x3.png

To empirically verify these scaling relationships, following Approach 2 in Hoffmann et al. (), we plot the isoFLOP figure to explore scaling laws. We select compute budgets [1e17, 3e17, 6e17, 1e18, 3e18, 6e18]. We change the In-context Transformers from 2 layers to 15 layers. For all experiments, we use AdamW (Kingma, ; Loshchilov, ) as the default optimizer. Except for the 1B parameter prediction experiments, we apply a constant learning rate of 1e-4. In the 1B parameter experiments, we train the model with a learning rate of 1e-4 for 80% of the total iterations, then decay it to 3.16e-5 for the next 10%, and finally to 1e-5 for the last 10%. This learning rate decay is crucial for larger models, leading to more accurate predictions. Following Wortsman et al. (); Team (); Molybog et al. (), we use a weight decay of 0.01, an epsilon value of 1e-15, and betas [0.9, 0.95]. For all experiments, we employ a batch size of 1024 and apply gradient clipping with a threshold of 1.0. To enable classifier-free guidance (Ho & Salimans, ), we randomly drop the label with a probability of 0.1. During training, we use mixed precision with the BF16 data format.

For each budget, we fit a parabola to the resulting performance curve, as illustrated in Fig. 1, to identify the optimal loss, model size, and data allocation (highlighted by the purple dots). By collecting the optimal values from different budgets and fitting them to a power law, we establish relationships between the optimal loss, model size, data, and compute budgets.

As shown in Fig. 1, except for the 1e17 budget, the parabolic fits align closely with the empirical results. This analysis confirms that the optimal number of parameters and tokens scale with the compute budget according to the following expressions:

$$ $\displaystyle N_{\text{opt}}$ $\displaystyle=0.0009\cdot C^{0.5681},$ (5) $\displaystyle D_{\text{opt}}$ $\displaystyle=186.8535\cdot C^{0.4319}.$ (6) $$

In this way, we establish the relationship between compute budget and model/data size. And from the fitted scaling curves, we observe that the ratio between the scaling exponent for data and the scaling exponent for model size is $0.4319/0.5681$. This indicates that, under our specific settings, both the model and data sizes need to increase in tandem as the training budget increases. However, the model size grows at a slightly faster rate compared to the data size, as reflected by the proportional relationship between the two exponents.

Additionally, in Fig. 3, we fit the relationship between the compute budget and loss, which follows the equation:

$$ $\displaystyle L=2.3943\cdot C^{-0.0273}.$ (7) $$

To validate the accuracy of these fitted curves, we calculate the optimal model size (958.3M parameters) and token count for a compute budget of 1.5e21. A model is then trained with these specifications to compare its training loss with the predicted value. As demonstrated in Fig. 3, this model’s training loss closely matches the predicted loss, further confirming the validity of our scaling laws.

### 3.3 Predicting Generation Performance

In generative tasks, relying solely on training loss to evaluate performance often falls short of capturing the perceptual quality of generated images. Training loss does not fully reflect how closely the generated images resemble real ones or how well they align with textual prompts in terms of content and style. To address this limitation, the Fréchet Inception Distance (FID) is commonly used to evaluate image quality.

#### Fréchet Inception Distance (FID)

FID measures the distance between the distributions of generated and real images in a feature space, with lower FID values indicating higher image quality. For our experiments, we utilize compute-optimal models at each training budget, generating samples using the Euler discretization method with 25 steps and a classifier-free guidance (CFG) scale of 10.0. Details on the impact of steps and CFG scale are provided in Appendix F.3. To compute FID, we follow the approach of Sauer et al. (), using CLIP features instead of traditional Inception features. Specifically, we employ ViT-L/14 Dosovitskiy et al. () as the vision encoder to extract features from both generated and dataset images and compare their statistics.

#### Scaling laws for Performance Predictions

Our analysis reveals that the relationship between FID and the training budget follows a clear power-law trend, as shown in Fig. 3 (left). The relationship is captured by the following equation:

$$ $\displaystyle\texttt{FID}=2.2566\times 10^{6}\cdot C^{-0.234},$ (8) $$

where $C$ is the training budget. The purple dots in the figure represent the FID scores of compute-optimal models at various budgets, and the orange line represents the fitted power-law curve. Notably, the prediction for FID at a large budget of 1.5e21 FLOPs (blue pentagon) is highly accurate, confirming the reliability of scaling laws in forecasting model performance even at larger scales. As the compute budget increases, FID values decrease consistently, demonstrating that scaling laws can effectively model and predict the quality of generated images as resources grow.

Figure: Figure 4: Scaling laws for OOD data. The evaluation of loss, VLB, and NLL are conducted on an out-of-domain dataset COCO 2014 validation set. All metrics decrease monotonically as the budget increases and they share a similar shape. However, a notable shift can be observed. Models have worse performance on the COCO validation set since they are trained on a different data distribution. The shift reflects the differences between datasets.
Refer to caption: x4.png

### 3.4 Scaling Laws for Out-Of-Domain Data

Scaling laws remain valid even when models are tested on out-of-domain datasets. To demonstrate this, we conduct validation experiments on the COCO 2014 validation set (Lin et al., ), using models that were trained on the Laion5B subset. In these experiments, we evaluate four key metrics: validation loss, Variational Lower Bound (VLB), exact likelihood, and Fréchet Inception Distance (FID). Each metric is tested on 10,000 data points to examine the transferability of the scaling laws across datasets.

The results, as shown in Fig. 4, reveal two key observations:

- •
Consistent Trends: Across all four metrics (validation loss, VLB, exact likelihood, and FID), the trends are consistent between the Laion5B subset and the COCO validation dataset. As the training budget increases, model performance improves in both cases, indicating that scaling laws generalize effectively across datasets, regardless of domain differences.
- •
Vertical Offset: There is a clear vertical offset between the metrics for the Laion5B subset and the COCO validation dataset, with consistently higher metric values observed on the COCO dataset. This suggests that while scaling laws hold, the absolute performance is influenced by dataset-specific characteristics, such as complexity or distribution. For metrics like validation loss, VLB, and exact likelihood, this offset remains relatively constant across different training budgets. The gap between the FID values for the Laion5B subset and the COCO validation set widens as the training budget increases. However, the relationship between FID and budget on the COCO validation set still follows a power-law trend. This suggests that, even on out-of-domain data, the FID-budget relationship can be reliably modeled using a power law, allowing us to predict the model’s FID for a given budget.

In summary, these results demonstrate that scaling laws are robust and can be applied effectively to out-of-domain datasets, maintaining consistent trends while accounting for dataset-specific performance differences. Despite the vertical offset in absolute performance, particularly in metrics like FID, the power-law relationships remain intact, allowing for reliable predictions of model performance under varying budgets. These findings highlight the potential of scaling laws as a versatile tool for understanding model behavior across datasets. The ability to project model efficiency and performance onto new data domains underscores the broader applicability of scaling laws in real-world scenarios.

## 4 Scaling laws as a predictable benchmark

Figure: Figure 5: Scaling curves for In-Context and Cross-Attention Transformers. The plot compares the scaling behavior of In-Context Transformers and Cross-Attention Transformers with respect to compute budget (FLOPs). In-context transformers, which concatenate image, text, and time tokens, show a more gradual decline in loss compared to Cross-Attention Transformers, which inject time and text tokens via AdaLN and cross-attention blocks. The steeper slope of Cross-Attention Transformers indicates more efficient performance improvement with increasing compute, meaning they achieve lower loss with the same budget. These results highlight the efficiency of Cross-Attention Transformers and illustrate the potential of scaling laws in predicting performance trends across different model architectures.
Refer to caption: x5.png

Scaling laws offer a robust framework for evaluating the design quality of both models and datasets. Previous work such as Dubey et al. (); Bi et al. () have all explored the scaling laws in data mix and quality. By modifying either the model architecture or the data pipeline, isoFLOP curves can be generated at smaller compute budgets to assess the impact of these changes. Specifically, after making adjustments to the model or dataset, experiments can be conducted across a range of smaller compute budgets, and the relationship between compute and metrics such as loss, parameter count, or token count can be fitted. The effectiveness of these modifications can then be evaluated by analyzing the exponents derived from the power-law fits.

Our evaluation follows three key principles:

- •
Model improvements: With a fixed dataset, a more efficient model will exhibit a lower model scaling exponent and a higher data scaling exponent. This suggests that the model can more effectively utilize the available data, allowing for a greater focus on increasing the dataset size with additional compute resources.
- •
Data improvements: When the model is fixed, a higher-quality dataset will result in a lower data scaling exponent and a higher model scaling exponent. This implies that a better dataset enables the model to scale more efficiently, yielding superior results with fewer resources.
- •
Loss improvements: Across both model and data modifications, an improved training pipeline is reflected in a smaller loss scaling exponent relative to compute. This indicates that the model achieves better performance with less compute, signaling overall gains in training efficiency.

The scaling trends for both models, In-Context Transformers and Cross-Attention Transformers, are clearly illustrated in Fig. 5. The loss scaling curves demonstrate that as the compute budget increases, the performance of both models improves, but at different rates. The Cross-Attention Transformer shows a steeper decline in loss compared to the In-Context Transformer, indicating that it achieves better performance with the same amount of compute.

The fitted scaling curves, as summarized in Tab. 1, support this observation. The Cross-Attention Transformer exhibits a larger model exponent, meaning that as compute budgets increase, more resources should be allocated toward scaling the dataset. Additionally, the smaller loss exponent of the Cross-Attention Transformer suggests a more rapid decline in loss, indicating that this model achieves superior performance compared to the In-Context Transformer. These findings align with the conclusions of Peebles & Xie ().

**Table 1: Exponents of model, data, and loss for different model architectures.**
| Model | Model Exponent | Data Exponent | Loss Exponent |
| --- | --- | --- | --- |
| In-context | 0.56 | 0.43 | -0.0273 |
| Cross-Attention | 0.54 | 0.46 | -0.0385 |

This example illustrates how scaling laws can serve as a reliable and predictable benchmark for evaluating the effectiveness of both model architectures and datasets. By analyzing the scaling exponents, we can draw meaningful conclusions about the potential and efficiency of different design choices in model and data pipelines.

## 5 Discussion

#### Limitations

While our work demonstrates the presence of scaling laws in Diffusion Transformers (DiT), several limitations must be acknowledged. First, we used fixed hyperparameters, such as learning rate and batch size, across all experiments. A more comprehensive investigation into how these parameters should be adjusted as budgets scale may lead to more precise predictions. Second, our study focuses solely on text-to-image generation, leaving the scalability of Diffusion Transformers with other data modalities, such as video, unexplored. Finally, we limited our analysis to In-Context Transformers and Cross-Attention Transformers, leaving the evaluation of additional model variants to future research.

#### Conclusion

In this work, we explored the scaling laws of Diffusion Transformers (DiT) across a broad range of compute budgets, from 1e17 to 6e18 FLOPs, and confirmed the existence of a power-law relationship between pretraining loss and compute. This relationship enables precise predictions of optimal model size, data requirements, and model performance, even for large-scale budgets such as 1e21 FLOPs. Furthermore, we demonstrated the robustness of these scaling laws across different datasets, illustrating their generalizability beyond specific data distributions. In terms of generation performance, we showed that training budgets can be used to predict the visual quality of generated images, as measured by metrics like FID. Additionally, by testing both In-context Transformers and Cross-Attention Transformers, we validated the potential of scaling laws to serve as a predictable benchmark for evaluating and optimizing both model and data design, providing valuable guidance for future developments in text-to-image generation using DiT.

## Appendix

This appendix is organized as follows:

- •
In Section A, we list an overview of the notation used in the paper.
- •
In Section B, we provide extended related work.
- •
In Section C, we provide experimental details.
- •
In Section D, we provide the derivation of the likelihood used in this paper.
- •
In Section E, we provide the details of scaling FLOPs counting based on our models.
- •
In Section F, we demonstrate ablative studies during the experiments.

## Appendix A Notation

Tab. 2 provides an overview of the notation used in this paper.

**Table 2: Summary of the notation and abbreviations used in this paper.**
| Symbol | Meaning |
| --- | --- |
| RF | Rectified Flow (Lipman et al., ; Liu et al., ; Albergo et al., ) |
| LN | Logit-Normal timestep sampler $\pi_{ln}(t;m,s)$ (Esser et al., ) |
| SNR | Signal-Noise-Ratio, $\lambda_{t}=\frac{\alpha_{t}^{2}}{\beta_{t}^{2}}$ |
| DDPM | Denoising Diffusion Probabilistic Models (Ho et al., ) |
| LDM | Latent Diffusion Models (Rombach et al., ) |
| VP | Variance Preserving formulation (Song et al., ) |
| VLB | Variational Lower Bound |
| VAE | Variational Autoencoder |
| KL | KL Divergence $KL(p(x)|q(x))=\mathbb{E}_{p(x)}[ln\frac{p(x)}{q(x)}]$ |
| $P_{\mathcal{D}}$ | Dataset distribution |
| $d_{attn}$ | Dimension of the attention output |
| $d_{ff}$ | Dimension of the Feedforward layer |
| $d_{model}$ | Dimension of the residual stream |
| $n_{layer}$ | Depth of the Transformer |
| $l_{ctx}$ | Context length of input tokens |
| $l_{img}$ | Context length of image tokens |
| $l_{text}$ | Context length of text tokens |
| $l_{time}$ | Context length of time tokens |
| $N_{voc}$ | Size of Vocabulary list |
| $n_{head}$ | Number of heads in Multi-Head Attention |
| $N$ | Number of parameters |
| $D$ | Size of training data (token number) |
| $C$ | Compute budget, $C=6ND$ |
| $N_{opt}$ | Optimal number of parameters for the given budget |
| $D_{opt}$ | Optimal training tokens for the given budget. |
| $\bm{\epsilon}$ | Gaussian Noise<br>$\mathcal{N}$ (0 0, *I*) |
| $\mathbf{x}_{t}$ | A sample created at timestep $t$ |
| t | Timestep ranging from [0, 1] |
| $\mathbf{v}$ | Velocity $\mathbf{v}=\mathbf{x}_{1}-\mathbf{x}_{0}$ |
| $\alpha_{t}$ | $\alpha_{t}$ represents the scaling factor during noise sample creation. |
| $\beta_{t}$ | $\beta_{t}$ represents the diffusion factor during noise sample creation. |
| $\sigma_{t}$ | Noise Level defined for each timestep |
| $f_{\bm{\theta}}(\mathbf{x})$ | The network we use to learn the transition kernel. $f_{\bm{\theta}}:\mathbb{R}^{N\times M}\xrightarrow{}\mathbb{R}^{N\times M}$ |
| $\eta$ | Learning rate |
| $\pi_{ln}(t;m,s)$ | Logit-Normal Timestep sampling schedule, |
|  | $m$ is the location parameter, $s$ is the scale parameter |
| $\mathcal{L}(\bm{\theta},\mathbf{x},t)$ | Loss given model parameters, data points, and timesteps. |
| $\lambda$ | Fixed step size for ODE/SDE samplers |
| $\bm{\theta}$ | Parameters for diffusion models |
| $\bm{\phi}$ | Parameters for VAE encoder |
| $\bm{\psi}$ | Parameters for VAE decoder |
| $\alpha_{\text{EMA}}$ | EMA coefficient |

## Appendix B Extended Related Work

#### Diffusion Models

Diffusion models have gained significant attention due to their effectiveness in generative modeling, starting from discrete-time models (Sohl-Dickstein et al., ; Ho et al., ; Song & Ermon, )
to more recent continuous-time extensions (Song et al., ). The core idea of diffusion models is to learn a sequence of noise-adding and denoising steps. In the forward process, noise is gradually added to the data, pushing it toward a Gaussian distribution, and in the reverse process, the model learns to iteratively denoise, recovering samples from the noise. Continuous-time variants (Song et al., ) further generalize this framework using stochastic differential equations (SDEs), allowing for smoother control over the diffusion process. These methods leverage neural network architectures to model the score function and offer flexibility and better convergence properties compared to discrete versions. Diffusion models have shown remarkable success in various applications. For instance, ADM (Dhariwal & Nichol, ) outperforms GAN on ImageNet. Following this success, diffusion models have been extended to more complex tasks such as text-to-image generation. Notably, models like Stable Diffusion (Rombach et al., ) and DALLE (Ramesh et al., ) have demonstrated the ability to generate highly realistic and creative images from textual descriptions, representing a significant leap in the capabilities of generative models across various domains.

#### Normalizing Flows

Normalizing flows has been a popular generative modeling approach due to their ability to compute exact likelihoods while providing flexible and invertible transformations. Early works like GLOW (Kingma & Dhariwal, ) and RealNVP (Dinh et al., ) introduced powerful architectures that allowed for efficient sampling and likelihood estimation. However, these models were limited by the necessity of designing specific bijective transformations, which constrained their expressiveness. To address these limitations, Neural ODE (Chen et al., ) and FFJORD (Grathwohl et al., ) extended normalizing flows to the continuous domain using differential equations. These continuous normalizing flows (CNFs) allowed for more flexible transformations by parameterizing them through neural networks and solving ODEs. By modeling the evolution of the probability density continuously, these methods achieved a higher level of expressiveness and adaptability compared to their discrete counterparts. Recent work has begun to bridge the gap between continuous normalizing flows and diffusion models. For instance, ScoreSDE (Song et al., ) demonstrated how the connection between diffusion models and neural ODEs can be leveraged, allowing both exact likelihood computation and flexible generative processes. More recent models like Flow Matching (Lipman et al., ) and Rectified Flow (Liu et al., ) further combined the strengths of diffusion and flow-based models, enabling efficient training via diffusion processes while maintaining the ability to compute exact likelihoods for generated samples. In this paper, we build upon the formulation introduced by rectified flow and Flow Matching. By leveraging the training approach of diffusion models, we benefit from their generative performance, while retaining the capability to compute likelihoods.

#### Likelihood Estimation

Likelihood estimation in diffusion models can be approached from two primary perspectives: treating diffusion models as variational autoencoders (VAEs) or as normalizing flows. From the VAE perspective, diffusion models can be interpreted as models where we aim to optimize a variational lower bound (VLB) on the data likelihood (Kingma, ). The variational lower bound decomposes the data likelihood into a reconstruction term and a regularization term, where the latter measures the divergence between the approximate posterior and the prior. In diffusion models, this framework allows us to approximate the true posterior using a series of gradually noised latent variables. Recent works (Ho et al., ; Kingma et al., ; Song et al., ) have derived tighter bounds for diffusion models, enabling more accurate likelihood estimation by optimizing this variational objective. Alternatively, diffusion models can be viewed as a form of normalizing flows, particularly in the context of continuous-time formulations. Using neural ODEs (Chen et al., ), diffusion models can be trained to learn exact likelihoods by modeling the continuous reverse process as an ODE. By solving this reverse-time differential equation, one can directly compute the change in log-likelihood through the flow of probability densities (Grathwohl et al., ). This approach provides a method for exact likelihood computation, bridging the gap between diffusion models and normalizing flows, and offering a more precise estimate of the likelihood for generative modeling.

## Appendix C Experimental Details

### C.1 Data

We primarily utilized three datasets in our work. Several ablation studies on formulation and model design were conducted using JourneyDB (Sun et al., ). Additionally, we curated a subset of 108 million image-text pairs from the Laion-Aesthetic dataset, applying a threshold of 5 for the aesthetic score. After collecting the data, we re-captioned all images using LLAVA 1.5 (Liu et al., ), specifically employing the LLaVA-Lightning-MPT-7B-preview model for this task. We then split the data into training and validation sets with a ratio of 100:1. Our third dataset is COCO (Lin et al., ), where we used the 2014 validation set to test scaling laws on an out-of-domain dataset.

### C.2 Model Design

In this paper, we evaluate two distinct model architectures. For the PixArt model, we follow the original design presented in Chen et al. (). The In-Context Transformers are based on the In-Context block described in Peebles & Xie (). To facilitate large-scale model training, we employ QK-Norm (Dehghani et al., ) and RMSNorm (Zhang & Sennrich, ). The patch size is set to 2. Although previous work (Kaplan et al., ) suggests that the aspect ratio (width/depth) of Transformers does not significantly impact scaling laws, it is crucial to maintain a consistent ratio when fitting models to scaling laws. To demonstrate this, we train a series of models under a fixed computational budget, selecting models of various sizes and aspect ratios (32 and 64). We then plot the relationship between the number of parameters and loss. As illustrated in Fig. 6, mixing models with aspect ratios of 64 and 32 obscures the overall trend. To address this issue, we maintain the aspect ratio at 64 throughout.

Figure: Figure 6: The effect of AR.
Refer to caption: x6.png

## Appendix D Derivation of the likelihood

In this section, we provide a derivation of the likelihood estimation in our paper. In this paper, we use two ways to compute the likelihood. The first method is estimating the VLB (variational lower bound). Following Kingma et al. (); Vahdat et al. (), we derive a VLB in latent space. However, we cannot compute the entropy terms in the VAE. So our surrogate metric differs from the true VLB up to a constant factor.

#### VAE

The latent diffusion model (Vahdat et al., ; Rombach et al., ) consists of two components: a variational autoencoder (VAE) that encodes images into a latent space and decodes latents back into images, and a continuous diffusion model that operates in the latent space. To train the latent diffusion model, we optimize the variational encoder $q_{\phi}$, the decoder $p_{\psi}$, and the diffusion model $p_{\theta}$. Following Ho et al. (), the models are trained by minimizing the variational upper bound on the negative log-likelihood $\log P(x)$:

$$ $\displaystyle\mathcal{L}_{\theta,\phi,\psi}(x)$ $\displaystyle=\mathbb{E}_{q_{\phi}(z_{0}|x)}[-\log p_{\psi}(x|z_{0})]+KL(q_{ \phi}(z_{0}|x)||p_{\theta}(z_{0}))$ $\displaystyle=\mathbb{E}_{q_{\phi}(z_{0}|x)}[-\log p_{\psi}(x|z_{0})]+\mathbb{ E}_{q_{\phi}(z_{0}|x)}[\log q_{\phi}(z_{0}|x)]+\mathbb{E}_{q_{\phi}(z_{0}|x)}[ -\log p_{\theta}(z_{0})].$ $$

In our implementation, we directly adopt the VAE from Stable Diffusion 1.5 and keep it fixed during training. As a result, the reconstruction term (first term) and the negative encoder entropy term (second term) remain constant across different models. In fact, the VAE in Stable Diffusion is trained following the VQGAN approach, which uses both $L1$ loss and an additional discriminator for training. Therefore, we cannot effectively estimate the reconstruction term since the decoder distribution is not tractable. To simplify further, we omit the VAE encoding process altogether. Specifically, we skip both encoding and decoding through the VAE and treat the latents produced by the VAE as the dataset samples. Under this assumption, we estimate the offset VLB directly in the latent space.

In the latent space, we model the distribution of latent variables that can be decoded into images using the VAE decoder. We denote the samples in latent space as $x$, and the noisy latent at timestep $t$ as $z_{t}$. The variational lower bound (VLB) in the latent space is given by Kingma et al. ():

$$ $\displaystyle-\log p(x)\leq-\text{VLB}(x)=D_{KL}(q(z_{1}|x)||p(z_{1}))+\mathbb {E}_{q(z_{0}|x)}[-\log p(x|z_{0})]+\mathcal{L}_{T}(x),$ $$

where the first two terms depend only on the noise schedule, and we treat these terms as irreducible losses since the noise schedule is fixed across all models. The third term is the KL divergence between each pair of the reverse process $p(z_{t}|z_{t+1})$ and the forward process $q(z_{t}|x,z_{t+1})$:

$$ $\displaystyle\mathcal{L}_{T}(x)=\sum_{i=1}^{T}\mathbb{E}_{q(z_{t(i)}|x)}[D_{KL }(q||p)].$ $$

Since we assume that the forward and reverse processes share the same variance and both $p$ and $q$ are Gaussian distributions, the KL terms reduce to weighted $L2$ distances:

$$ $\displaystyle\mathcal{L}_{T}(x)=\frac{1}{2}\mathbb{E}_{\epsilon\sim\mathcal{N} (0,\emph{I})}\left[\sum_{i=1}^{T}(SNR(s)-SNR(t))\|x-x_{\theta}(z_{t};t)\|_{2}^ {2}\right],$ $$

where $s=t-1$. In the limit as $T\to\infty$, the loss becomes:

$$ $\displaystyle\mathcal{L}_{T}(x)=-\frac{1}{2}\mathbb{E}_{\epsilon\sim\mathcal{N }(0,\emph{I})}\int_{0}^{1}SNR^{\prime}(t)\|x-x_{\theta}(z_{t};t)\|_{2}^{2}\,dt.$ $$

In our case, we utilize the velocity $\mathbf{v}$ to predict the clean sample $x$ and compute the VLB.

#### Normalizing Flows

Another method to compute the likelihood in our diffusion model is by viewing the diffusion process as a type of normalizing flow. Specifically, we leverage the theoretical results from Neural ODEs, which allow us to connect continuous normalizing flows with the evolution of probability density over time. In Neural ODEs, the transformation of data through the flow can be described by the following differential equation for the state variable $x_{t}$ as a function of time:

$$ $\frac{dx_{t}}{dt}=f_{\theta}(x_{t},t),$ $$

where $f_{\theta}(x_{t},t)$ represents the network that predicts the time-dependent vector field $\mathbf{v}$. To compute the change in log-probability of the transformed data, the log-likelihood of the input data under the flow is given by:

$$ $\frac{d\log p(x_{t})}{dt}=-\text{Tr}\left(\frac{\partial f(x_{t},t)}{\partial x _{t}}\right),$ $$

where Tr represents the trace of the Jacobian matrix of $f_{\theta}(x_{t},t)$. This equation describes how the log-density evolves as the data is pushed forward through the flow. To compute the likelihood, we integrate the following expression over the trajectory from the initial state $t_{0}$ to the terminal state $t_{1}$:

$$ $\log p(x_{t_{1}})=\log p(x_{t_{0}})-\int_{t_{0}}^{t_{1}}\text{Tr}\left(\frac{ \partial f_{\theta}(x_{t},t)}{\partial x_{t}}\right)dt.$ $$

Here, $\log p(x_{t_{0}})$ represents the log-likelihood of the initial state (often modeled as a Gaussian), and the integral accounts for the change in probability density over time as the data evolves through the ODE. In our formulation, the network predicts the velocity $\mathbf{v}_{\theta}(x_{t},t)=x_{t}^{{}^{\prime}}=\alpha^{{}^{\prime}}_{t}x_{0}
+\beta^{{}^{\prime}}_{t}\epsilon$, which corresponds to the derivative of $x_{t}$ with respect to time. Thus, we start with clean samples, estimate the velocity, perform an iterative reverse-time sampling, and convert the samples into Gaussian noise. We can then compute the prior likelihood of the noise easily and add it to the probability shift accumulated during reverse sampling. In our experiments, we set the steps of reverse sampling to 500 to obtain a rather accurate estimation.

## Appendix E Scaling FLOPs Counting

In this section, we provide a detailed explanation of our FLOPs scaling calculations. Several prior works have employed different methods for counting FLOPs. In Kaplan et al. (), the authors exclude embedding matrices, bias terms, and sub-leading terms. Moreover, under their framework, the model dimension $d_{model}$ is much larger than the context length $l_{ctx}$, allowing them to disregard context-dependent terms. Consequently, the FLOPs count $N$ for their model is given by:

$$ $\displaystyle M=12\times d_{model}\times n_{layer}\times(2d_{attn}+d_{ff}),$ (9) $$

where $d_{model}$ represents the model dimension, $n_{layer}$ denotes the depth of the model, $d_{attn}$ refers to the attention dimension, and $d_{ff}$ represents the feed-forward layer dimension.

In contrast, Hoffmann et al. () includes all training FLOPs, accounting for embedding matrices, attention mechanisms, dense blocks, logits, and context-dependent terms. Specifically, their FLOP computation includes:

- •
Embedding: $2\times l_{ctx}\times N_{voc}\times d_{model}$
- •
Attention:
–
QKV Mapping: $2\times 3\times l_{ctx}\times d_{model}\times d_{model}$
–
QK: $2\times l_{ctx}\times l_{ctx}\times d_{model}$
–
Softmax: $3\times n_{head}\times l_{ctx}\times l_{ctx}$
–
Mask: $2\times l_{ctx}\times l_{ctx}\times d_{model}$
–
Projection: $2\times l_{ctx}\times d_{model}\times d_{model}$
- •
Dense: $2\times l_{ctx}\times(d_{model}\times d_{ff}\times 2)$
- •
Logits: $2\times l_{ctx}\times d_{model}\times N_{voc}$

Further details can be found in the Appendix F of Hoffmann et al. ().

In Bi et al. (), the authors omit the embedding computation but retain the context-dependent terms, which aligns with our approach. The parameter scaling calculation for vanilla Transformers in this paper follows the same format as theirs. We now present detailed scaling FLOPs calculations for the In-Context Transformers and Cross-Attn Transformers used in our experiments.

Attention blocks are the primary components responsible for scaling in Transformer architectures. In line with previous studies, we only consider the attention blocks, excluding embedding matrices and sub-leading terms. Unlike large language models (LLMs), our model dimension is comparable to the context length, and therefore, we include context-dependent terms. In this section, we present FLOPs per sample rather than parameters, as different tokens participate in different parts of the cross-attention computation. Additionally, since our input length is fixed, the FLOPs per sample are straightforward to compute.

#### In-Context Transformers

In-Context Transformers process a joint embedding consisting of text, image, and time tokens, all of which undergo attention computation. Tab. 3 details the FLOPs calculations for a single attention layer.

**Table 3: Scaling FLOPs Calculation in In-Context Transformers**
| Operation | FLOPs per Sample |
| --- | --- |
| Self-Attn: QKV Projection | $3\times 2\times n_{layer}\times l_{ctx}\times d_{model}\times 3\times d_{attn}$ |
| Self-Attn: QK | $3\times 2\times n_{layer}\times l_{ctx}\times l_{ctx}\times d_{attn}$ |
| Self-Attn: Mask | $3\times 2\times n_{layer}\times l_{ctx}\times l_{ctx}\times d_{attn}$ |
| Self-Attn: Projection | $3\times 2\times n_{layer}\times l_{ctx}\times d_{model}\times d_{attn}$ |
| Self-Attn: FFN | $3\times 2\times 2\times n_{layer}\times l_{ctx}\times 4\times d_{model}^{2}$ |

In our experiments, we set $d_{model}=d_{attn}$, and $l_{ctx}=377$, where $l_{ctx}=l_{img}(256)+l_{text}(120)+l_{time}(1)$. Thus, the simplified FLOPs-per-sample scaling equation $M$ is:

$$ $\displaystyle M=72\times l_{ctx}\times n_{layer}\times d^{2}_{model}+12\times n _{layer}\times l_{ctx}^{2}\times d_{model}$ (10) $$

#### Cross-Attn Transformers

In Cross-Attn Transformers, each attention block consists of self-attention and cross-attention mechanisms to integrate text information. The cross-attention uses image embeddings as the query and text embeddings as the key and value. The attention mask reflects the cross-modal similarity between image patches and text segments. As a result, the FLOPs calculation differs from that of models using joint text-image embeddings. Tab. 4 lists the FLOPs costs for each operation.

**Table 4: Scaling FLOPs Calculation in Cross-Attn Transformers**
| Operation | FLOPs per Sample |
| --- | --- |
| Self-Attn: QKV Projection | $3\times 2\times n_{layer}\times l_{img}\times d_{model}\times 3\times d_{attn}$ |
| Self-Attn: QK | $3\times 2\times n_{layer}\times l_{img}\times l_{img}\times d_{attn}$ |
| Self-Attn: Mask | $3\times 2\times n_{layer}\times l_{img}\times l_{img}\times d_{attn}$ |
| Self-Attn: Projection | $3\times 2\times n_{layer}\times l_{img}\times d_{model}\times d_{attn}$ |
| Cross-Attn QKV | $3\times 2\times n_{layer}\times(l_{img}+2\times l_{text})\times d_{model}<br>\times d_{attn}$ |
| Cross-Attn QK | $3\times 2\times n_{layer}\times l_{text}\times l_{img}\times d_{attn}$ |
| Cross-Attn Mask | $3\times 2\times n_{layer}\times l_{text}\times l_{img}\times d_{attn}$ |
| Cross-Attn Projection | $3\times 2\times n_{layer}\times l_{img}\times d_{model}\times d_{attn}$ |
| FFN | $3\times 2\times 2\times n_{layer}\times l_{img}\times 4\times d_{model}^{2}$ |

Based on the experimental settings, we can simplify the FLOPs calculation as follows:

$$ $\displaystyle M=84\times n_{layer}\times l_{img}\times d_{model}^{2}+12\times n _{layer}\times l_{img}^{2}\times d_{attn}$ $\displaystyle+12\times n_{layer}\times l_{text}\times d_{model}^{2}+12\times n _{layer}\times l_{text}\times l_{img}\times d_{model}$ (11) $$

#### Context-Dependent Terms

From the equations above, it is evident that some context-dependent terms, such as $12\times n_{layer}\times l_{ctx}^{2}\times d_{model}$, cannot be omitted. In our experiments, the aspect ratio of Transformers (width/depth=64) is maintained across all model sizes. The context length $l_{ctx}$ is 377 (image: 256, text: 120, time: 1), and $d_{model}=n_{layer}\times 64$. Since $l_{ctx}$ and $d_{model}$ are comparable, the context-dependent terms must be retained.

## Appendix F Ablations

### F.1 Diffusion Formulation

In diffusion models, various formulations for noise schedules, timestep schedules, and prediction objectives have been proposed. These three components are interdependent and require specific tuning to achieve optimal performance. In this paper, we explore several common formulations and conduct ablation studies to identify the best combination in our setting.

Below, we list the candidate formulations used in our ablation study.

#### Noise Schedule

#### Discrete Diffusion Models

#### DDPM

Denoising Diffusion Probabilistic Models (DDPM) (Ho et al., ) is a discrete-time diffusion model that generates noisy samples via the following formula:

$$ $x_{t}=\alpha_{t}x_{0}+\beta_{t}\epsilon$ $$

where $\epsilon$ is Gaussian noise, and $\alpha_{t}$ and $\beta_{t}$ satisfy $\alpha_{t}^{2}+\beta_{t}^{2}=1$. Given a sequence of $\sigma_{t}$, the scaling factor can be defined as:

$$ $\displaystyle\alpha_{t}=\sqrt{\prod_{s=0}^{t}(1-\sigma_{t})}$ (12) $$

In DDPM, $\sigma_{t}$ follows:

$$ $\displaystyle\sigma_{t}=\sigma_{0}+\frac{t}{T}(\sigma_{T}-\sigma_{0})$ (13) $$

#### LDM

Latent Diffusion Models (LDM) (Rombach et al., ), as used in Stable Diffusion, is a variant of the DDPM schedule. It is also a variance-preserving formulation, sharing the same structure as DDPM but employing a different noise schedule:

$$ $\sigma_{t}=\left(\sqrt{\sigma_{0}}+\frac{t}{T}\left(\sqrt{\sigma_{T}}-\sqrt{ \sigma_{0}}\right)\right)^{2}$ $$

#### Continuous Diffusion Models

#### VP

Variance Preserving (VP) diffusion (Song et al., ) is the continuous counterpart of DDPM, where the noise is added while preserving variance across timesteps. The sampling process is given by:

$$ $x_{t}=e^{-\frac{1}{2}\int_{0}^{t}\sigma_{s}ds}x_{0}+\sqrt{1-e^{-\int_{0}^{t} \sigma_{s}ds}}\epsilon$ $$

where $t\in[0,1]$.

#### Rectified Flow

Rectified Flow (RF) (Liu et al., ; Lipman et al., ; Albergo et al., ) is another continuous-time formulation, where a straight-line interpolation is defined between the initial sample $x_{0}$ and the Gaussian noise $\epsilon$. The process is described by:

$$ $x_{t}=(1-t)x_{0}+t\epsilon$ $$

#### Prediction Type

#### Noise Prediction ( ϵ bold-italic-ϵ \bm{\epsilon} bold_italic_ϵ )

The network predicts the Gaussian noise $\epsilon\sim\mathcal{N}(0,I)$ added to the samples during the diffusion process.

#### Velocity Prediction ( 𝐯 𝐯 \mathbf{v} bold_v )

In this formulation, the network predicts the velocity $\mathbf{v}(x_{t},t)$, which is defined as the derivative of the noisy sample $x_{t}$ with respect to time. If the noisy sample $x_{t}$ is defined by:

$$ $x_{t}=\alpha_{t}x_{0}+\beta_{t}\epsilon$ $$

the velocity is given by:

$$ $\mathbf{v}(x_{t},t)=x_{t}^{\prime}=\alpha_{t}^{\prime}x_{0}+\beta_{t}^{\prime}\epsilon$ $$

where $\alpha_{t}^{\prime}$ and $\beta_{t}^{\prime}$ are the derivatives of $\alpha_{t}$ and $\beta_{t}$ with respect to timestep $t$.

#### Score Prediction ( 𝐬 𝐬 \mathbf{s} bold_s )

The network predicts the score function $\mathbf{s}(x,t)=\nabla\log P(x,t)$, which is the gradient of the log-probability density function. The score can be derived as:

$$ $\mathbf{s}(x,t)=-\frac{\epsilon}{\beta_{t}}$ $$

#### Timestep Sampling Schedule

#### Uniform Timestep Schedule

In this schedule, the timestep $t$ is uniformly sampled. For discrete-time diffusion models:

$$ $t\sim\mathcal{U}(0,1,2,\ldots,999)$ $$

For continuous-time diffusion models:

$$ $t\sim\mathcal{U}(0,1)$ $$

#### Logit-Normal (LN) Timestep Schedule

The Logit-Normal (LN) timestep schedule $\pi_{ln}(t;m,s)$, proposed in Esser et al. (), generates timesteps according to the following distribution:

$$ $\pi_{ln}(t;m,s)=\frac{1}{s\sqrt{2\pi}}\cdot\frac{1}{t(1-t)}\exp\left(-\frac{( logit(t)-m)^{2}}{2s^{2}}\right),$ $$

where $logit(t)=\log\left(\frac{t}{1-t}\right)$. The LN schedule has two parameters: $m$ and $s$. It defines an unimodal distribution, where $m$ controls the center of the distribution in logit space, shifting the emphasis of training samples towards noisier or cleaner regions. The parameter $s$ adjusts the spread of the distribution, determining its width. As suggested in Esser et al. (), to obtain a timestep, we first sample $u\sim\mathcal{N}(m,s)$, and then transform it using the logistic function. For discrete-time diffusion, after obtaining $t\sim\pi_{ln}(t;m,s)$, we scale $t$ by $t=\text{round}(t\times 999)$ to obtain a discrete timestep. Following Esser et al. (), we utilized the parameters $m=0.0,s=1.00$ and didn’t sweep over $m$ and $s$. More details and visualizations can be found in Esser et al. () Appendix B.4.

We conducted a series of experiments using different combinations of formulations. Selective combinations are listed in Tab. 5. A ’$\mathbf{-}$’ indicates that the combination is either not comparable with other formulations or that training diverges. We assume that the choice of formulation will not be significantly affected by specific model designs or datasets. All experiments were conducted using Pixart (Chen et al., ), a popular text-to-image diffusion transformer architecture. Specifically, we used a small model with 12 layers and a hidden size of 384, setting the patch size to 2. The models were trained on JourneyDB (Sun et al., ), a medium-sized text-to-image dataset consisting of synthetic images collected from Midjourney. All models were trained for 400k steps using AdamW as the optimizer. As shown in Tab. 5, the optimal combination is [RF, LN, $\mathbf{v}$], achieving an FID of 36.336 and a Clip Score of 0.26684. This combination achieved the best performance on both metrics and therefore, we used this setting in the remaining experiments.

**Table 5: Ablation on diffusion formulations.**
| Noise Schedule | Timestep Schedule | Prediction Type | FID | CLIP Score |
| --- | --- | --- | --- | --- |
| DDPM | Uniform | $\bm{\epsilon}$ | 40.469 | 0.26123 |
| DDPM | Uniform | $\mathbf{v}$ | 74.049 | 0.23136 |
| DDPM | LN | $\bm{\epsilon}$ | 40.100 | 0.26283 |
| LDM | Uniform | $\bm{\epsilon}$ | 39.001 | 0.26423 |
| LDM | Uniform | $\mathbf{v}$ | $\mathbf{-}$ | $\mathbf{-}$ |
| LDM | LN | $\bm{\epsilon}$ | 38.196 | 0.26624 |
| VP | Uniform | $\bm{\epsilon}$ | 44.343 | 0.26148 |
| VP | Uniform | $\mathbf{v}$ | 41.808 | 0.26320 |
| VP | Uniform | $\mathbf{s}$ | 45.808 | 0.25970 |
| VP | LN | $\bm{\epsilon}$ | 42.872 | 0.26354 |
| VP | LN | $\mathbf{v}$ | 44.107 | 0.26380 |
| RF | Uniform | $\mathbf{v}$ | 44.840 | 0.25682 |
| RF | Uniform | $\mathbf{s}$ | $\mathbf{-}$ | $\mathbf{-}$ |
| RF | Uniform | $\bm{\epsilon}$ | $\mathbf{-}$ | $\mathbf{-}$ |
| RF | LN | $\mathbf{v}$ | 36.336 | 0.26684 |

### F.2 EMA

The Exponential Moving Average (EMA) coefficient is crucial to the loss curve and determining the final results. In EMA, the loss $l$ is updated as $l=(1-\alpha_{\text{EMA}})l+\alpha_{\text{EMA}}v$, where $v$ represents the latest loss value. EMA smooths the cumulative loss and reduces fluctuations. However, applying EMA can lead to an overestimation of the loss during the early stages of training. As illustrated in Fig. 7, a larger EMA coefficient results in a higher loss compared to the actual value, which may introduce significant bias in scaling curve fitting and, consequently, lead to inefficient use of computational resources. From Fig. 7, we observe that $\alpha_{\text{EMA}}=0.9$ is the optimal choice, as it effectively smooths the loss curve while only slightly inflating the values during the initial phase of training.

Figure: Figure 7: The effect of EMA.
Refer to caption: x7.png

### F.3 Classifier-Free Guidance & Sampling Steps

Figure: Figure 8: Ablation on sampling steps
Refer to caption: x8.png

Figure: Figure 9: Ablation on cfg scale
Refer to caption: x9.png

We perform ablation studies on CFG scales and the number of steps using the compute-optimal models trained with a budget of 6e18. In Fig. 8, we evaluate several CFG scales (2.5, 5.0, 7.5, 10.0) and compute FID across different step counts. We found that 25 steps are sufficient to achieve good results. Next, we fix the number of steps at 25 and evaluate performance across different CFG scales. As shown in Fig. 9, a CFG of 10.0 yields the best results, and we select this configuration as the default.

## Peer Reviews

confidence: 5
contribution: 3
initial_rating: 5
presentation: 2
questions: Please also check the concerns in Weaknesses.
1. As mentioned in W.1, why not use GPU hours and text-image pairs?
2. How can we use it in practice? Can we only estimate two points at small scale and predict the configuration at large scale? I have no confidence in it.
3. Can this conclusion be validated based on the present DiT works? They usually have the model versions with different parameters.
soundness: 3
strengths: 1. While some similar reports have been seen in LLMs, to my best knowledge this is the first analysis for text-to-image DiTs. The problem this paper aims to address is also a hot topic troubling the community. A good question is proposed in this paper.
2. If the conclusion is correct, then given the model size and training data, it is possible to predict in which training iteration the model will achieve the best performance. This would alleviate a lot of resource consumption in the heavy task of DiT training.
3. The experimental methods are well designed.
summary: This paper explore the scaling laws of DiT (for text-to-image generation). The authors experiment with different computation budget and find the optimal allocation (i.e., the lowest training loss) of model parameters and training data amount for each budget. Subsequently, they plot two relationship curves: 1) parameter-FLOPs and 2) token (seen in training)-FLOPs. The conclusion is the training loss follows a power-law relationship with the computation budget. Based on this, the author claim that they can predict the best configurations of model parameter and training data for a given (larger) budget.
weaknesses: 1. I don't know why the authors use FLOPs and token numbers as the indicators. This makes it difficult for me to intuitively estimate the computation budgets and data. In practice, GPU hours and image amount are more common and intuitive. 
2. I'm concerned about the power-law relationship shown in Fig 1 and 3, though the linear is so clear. How can we determine that this is not by coincidence (due to the structure of the model as well as the training data)? Even if this law is objectively universal, At what model size will it fail? For DiT, 1B is still a small scale. Can I really estimate 5B/10B if I only evaluate two points with small model sizes and get the regression line?
3. The training loss is not equal to FID, and more different from general performance. Of course the model does not perform well at large loss values, but it is agnostic at small values. In addition, when the budget is fixed, the number of iterations for the large model decreases. What happened if a larger learning rate is used in this case? The current setting does not seem fair.
4. The authors should improve the writing for easy understanding. For example, I can guess that the tokens in Fig. 1 refer to the number of tokens DiT has processed during the training, it still confuses me about the figure (even though the concept is explained in Sec 3.2)

---

confidence: 4
contribution: 2
initial_rating: 5
presentation: 3
questions: Are there any properties by scaling DiT across different dimensions (like channels, layers, etc)? The paper should explore how scaling DiT in various dimensions affects its properties and performance. This could provide valuable insights into the scaling behavior and help in designing more efficient models.
soundness: 2
strengths: 1. Good Presentation: The figures clearly present the properties of the scaling model and the associated FLOPs, making the analysis easy to follow and understand.

2. Predictable Benchmarking: The introduction of a predictable benchmark for assessing model performance and data quality significantly reduces costs and aids in optimizing computational resources.
summary: This research investigates the scaling characteristics of diffusion transformers, focusing on a range from ($1 \times 10^{17}$) to ($6 \times 10^{18}$) Flops. The study enhances the understanding of how computational effort maps to synthesis quality.
weaknesses: 1. The largest model in the study only has 1 billion parameters. While I agree with the authors' statement that "scaling laws help us make informed decisions about resource allocation to maximize computational efficiency," a model size of 1 billion parameters is too small to verify the significance of this scaling law. We need guidance for larger model sizes, especially considering that current models, such as the Flux model, already have 8 billion parameters.

2. The discussion of reference work is not accurate. Line 097 makes claims about the masked diffusion transformers but fails to mention the first Masked Diffusion Transformer (MDT), both versions v1 and v2.

---

confidence: 3
contribution: 2
initial_rating: 5
presentation: 3
questions: please refer to the weakness
soundness: 2
strengths: This is the first study of scaling laws in DiT based text-to-image generation models. It disclosed some relationships between training budget and model size/training data quantity under a specific setting. The results might be useful for the community when designing future DiT based text-to-image generation.
summary: This work studies the scaling laws of diffusion transformer for text-to-image generation. It tries to unveil the relationship between the training budget and the optimal model size/training data quantity. Under careful designed experimental settings, the disclosed scaling laws served as a predictor for the model size/performance under given a specific training budget.
weaknesses: Experiment results are somewhat limited. All experiments were done with a very small dataset and small models (<= 1B parameters). These settings are quite different from many DiT based text-to-image models in terms of data quantity and model size. Whether the conclusion will hold for different setting is unknown to us.

---

confidence: 4
contribution: 3
initial_rating: 6
presentation: 3
questions: 1. Some images in the paper only have one or two curves. Does this imply that it is already experimenting with the optimal model parameters calculated by the scaling law?
2. Why don't you use bigger models for base experiments? Common diffusion models, such as SD3 and FLUX, has 10B parameters or so. Only doing experiments with models less than 1B may is not general enough.
soundness: 2
strengths: 1. This work first proposes the scaling law of Diffusion Transformer in text-to-image generation. And it gets several formulated equations between loss, parameters and compute, which is confirmed by an additional experiment.
2.  It shows that different metrics (loss, VLB, likelihood) has similar trends with regard to compute budget. And the performance of generation measured by FID does, too.
3.  It indicates the application of the scaling law: serving as a benchmark for measuring the effectiveness of model architectures.
summary: This work tries to reveal the scaling law of Diffusion Transformer in the field of text-to-image generation. It is based on in-context dit and rectified flow matching, and performs a series of experiments between 1e17 and 6e18 flops. By this, it finds the power law relationship between the objective function, model parameters and compute. It also uses the loss of a 1B dit at the compute of 1e21 flops to confirm the correctness of the equation. At last, it conducts a comparative test between in-context and cross-attention dit, to show that the scaling law can help to indicate the effectiveness of the model architecture's design.
weaknesses: 1. The range of compute budget for experiments is a bit narrow. The count of data points is a little few for drawing a curve. According to "Scaling Laws for Autoregressive Generative Modeling"[1], they did experiments from 1e14 to 1e23 flops.
2. This work's experiment is not as sufficient as the scaling law for AR[1]. Maybe it needs some curves like [1].
3. The base setting of model architecture is not good. Recently, popular settings of in-context dit mainly refer to SD3[2] and FLUX, which only concat text and image as input but use timesteps for adaptive layernorm. This setting is important and may lead to suboptimal conclusion. 
4. It said that "scaling laws can serve as a reliable and predictable benchmark for evaluating the effectiveness of both model architectures and datasets". But it misses experiments to show how to use scaling law to choose training datasets.
5. Did not indicate the resolution of training datasets. Different resolutions may affect the conclusion.

[1] Scaling Laws for Autoregressive Generative Modeling
[2] Scaling Rectified Flow Transformers for High-Resolution Image Synthesis

Meta-review: ### **Summary**
This paper investigates scaling laws for Diffusion Transformers (DiT) in the context of text-to-image generation. The authors conduct experiments to reveal a power-law relationship between training loss and compute budget and claim these findings can inform optimal model sizes and data requirements for future research. Additionally, the authors demonstrate that scaling laws can serve as benchmarks for evaluating data and model architectures.

While the topic is highly relevant to the community, the submission falls short of acceptance standards due to the following major concerns:


### **Strengths**
1. **Novelty**:  This is one of the first studies to explore scaling laws for DiT, which has potential implications for future research and resource optimization.
2. **Relevance**:  Scaling laws are an important topic in machine learning, and applying these insights to diffusion models aligns well with the current state of research.
3. **Clarity of Presentation**:   Visualizations and explanations of scaling relationships are clear and well-organized.
4. **Practical Implications**:   The idea of using scaling laws to assess data and model quality is valuable.


### **Weaknesses**
1. **Limited Experimental Scope**:
   - The experiments are conducted with models capped at 1B parameters, far smaller than the typical scale for state-of-the-art diffusion models (~10B). This raises concerns about the generalizability of the findings.
   - The compute budget range (spanning three orders of magnitude) is narrow compared to existing works in the domain, which span seven or more orders of magnitude.

2. **Insufficient Baseline Comparisons**:
   - There is no comparison with state-of-the-art diffusion models, such as those using more modern architectures (e.g., FLUX or SD3).
   - The analysis does not provide meaningful insights into how these scaling laws hold under diverse architectural or data settings, limiting the work’s relevance to current practical setups.

3. **Questionable Use of Metrics**:
   - While FLOPs and tokens are reasonable metrics in theoretical studies, they lack practical interpretability. The absence of GPU hours or image counts as supplementary references makes the findings less accessible to practitioners.
   - The connection between training loss and downstream generation metrics (e.g., FID) is weakly substantiated, raising concerns about the reliability of conclusions drawn from loss trends alone.


### **Recommendation**
The work is novel and timely, but the experimental design and scope are insufficient to support the authors’ claims. The findings are limited in their generalizability and applicability to modern diffusion models, and key methodological concerns remain unaddressed. While this paper provides an initial exploration of scaling laws for diffusion transformers, it does not quite address the concerns of reviewers in its current form.

Decision: Reject