File size: 11,151 Bytes
fedddbb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
00df20c
fedddbb
 
 
ed436b7
fedddbb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ed436b7
fedddbb
 
 
 
 
 
 
 
 
 
 
 
 
 
ed436b7
fedddbb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ed436b7
fedddbb
 
 
 
 
 
 
ed436b7
fedddbb
32f2eaa
fedddbb
 
32f2eaa
fedddbb
 
 
32f2eaa
fedddbb
 
 
 
 
 
 
 
 
 
ed436b7
fedddbb
 
 
bab3ec8
fedddbb
ed436b7
fedddbb
 
 
 
 
ed436b7
fedddbb
 
 
 
 
 
 
 
ed436b7
fedddbb
 
 
ed436b7
fedddbb
 
 
 
 
 
 
ed436b7
fedddbb
 
 
 
672e37e
00df20c
07c4928
fedddbb
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
---
license: cc-by-nc-4.0
library_name: pytorch
tags:
  - dylomo-dit
  - diffusion
  - diffusion-transformer
  - mixture-of-experts
  - weight-sharing
  - class-conditional
  - image-generation
  - imagenet
datasets:
  - ILSVRC/imagenet-1k
---

# DyLoMo-DiT: ImageNet 256×256 class-conditional models

Weights for the class-conditional models of **DyLoMo-DiT: Dynamic Looped Mixture-of-Experts Diffusion Transformers**.

📄 [Paper](https://arxiv.org/abs/2611.30844) · 💻 [Code](https://github.com/OneBoxCream/DyLoMo-DiT) · 🌐 [Project page](https://oneboxcream.github.io/DyLoMo-DiT/) · 🤗 [Text-to-image preview weights](https://huggingface.co/OneCreamBox/DyLoMo-DiT-T2I-Preview)

DyLoMo-DiT (Dynamic Looped MoE DiT) is a diffusion Transformer that reuses parameters rather than adding them. A weight-shared loop repeatedly applies the middle layers, sparse experts allocate parameter capacity across tokens, and the number of passes through the loop depends on the noise level. On ImageNet 256×256, at the same total parameters and forward compute, it reduces FID by 11–24% relative to DiT.

## 🧱 Models in this repository

Each model has its own folder with `model.safetensors` (EMA weights) and `config.json`.

| Folder | Training steps | Physical layers (looped) | Total params (M) | Active params (M) | GMAC per forward pass | FID-50K ↓ (released seed 42) |
|---|---|---|---|---|---|---|
| `DyLoMo-DiT-B/` | 400k | 12 (6) | 128.5 | 75.8 | 23.1 | 19.16 |
| `DyLoMo-DiT-L/` | 400k | 12 (6) | 451.3 | 278.3 | 80.1 | 6.25 |
| `DyLoMo-DiT-XL/` | 400k | 16 (7) | 686.6 | 411.3 | 117.8 | 4.34 |
| `DyLoMo-DiT-XL-1.6M/` | 1.6M | 16 (7) | 686.6 | 411.3 | 117.8 | 2.18 |

How to read the columns (definitions as in the paper):

- **Total params** include the adaLN modulation layers, which are shared within the looped segment.
- **Active params** are the parameters that one token uses, counted per layer visit: the layers of the looped segment are counted once, the routed experts in proportion to the number selected, and everything else in full.
- **GMAC** is 10⁹ multiply-accumulates per image in one forward pass of the denoiser, counted in the same way as the Gflops reported in the DiT paper. The pass schedule depends on the noise level, so the value is the mean over the 250 uniformly spaced sampling steps.
- **FID-50K** follows the evaluation protocol below (EMA weights, 250 DDPM steps, guidance scale 1.5). The values in the model list describe the released seed-42 checkpoints.

**Seeds.** All released checkpoints come from the training runs with seed 42. Table 2 of the paper reports means over two training seeds: B 18.82, L 6.41 and XL 4.22. The results of the individual released weights are:

| Released checkpoint | Training seed | FID ↓ | sFID ↓ | IS ↑ | Precision ↑ | Recall ↑ |
|---|---|---|---|---|---|---|
| DyLoMo-DiT-B (400k) | 42 | 19.16 | 5.56 | 70.2 | 0.68 | 0.55 |
| DyLoMo-DiT-L (400k) | 42 | 6.25 | 4.46 | 142.0 | 0.80 | 0.53 |
| DyLoMo-DiT-XL (400k) | 42 | 4.34 | 4.30 | 172.4 | 0.82 | 0.53 |
| DyLoMo-DiT-XL (1.6M) | 42 | 2.18 | 4.28 | 253.0 | 0.83 | 0.58 |

**1.6M steps.** `DyLoMo-DiT-XL-1.6M/` continues the seed-42 run of `DyLoMo-DiT-XL/` to 1.6M steps under the same protocol; results after 400k steps come from this single run. At 1M steps DyLoMo-DiT-XL reaches an FID of 2.46 versus 3.08 for DiT-XL/2 trained the same way, and at 1.6M steps it reaches 2.18, below the 2.27 reported for DiT-XL/2 after 7M steps. The 2.18 is the result of the checkpoint in this folder.

## 📊 Results (paper means)

ImageNet 256×256, 400k training steps, EMA weights, guidance scale 1.5, 50k images (Table 2 of the paper). Each DiT row is the baseline trained from scratch under the same protocol, at the same total parameters and forward compute as the DyLoMo-DiT below it. "vs. DiT" is the FID change relative to the DiT of the tier, and F1 is the harmonic mean of precision and recall.

| Model | Total params (M) | Active params (M) | GMAC | FID ↓ | vs. DiT | sFID ↓ | IS ↑ | Prec. ↑ | Rec. ↑ | F1 ↑ |
|---|---|---|---|---|---|---|---|---|---|---|
| DiT-B/2 | 130.5 | 130.5 | 23.0 | 21.19 | — | 6.01 | 68.9 | 0.643 | 0.553 | 0.595 |
| **DyLoMo-DiT-B** | 128.5 | 75.8 | 23.1 | **18.82** | −11% | 5.56 | 70.9 | 0.684 | 0.551 | 0.610 |
| DiT-L/2 | 458.1 | 458.1 | 80.7 | 7.42 | — | 4.82 | 136.6 | 0.777 | 0.527 | 0.628 |
| **DyLoMo-DiT-L** | 451.3 | 278.3 | 80.1 | **6.41** | −14% | 4.50 | 140.5 | 0.799 | 0.526 | 0.635 |
| DiT-XL/2 | 675.1 | 675.1 | 118.6 | 5.57 | — | 4.67 | 158.2 | 0.801 | 0.526 | 0.635 |
| **DyLoMo-DiT-XL** | 686.6 | 411.3 | 117.8 | **4.22** | −24% | 4.30 | 174.4 | 0.824 | 0.524 | 0.640 |

All numbers are means over seeds, and percentages are computed from unrounded values.

## 🧬 Architecture

DyLoMo-DiT follows DiT in its inputs and outputs: patchified VAE latents (2×2 patches), conditioning on timestep and class through adaLN-Zero, and an output layer that predicts noise and variance. It differs in three ways.

1. **Multi-head sparse experts.** Except in the first and last layers, every feed-forward network splits its input into *H* heads. Each head has its own router, which selects *k* of that head's *E* experts for every token; an always-on shared expert is added to the result.
2. **A weight-shared loop.** A middle segment of the layers is executed *r* times with one set of weights. Each sublayer in the segment writes to the residual stream with a factor of 1/*r*, and routing is recomputed in every pass.
3. **Passes allocated by noise level.** The segment runs three passes for t < 500 and one pass for t ≥ 500, which is two passes on average over uniformly spaced sampling steps.

| | DyLoMo-DiT-XL | DyLoMo-DiT-L | DyLoMo-DiT-B |
|---|---|---|---|
| Hidden width *d* | 1024 | 1024 | 512 |
| Physical layers | 16 | 12 | 12 |
| Looped segment (layers count from 1) | layers 5–11 | layers 4–9 | layers 4–9 |
| Layer visits: t < 500 / t ≥ 500 / mean | 30 / 16 / 23 | 24 / 12 / 18 | 24 / 12 / 18 |
| Attention heads × head dimension | 8 × 128 | 8 × 128 | 4 × 128 |
| Normalization | RMSNorm | RMSNorm | RMSNorm |
| Dense feed-forward width (first and last layers) | 2688 | 2688 | 1280 |
| Sparse experts: *H* × *E* (*k*) | 4 × 16 (6) | 4 × 17 (6) | 2 × 17 (6) |
| Width of the experts and the shared expert | 640 | 512 | 312 |
| Total parameters (M) | 686.6 | 451.3 | 128.5 |

**The pass schedule is part of the model.** The timestep of each training sample decided its number of passes, and sampling uses the same schedule. A model trained under one schedule must be run under that schedule; the inference code applies it automatically.

The routing biases used for load balancing take part only in expert selection. The released files hold them next to the EMA weights, with the values they had at the end of training, and they are fixed at sampling time.

## 📏 Evaluation protocol

- ImageNet 256×256, class-conditional, following the DiT protocol.
- EMA weights; 250-step DDPM sampling; classifier-free guidance at scale 1.5, applied only to the first three channels of the latent, as in DiT.
- 50,000 generated images per checkpoint; FID, sFID, IS, Precision and Recall computed with the ADM TensorFlow evaluator and its reference statistics.
- The model predicts noise and variance with a 1000-step linear DDPM noise schedule. Image latents have shape 32×32×4.
- Latents are decoded with sd-vae-ft-ema (scaling factor 0.18215). The VAE is not included in this repository.

## 🚀 Usage

The inference code lives in the [code repository](https://github.com/OneBoxCream/DyLoMo-DiT); its README has all options and the evaluation steps. A typical session looks like this:

```bash
git clone https://github.com/OneBoxCream/DyLoMo-DiT.git && cd DyLoMo-DiT
pip install -r requirements.txt

# download one model folder (config.json + model.safetensors)
huggingface-cli download OneCreamBox/DyLoMo-DiT-ImageNet256 \
    --include "DyLoMo-DiT-XL/*" --local-dir checkpoints

# a grid of samples for a few classes
python sample.py --model checkpoints/DyLoMo-DiT-XL --cfg-scale 4.0 --output sample.png

# the samples of the FID protocol, written to runs/xl/samples.npz for the ADM evaluator
# (defaults: 50,000 images, 250 DDPM steps, guidance scale 1.5)
python sample_ddp.py --model checkpoints/DyLoMo-DiT-XL --output runs/xl
```

## 📚 Training data and procedure

The models are trained on the ImageNet-1k training set at 256×256. Training runs for 400k steps, except for `DyLoMo-DiT-XL-1.6M/`.

The training code for these experiments will be released in the [code repository](https://github.com/OneBoxCream/DyLoMo-DiT).

## 🎯 Intended use

These weights are released for research on generative models: reproducing the ImageNet results of the paper, studying sparse experts and weight-shared loops in diffusion Transformers, and serving as baselines.

This is a recommendation of the releasing authors. It is not a finding of the paper, and it is separate from the license terms of this repository.

## ⚠️ Limitations

These follow from the design of the models and from what the paper covers:

- The models generate 256×256 images for the 1,000 ImageNet classes only. They are not text-to-image models.
- The weights must be run with the pass schedule they were trained with (three passes for t < 500, one for t ≥ 500).
- For these checkpoints the paper reports results with 250-step DDPM sampling only; other samplers and step counts are not covered.
- The released weights each represent one training seed. The paper's 400k comparison reports means over two seeds, and its results after 400k steps come from a single run, so small FID differences should not be over-interpreted.

## 🚧 Potential risks (not evaluated in the paper)

The paper contains no evaluation of bias, fairness or safety for these models. Like other generative models trained on ImageNet-1k, they may reflect the content and biases of that dataset, including in how people are depicted.

## 📜 License

**Weights.** [Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)](https://creativecommons.org/licenses/by-nc/4.0/). This license covers the weight files in this repository.

**Dataset terms.** The models were trained on ImageNet-1k. Access to that dataset is governed by the [ImageNet terms of access](https://www.image-net.org/download.php), which limit its use to non-commercial research and educational purposes; the same terms are reproduced on the [dataset card](https://huggingface.co/datasets/ILSVRC/imagenet-1k). These terms apply to the dataset. They are separate from the license of the weights, and neither replaces the other. Users are responsible for checking that their use is compatible with both.

The VAE and the evaluation tools are third-party components under their own licenses.

## 📝 Citation

```bibtex
@article{dylomodit,
  title   = {DyLoMo-DiT: Dynamic Looped Mixture-of-Experts Diffusion Transformers},
  author  = {Li, Lernie and Liu, Yuanliu and Xiong, Pengfei and Zhang, Wei},
  journal = {arXiv preprint arXiv:2611.30844},
  year    = {2026}
}
```