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| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
pipeline_tag: unconditional-image-generation
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
# Neon: Negative Extrapolation From Self-Training Improves Image Generation
|
| 7 |
+
|
| 8 |
+
This repository contains the official implementation for the paper [Neon: Negative Extrapolation From Self-Training Improves Image Generation](https://huggingface.co/papers/2510.03597).
|
| 9 |
+
|
| 10 |
+
For the code and further details, please visit the official GitHub repository: [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 |
+
## Method
|
| 17 |
+
|
| 18 |
+

|
| 19 |
+
|
| 20 |
+
**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.
|
| 21 |
+
|
| 22 |
+
## Benchmark Performance
|
| 23 |
+
|
| 24 |
+
| Model type | Dataset | Base model FID | Neon FID (paper) | Download model |
|
| 25 |
+
| :---------- | :---------- | -----------: | ---------------: | :------------------------------------------------------------------------------------------------------- |
|
| 26 |
+
| xAR-L | ImageNet-256 | 1.28 | **1.02** | [Download](https://huggingface.co/sinaalemohammad/Neon/resolve/main/Neon_xARL_imagenet256.pth) |
|
| 27 |
+
| xAR-B | ImageNet-256 | 1.72 | **1.31** | [Download](https://huggingface.co/sinaalemohammad/Neon/resolve/main/Neon_xARB_imagenet256.pth) |
|
| 28 |
+
| VAR d16 | ImageNet-256 | 3.30 | **2.01** | [Download](https://huggingface.co/sinaalemohammad/Neon/resolve/main/Neon_VARd16_imagenet256.pth) |
|
| 29 |
+
| VAR d36 | ImageNet-512 | 2.63 | **1.70** | [Download](https://huggingface.co/sinaalemohammad/Neon/resolve/main/Neon_VARd36_imagenet512.pth) |
|
| 30 |
+
| EDM (cond.) | CIFAR-10 (32×32) | 1.78 | **1.38** | [Download](https://huggingface.co/sinaalemohammad/Neon/resolve/main/Neon_EDM_conditional_CIFAR10.pkl) |
|
| 31 |
+
| EDM (uncond.) | CIFAR-10 (32×32) | 1.98 | **1.38** | [Download](https://huggingface.co/sinaalemohammad/Neon/resolve/main/Neon_EDM_unconditional_CIFAR10.pkl) |
|
| 32 |
+
| EDM | FFHQ-64×64 | 2.39 | **1.12** | [Download](https://huggingface.co/sinaalemohammad/Neon/resolve/main/Neon_EDM_FFHQ.pkl) |
|
| 33 |
+
| IMM | ImageNet-256 | 1.99 | **1.46** | [Download](https://huggingface.co/sinaalemohammad/Neon/resolve/main/Neon_imm_imagenet256.pkl) |
|
| 34 |
+
|
| 35 |
+
## 🚀 Quickstart
|
| 36 |
+
|
| 37 |
+
### 1) Environment
|
| 38 |
+
|
| 39 |
+
```bash
|
| 40 |
+
# from repo root
|
| 41 |
+
conda env create -f environment.yml
|
| 42 |
+
conda activate neon
|
| 43 |
+
```
|
| 44 |
+
|
| 45 |
+
### 2) Download pretrained models & FID stats
|
| 46 |
+
|
| 47 |
+
```bash
|
| 48 |
+
bash download_models.sh
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
This populates `checkpoints/` and `fid_stats/`.
|
| 52 |
+
**Pretrained Neon models can also be downloaded from Hugging Face:** [https://huggingface.co/sinaalemohammad/Neon](https://huggingface.co/sinaalemohammad/Neon)
|
| 53 |
+
|
| 54 |
+
### 3) Evaluate (FID/IS)
|
| 55 |
+
|
| 56 |
+
> All examples assume 8 GPUs; adjust `--nproc_per_node` / batch sizes as needed.
|
| 57 |
+
|
| 58 |
+
**xAR @ ImageNet‑256**
|
| 59 |
+
|
| 60 |
+
```bash
|
| 61 |
+
# 1) VAE for xAR (credit: MAR)
|
| 62 |
+
hf download xwen99/mar-vae-kl16 --include kl16.ckpt --local-dir xAR/pretrained
|
| 63 |
+
# 2) Use it via:
|
| 64 |
+
# --vae_path xAR/pretrained/kl16.ckpt
|
| 65 |
+
|
| 66 |
+
# xAR‑L
|
| 67 |
+
PYTHONPATH=xAR torchrun --standalone --nproc_per_node=8 xAR/calculate_fid.py \
|
| 68 |
+
--model xar_large \
|
| 69 |
+
--model_ckpt checkpoints/Neon_xARL_imagenet256.pth \
|
| 70 |
+
--cfg 2.3 --vae_path xAR/pretrained/kl16.ckpt \
|
| 71 |
+
--num_images 50000 --batch_size 64 --flow_steps 40 --img_size 256 \
|
| 72 |
+
--fid_stats fid_stats/adm_in256_stats.npz
|
| 73 |
+
|
| 74 |
+
# xAR‑B
|
| 75 |
+
PYTHONPATH=xAR torchrun --standalone --nproc_per_node=8 xAR/calculate_fid.py \
|
| 76 |
+
--model xar_base \
|
| 77 |
+
--model_ckpt checkpoints/Neon_xARB_imagenet256.pth \
|
| 78 |
+
--cfg 2.7 --vae_path xAR/pretrained/kl16.ckpt \
|
| 79 |
+
--num_images 50000 --batch_size 32 --flow_steps 50 --img_size 256 \
|
| 80 |
+
--fid_stats fid_stats/adm_in256_stats.npz
|
| 81 |
+
```
|
| 82 |
+
|
| 83 |
+
**VAR @ ImageNet‑256 / 512**
|
| 84 |
+
|
| 85 |
+
```bash
|
| 86 |
+
# d16 @ 256
|
| 87 |
+
PYTHONPATH=VAR/VAR_imagenet_256 torchrun --standalone --nproc_per_node=8 \
|
| 88 |
+
VAR/VAR_imagenet_256/calculate_fid.py \
|
| 89 |
+
--var_ckpt checkpoints/Neon_VARd16_imagenet256.pth \
|
| 90 |
+
--num_images 50000 --batch_size 64 --img_size 256 \
|
| 91 |
+
--fid_stats fid_stats/adm_in256_stats.npz
|
| 92 |
+
|
| 93 |
+
# d36 @ 512
|
| 94 |
+
PYTHONPATH=VAR/VAR_imagenet_512 torchrun --standalone --nproc_per_node=8 \
|
| 95 |
+
VAR/VAR_imagenet_512/calculate_fid.py \
|
| 96 |
+
--var_ckpt checkpoints/Neon_VARd36_imagenet512.pth \
|
| 97 |
+
--num_images 50000 --batch_size 32 --img_size 512 \
|
| 98 |
+
--fid_stats fid_stats/adm_in512_stats.npz
|
| 99 |
+
```
|
| 100 |
+
|
| 101 |
+
**EDM (Karras et al.) @ CIFAR‑10 / FFHQ**
|
| 102 |
+
|
| 103 |
+
```bash
|
| 104 |
+
# CIFAR‑10 (conditional)
|
| 105 |
+
PYTHONPATH=edm torchrun --standalone --nproc_per_node=8 edm/calculate_fid.py \
|
| 106 |
+
--network_pkl checkpoints/Neon_EDM_conditional_CIFAR10.pkl \
|
| 107 |
+
--ref https://nvlabs-fi-cdn.nvidia.com/edm/fid-refs/cifar10-32x32.npz \
|
| 108 |
+
--seeds 0-49999 --max_batch_size 256 --num_steps 18
|
| 109 |
+
|
| 110 |
+
# CIFAR‑10 (unconditional)
|
| 111 |
+
PYTHONPATH=edm torchrun --standalone --nproc_per_node=8 edm/calculate_fid.py \
|
| 112 |
+
--network_pkl checkpoints/Neon_EDM_unconditional_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 |
+
# FFHQ‑64 (unconditional)
|
| 117 |
+
PYTHONPATH=edm torchrun --standalone --nproc_per_node=8 edm/calculate_fid.py \
|
| 118 |
+
--network_pkl checkpoints/Neon_EDM_FFHQ.pkl \
|
| 119 |
+
--ref https://nvlabs-fi-cdn.nvidia.com/edm/fid-refs/ffhq-64x64.npz \
|
| 120 |
+
--seeds 0-49999 --max_batch_size 256 --num_steps 40
|
| 121 |
+
```
|
| 122 |
+
|
| 123 |
+
**IMM @ ImageNet‑256**
|
| 124 |
+
|
| 125 |
+
```bash
|
| 126 |
+
# IMM @ T = 8
|
| 127 |
+
PYTHONPATH=imm torchrun --standalone --nproc_per_node=8 imm/calculate_fid.py \
|
| 128 |
+
--model_ckpt checkpoints/Neon_IMM_imagenet256.pth \
|
| 129 |
+
--num_images 50000 --batch_size 64 --img_size 256 \
|
| 130 |
+
--fid_stats fid_stats/adm_in256_stats.npz
|
| 131 |
+
```
|
| 132 |
+
|
| 133 |
+
---
|
| 134 |
+
|
| 135 |
+
## 📣 Citation
|
| 136 |
+
|
| 137 |
+
If you find Neon useful, please consider citing the paper:
|
| 138 |
+
|
| 139 |
+
```bibtex
|
| 140 |
+
@article{neon2025,
|
| 141 |
+
title={Neon: Negative Extrapolation from Self-Training for Generative Models},
|
| 142 |
+
author={Alemohammad, Sina and collaborators},
|
| 143 |
+
journal={arXiv preprint},
|
| 144 |
+
year={2025}
|
| 145 |
+
}
|
| 146 |
+
```
|
| 147 |
+
|
| 148 |
+
---
|
| 149 |
+
|
| 150 |
+
## Contact
|
| 151 |
+
|
| 152 |
+
Questions? Reach out to **Sina Alemohammad** — [sinaalemohammad@gmail.com](mailto:sinaalemohammad@gmail.com).
|