Unconditional Image Generation

Improve model card for Neon: Negative Extrapolation From Self-Training Improves Image Generation

#1
by nielsr HF Staff - opened
Files changed (1) hide show
  1. README.md +152 -3
README.md CHANGED
@@ -1,3 +1,152 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ pipeline_tag: unconditional-image-generation
4
+ ---
5
+
6
+ # Neon: Negative Extrapolation From Self-Training Improves Image Generation
7
+
8
+ Paper: [Neon: Negative Extrapolation From Self-Training Improves Image Generation](https://huggingface.co/papers/2510.03597)
9
+
10
+ Code: [https://github.com/SinaAlemohammad/Neon](https://github.com/SinaAlemohammad/Neon)
11
+
12
+ ## Introduction
13
+
14
+ Scaling generative AI models is bottlenecked by the scarcity of high-quality training data. The ease of synthesizing from a generative model suggests using (unverified) synthetic data to augment a limited corpus of real data for the purpose of fine-tuning in the hope of improving performance. Unfortunately, however, the resulting positive feedback loop leads to model autophagy disorder (MAD, aka model collapse) that results in a rapid degradation in sample quality and/or diversity. In this paper, we introduce Neon (for Negative Extrapolation frOm self-traiNing), a new learning method that turns the degradation from self-training into a powerful signal for self-improvement. Given a base model, Neon first fine-tunes it on its own self-synthesized data but then, counterintuitively, reverses its gradient updates to extrapolate away from the degraded weights. We prove that Neon works because typical inference samplers that favor high-probability regions create a predictable anti-alignment between the synthetic and real data population gradients, which negative extrapolation corrects to better align the model with the true data distribution. Neon is remarkably easy to implement via a simple post-hoc merge that requires no new real data, works effectively with as few as 1k synthetic samples, and typically uses less than 1% additional training compute. We demonstrate Neon’s universality across a range of architectures (diffusion, flow matching, autoregressive, and inductive moment matching models) and datasets (ImageNet, CIFAR-10, and FFHQ). In particular, on ImageNet 256x256, Neon elevates the xAR-L model to a new state-of-the-art FID of 1.02 with only 0.36% additional training compute.
15
+
16
+ ---
17
+
18
+ ## Method
19
+
20
+ ![Algorithm 1: Neon — Negative Extrapolation from Self‑Training](https://github.com/SinaAlemohammad/Neon/raw/main/assets/algorithm.png)
21
+
22
+ **In one line:** sample with your usual inference to form a synthetic set $S$; briefly fine-tune the reference model on $S$ to get $\theta_s$; then **reverse** that update with a merge $\theta_{\text{neon}}=(1+w)\,\theta_r - w\,\theta_s$ (small $w>0$), which cancels mode-seeking drift and improves FID.
23
+
24
+ ---
25
+
26
+ ## Benchmark Performance
27
+
28
+ | Model type | Dataset | Base model FID | Neon FID (paper) | Download model |
29
+ | :-------- | :--------------- | -------------: | ---------------: | :------------------------------------------------------------------------------------------------------- |
30
+ | xAR-L | ImageNet-256 | 1.28 | **1.02** | [Download](https://huggingface.co/sinaalemohammad/Neon/resolve/main/Neon_xARL_imagenet256.pth) |
31
+ | xAR-B | ImageNet-256 | 1.72 | **1.31** | [Download](https://huggingface.co/sinaalemohammad/Neon/resolve/main/Neon_xARB_imagenet256.pth) |
32
+ | VAR d16 | ImageNet-256 | 3.30 | **2.01** | [Download](https://huggingface.co/sinaalemohammad/Neon/resolve/main/Neon_VARd16_imagenet256.pth) |
33
+ | VAR d36 | ImageNet-512 | 2.63 | **1.70** | [Download](https://huggingface.co/sinaalemohammad/Neon/resolve/main/Neon_VARd36_imagenet512.pth) |
34
+ | EDM (cond.) | CIFAR-10 (32×32) | 1.78 | **1.38** | [Download](https://huggingface.co/sinaalemohammad/Neon/resolve/main/Neon_EDM_conditional_CIFAR10.pkl) |
35
+ | EDM (uncond.) | CIFAR-10 (32×32) | 1.98 | **1.38** | [Download](https://huggingface.co/sinaalemohammad/Neon/resolve/main/Neon_EDM_unconditional_CIFAR10.pkl) |
36
+ | EDM | FFHQ-64×64 | 2.39 | **1.12** | [Download](https://huggingface.co/sinaalemohammad/Neon/resolve/main/Neon_EDM_FFHQ.pkl) |
37
+ | IMM | ImageNet-256 | 1.99 | **1.46** | [Download](https://huggingface.co/sinaalemohammad/Neon/resolve/main/Neon_imm_imagenet256.pkl) |
38
+
39
+ ---
40
+
41
+ ## 🚀 Quickstart
42
+
43
+ ### 1) Environment
44
+
45
+ ```bash
46
+ # from repo root
47
+ conda env create -f environment.yml
48
+ conda activate neon
49
+ ```
50
+
51
+ ### 2) Download pretrained models & FID stats
52
+
53
+ ```bash
54
+ bash download_models.sh
55
+ ```
56
+
57
+ This populates `checkpoints/` and `fid_stats/`.
58
+ **Pretrained Neon models can also be downloaded from Hugging Face:** [https://huggingface.co/sinaalemohammad/Neon](https://huggingface.co/sinaalemohammad/Neon)
59
+
60
+ ### 3) Evaluate (FID/IS)
61
+
62
+ > All examples assume 8 GPUs; adjust `--nproc_per_node` / batch sizes as needed.
63
+
64
+ **xAR @ ImageNet‑256**
65
+
66
+ ```bash
67
+ # 1) VAE for xAR (credit: MAR)
68
+ hf download xwen99/mar-vae-kl16 --include kl16.ckpt --local-dir xAR/pretrained
69
+ # 2) Use it via:
70
+ # --vae_path xAR/pretrained/kl16.ckpt
71
+
72
+ # xAR‑L
73
+ PYTHONPATH=xAR torchrun --standalone --nproc_per_node=8 xAR/calculate_fid.py \
74
+ --model xar_large \
75
+ --model_ckpt checkpoints/Neon_xARL_imagenet256.pth \
76
+ --cfg 2.3 --vae_path xAR/pretrained/kl16.ckpt \
77
+ --num_images 50000 --batch_size 64 --flow_steps 40 --img_size 256 \
78
+ --fid_stats fid_stats/adm_in256_stats.npz
79
+
80
+ # xAR‑B
81
+ PYTHONPATH=xAR torchrun --standalone --nproc_per_node=8 xAR/calculate_fid.py \
82
+ --model xar_base \
83
+ --model_ckpt checkpoints/Neon_xARB_imagenet256.pth \
84
+ --cfg 2.7 --vae_path xAR/pretrained/kl16.ckpt \
85
+ --num_images 50000 --batch_size 32 --flow_steps 50 --img_size 256 \
86
+ --fid_stats fid_stats/adm_in256_stats.npz
87
+ ```
88
+
89
+ **VAR @ ImageNet‑256 / 512**
90
+
91
+ ```bash
92
+ # d16 @ 256
93
+ PYTHONPATH=VAR/VAR_imagenet_256 torchrun --standalone --nproc_per_node=8 \
94
+ VAR/VAR_imagenet_256/calculate_fid.py \
95
+ --var_ckpt checkpoints/Neon_VARd16_imagenet256.pth \
96
+ --num_images 50000 --batch_size 64 --img_size 256 \
97
+ --fid_stats fid_stats/adm_in256_stats.npz
98
+
99
+ # d36 @ 512
100
+ PYTHONPATH=VAR/VAR_imagenet_512 torchrun --standalone --nproc_per_node=8 \
101
+ VAR/VAR_imagenet_512/calculate_fid.py \
102
+ --var_ckpt checkpoints/Neon_VARd36_imagenet512.pth \
103
+ --num_images 50000 --batch_size 32 --img_size 512 \
104
+ --fid_stats fid_stats/adm_in512_stats.npz
105
+ ```
106
+
107
+ **EDM (Karras et al.) @ CIFAR‑10 / FFHQ**
108
+
109
+ ```bash
110
+ # CIFAR‑10 (conditional)
111
+ PYTHONPATH=edm torchrun --standalone --nproc_per_node=8 edm/calculate_fid.py \
112
+ --network_pkl checkpoints/Neon_EDM_conditional_CIFAR10.pkl \
113
+ --ref https://nvlabs-fi-cdn.nvidia.com/edm/fid-refs/cifar10-32x32.npz \
114
+ --seeds 0-49999 --max_batch_size 256 --num_steps 18
115
+
116
+ # CIFAR‑10 (unconditional)
117
+ PYTHONPATH=edm torchrun --standalone --nproc_per_node=8 edm/calculate_fid.py \
118
+ --network_pkl checkpoints/Neon_EDM_unconditional_CIFAR10.pkl \
119
+ --ref https://nvlabs-fi-cdn.nvidia.com/edm/fid-refs/cifar10-32x32.npz \
120
+ --seeds 0-49999 --max_batch_size 256 --num_steps 18
121
+
122
+ # FFHQ‑64 (unconditional)
123
+ PYTHONPATH=edm torchrun --standalone --nproc_per_node=8 edm/calculate_fid.py \
124
+ --network_pkl checkpoints/Neon_EDM_FFHQ.pkl \
125
+ --ref https://nvlabs-fi-cdn.nvidia.com/edm/fid-refs/ffhq-64x64.npz \
126
+ --seeds 0-49999 --max_batch_size 256 --num_steps 40
127
+ ```
128
+
129
+ **IMM @ ImageNet‑256**
130
+
131
+ ```bash
132
+ # IMM @ T = 8
133
+ PYTHONPATH=imm torchrun --standalone --nproc_per_node=8 imm/calculate_fid.py \
134
+ --model_ckpt checkpoints/Neon_IMM_imagenet256.pth \
135
+ --num_images 50000 --batch_size 64 --img_size 256 \
136
+ --fid_stats fid_stats/adm_in256_stats.npz
137
+ ```
138
+
139
+ ---
140
+
141
+ ## 📣 Citation
142
+
143
+ If you find Neon useful, please consider citing the paper:
144
+
145
+ ```bibtex
146
+ @article{neon2025,
147
+ title={Neon: Negative Extrapolation from Self-Training for Generative Models},
148
+ author={Alemohammad, Sina and collaborators},
149
+ journal={arXiv preprint},
150
+ year={2025}
151
+ }
152
+ ```