SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.02664 · 2023

On Memorization in Diffusion Models

arXiv · PDF · Open in the Atlas

Code that ran

10 of 14 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 4 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 6 failures of our instrument; 4 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2310.02664.json · badge: /api/ran/2310.02664.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
sail-sg/DiffMemorize canonical (classifier label)
classifier basis: census
10 ran · 4 no recorded run
FunctionStatusWhere it lives
file_ext Ran
ran; our contract draft was wrong, not the code
sail-sg/DiffMemorize/dataset_utils/dataset_diversity.py
pointer only (licence: MIT); the stored copy get_code serves, from pdillis/stylegan3-fun, is pointer only (licence: NOASSERTION) · get_code("a2b45afa097b55b6")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from pdillis/stylegan3-fun, and GitHub could not classify the licence of that repository (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

file_ext Ran
ran; our contract draft was wrong, not the code
sail-sg/DiffMemorize/mem_ratio.py
pointer only (licence: MIT); the stored copy get_code serves, from Morefre/Understanding-Generalizability-of-Diffusion-Models-Requires-Rethinking-the-Hidden-Gaussian-Structure, is pointer only (licence: NOASSERTION) · get_code("b1986232479684ae")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from Morefre/Understanding-Generalizability-of-Diffusion-Models-Requires-Rethinking-the-Hidden-Gaussian-Structure, and GitHub could not classify the licence of that repository (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

find_class_folders Ran
ran, honoured the contract we drafted
sail-sg/DiffMemorize/dataset_utils/sample_imagenet.py
code served (permissive licence) · get_code("2bc3b7a1e6f0984b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import tempfile

# Create a temporary directory and file to avoid actual file I/O dependency
temp_dir = tempfile.mkdtemp()
data_utils_dir = os.path.join(temp_dir, 'data_utils')
os.makedirs(data_utils_dir, exist_ok=True)

# Create a mock imagenet_hierarch.txt file with sample data
hierarch_file = os.path.join(data_utils_dir, 'imagenet_hierarch.txt')
with open(hierarch_file, 'w') as f:
    f.write("cmd1 arg1 n02084442/image1.jpg bird/001\n")
    f.write("cmd2 arg2 n02084443/image2.jpg cat/002\n")
    f.write("cmd3 arg3 n02084444/image3.jpg dog/003\n")
    f.write("cmd4 arg4 n02084445/image4.jpg bird/004\n")
    f.write("cmd5 arg5 n02084446/image5.jpg cat/005\n")

# Change to temp directory so the relative path works
os.chdir(temp_dir)

ARGS = {
    'class_name': 'bird'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
format_time Ran
ran; our contract draft was wrong, not the code
sail-sg/DiffMemorize/dnnlib/util.py
code served (permissive licence) · get_code("674eca7b9e1b6439")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
from typing import Union

# Test with various time values
ARGS = {
    "seconds": 3661.7  # 1 hour, 1 minute, 1.7 seconds - tests rounding and all format branches
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
format_time_brief Ran
ran; our contract draft was wrong, not the code
sail-sg/DiffMemorize/dnnlib/util.py
code served (permissive licence) · get_code("32af001972a0699f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
from typing import Union

# Test with various time values
ARGS = {
    "seconds": 45.7  # A float value that will be rounded to 46 seconds
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
maybe_min Ran
ran, honoured the contract we drafted
sail-sg/DiffMemorize/dataset_utils/dataset_diversity.py
pointer only (licence: MIT); the stored copy get_code serves, from pdillis/stylegan3-fun, is pointer only (licence: NOASSERTION) · get_code("dd1dc700e87f36cc")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from pdillis/stylegan3-fun, and GitHub could not classify the licence of that repository (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

parse_int_list Ran
ran, honoured the contract we drafted
sail-sg/DiffMemorize/generate_edm.py
pointer only (licence: MIT); the stored copy get_code serves, from newbeeer/stf, is pointer only (licence: NONE) · get_code("cacd4f6ec202d9b4")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from newbeeer/stf, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

parse_tuple Ran
ran, honoured the contract we drafted
sail-sg/DiffMemorize/dataset_utils/dataset_diversity.py
pointer only (licence: MIT); the stored copy get_code serves, from xfetus/fetal-ultrasound-edm2, is pointer only (licence: NONE) · get_code("07b21b35ecb4815c")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from xfetus/fetal-ultrasound-edm2, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

sample_images Ran
ran; our contract draft was wrong, not the code
sail-sg/DiffMemorize/dataset_utils/sample_imagenet.py
code served (permissive licence) · get_code("f1eb8f458487f3ab")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import tempfile
import shutil

# Create a temporary directory structure for testing
temp_root = tempfile.mkdtemp()

# Create class folders with some dummy files
class_folders = ['class_0', 'class_1', 'class_2']
for class_folder in class_folders:
    class_path = os.path.join(temp_root, class_folder)
    os.makedirs(class_path, exist_ok=True)
    # Create some dummy image files
    for i in range(10):
        with open(os.path.join(class_path, f'image_{i}.jpg'), 'w') as f:
            f.write(f'dummy image {i}')

# Create a temporary file for saving the output
save_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')
save_path = save_file.name
save_file.close()

ARGS = {
    'root': temp_root,
    'class_folders': class_folders,
    'num_samples': 7,
    'save_path': save_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
weight_init Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
sail-sg/DiffMemorize/training/networks.py
code served (permissive licence) · get_code("d41a4250066bce93")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (4, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

ARGS = {
    'shape': (4, 3),
    'mode': 'xavier_uniform',
    'fan_in': 10,
    'fan_out': 8,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (4, 3) — shape (4, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
ablation_sampler Not yet run
unverified (harvested, no recorded run)
sail-sg/DiffMemorize/generate_edm.py
code served (permissive licence) · get_code("9fbf646e18eed1db")
How it ran

no invocation recorded.

ask_yes_no Not yet run
unverified (harvested, no recorded run)
sail-sg/DiffMemorize/dnnlib/util.py
code served (permissive licence) · get_code("9d31d2c4cd16bb2d")
How it ran

no invocation recorded.

edm_sampler Not yet run
unverified (harvested, no recorded run)
sail-sg/DiffMemorize/generate_edm.py
code served (permissive licence) · get_code("8b16b0674af254db")
How it ran

no invocation recorded.

load_cifar10_zip Not yet run
unverified (harvested, no recorded run)
sail-sg/DiffMemorize/mem_ratio.py
code served (permissive licence) · get_code("ad63e5e1c1e32ab7")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 12 are also present in other papers whose code we hold (11 with at least one paper dated earlier, 10 the same month, 12 later) and 2 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
format_time 73 other papers
14 dated earlier, 5 the same month, 53 later, 1 undated
2004.00049 (2020-04)
In-Domain GAN Inversion for Real Image Editing
2004.11660 (2020-04)
Disentangled and Controllable Face Image Generation via 3D Imitative-Contrastive Learning
2108.00946 (2021-08)
StyleGAN-NADA: CLIP-Guided Domain Adaptation of Image Generators
and 70 more not named here
ask_yes_no 69 other papers
14 dated earlier, 5 the same month, 49 later, 1 undated
2004.00049 (2020-04)
In-Domain GAN Inversion for Real Image Editing
2004.11660 (2020-04)
Disentangled and Controllable Face Image Generation via 3D Imitative-Contrastive Learning
2108.00946 (2021-08)
StyleGAN-NADA: CLIP-Guided Domain Adaptation of Image Generators
and 66 more not named here
format_time_brief 68 other papers
12 dated earlier, 4 the same month, 51 later, 1 undated
2108.00946 (2021-08)
StyleGAN-NADA: CLIP-Guided Domain Adaptation of Image Generators
2202.00273 (2022-02)
StyleGAN-XL: Scaling StyleGAN to Large Diverse Datasets
2206.07695 (2022-06)
VoxGRAF: Fast 3D-Aware Image Synthesis with Sparse Voxel Grids
and 65 more not named here
weight_init 49 other papers
8 dated earlier, 4 the same month, 37 later · 1 only as an assembly brick
2303.10137 (2023-03)
A Recipe for Watermarking Diffusion Models
2305.15266 (2023-05)
Diffusion-Based Audio Inpainting
2305.16269 (2023-05)
UDPM: Upsampling Diffusion Probabilistic Models
and 46 more not named here
parse_int_list 37 other papers
10 dated earlier, 2 the same month, 25 later
2206.00364 (2022-06)
Elucidating the Design Space of Diffusion-Based Generative Models
2302.00670 (2023-02)
Stable Target Field for Reduced Variance Score Estimation in Diffusion Models
2302.04265 (2023-02)
PFGM++: Unlocking the Potential of Physics-Inspired Generative Models
and 34 more not named here
file_ext 35 other papers
13 dated earlier, 2 the same month, 20 later
2106.07023 (2021-06)
Styleformer: Transformer based Generative Adversarial Networks with Style Vector
2111.02175 (2021-11)
Discriminator Synthesis: On reusing the other half of Generative Adversarial Networks
2111.13792 (2021-11)
LAFITE: Towards Language-Free Training for Text-to-Image Generation
and 32 more not named here
maybe_min 35 other papers
13 dated earlier, 2 the same month, 20 later
2106.07023 (2021-06)
Styleformer: Transformer based Generative Adversarial Networks with Style Vector
2111.02175 (2021-11)
Discriminator Synthesis: On reusing the other half of Generative Adversarial Networks
2111.13792 (2021-11)
LAFITE: Towards Language-Free Training for Text-to-Image Generation
and 32 more not named here
parse_tuple 20 other papers
5 dated earlier, 2 the same month, 13 later
2303.10137 (2023-03)
A Recipe for Watermarking Diffusion Models
2306.06991 (2023-06)
Fast Diffusion Model
2308.15321 (2023-08)
Elucidating the Exposure Bias in Diffusion Models
and 17 more not named here
ablation_sampler 12 other papers
3 dated earlier, 2 the same month, 7 later
2206.00364 (2022-06)
Elucidating the Design Space of Diffusion-Based Generative Models
2207.12598 (2022-07)
Classifier-Free Diffusion Guidance
2303.10137 (2023-03)
A Recipe for Watermarking Diffusion Models
and 9 more not named here
edm_sampler 11 other papers
4 dated earlier, 1 the same month, 6 later
2206.00364 (2022-06)
Elucidating the Design Space of Diffusion-Based Generative Models
2301.11445 (2023-01)
3DShape2VecSet: A 3D Shape Representation for Neural Fields and Generative Diffusion Models
2303.10137 (2023-03)
A Recipe for Watermarking Diffusion Models
and 8 more not named here
file_ext 2 other papers
1 dated earlier, 1 later
2211.15388 (2022-11)
Shifted Diffusion for Text-to-image Generation
2410.24060 (2024-10)
Understanding Generalizability of Diffusion Models Requires Rethinking the Hidden Gaussian Structure
load_cifar10_zip 1 other paper
1 later
2410.24060 (2024-10)
Understanding Generalizability of Diffusion Models Requires Rethinking the Hidden Gaussian Structure

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Due to their capacity to generate novel and high-quality samples, diffusion models have attracted significant research interest in recent years. Notably, the typical training objective of diffusion models, i.e., denoising score matching, has a closed-form optimal solution that can only generate training data replicating samples. This indicates that a memorization behavior is theoretically expected, which contradicts the common generalization ability of state-of-the-art diffusion models, and thus calls for a deeper understanding. Looking into this, we first observe that memorization behaviors tend to occur on smaller-sized datasets, which motivates our definition of effective model memorization (EMM), a metric measuring the maximum size of training data at which a learned diffusion model approximates its theoretical optimum. Then, we quantify the impact of the influential factors on these memorization behaviors in terms of EMM, focusing primarily on data distribution, model configuration, and training procedure. Besides comprehensive empirical results identifying the influential factors, we surprisingly find that conditioning training data on uninformative random labels can significantly trigger the memorization in diffusion models. Our study holds practical significance for diffusion model users and offers clues to theoretical research in deep generative models. Code is available at https://github.com/sail-sg/DiffMemorize.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2310.02664")
get_code_for_paper("2310.02664")
have("2310.02664")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2310.02664.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2310.02664.svg)](https://syntology.ai/paper/2310.02664)

Connect an agent — have() is free.