SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2205.16007 · 2022

Improved Vector Quantized Diffusion Models

arXiv · PDF · Open in the Atlas

Code that ran

6 of 6 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; 3 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 3 failures of our instrument; 0 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/2205.16007.json · badge: /api/ran/2205.16007.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
microsoft/vq-diffusion canonical (classifier label)
classifier basis not recorded on the link
6 ran · 0 no recorded run
FunctionStatusWhere it lives
all_gather Ran
ran; our contract draft was wrong, not the code
microsoft/vq-diffusion/image_synthesis/distributed/distributed.py
code served (permissive licence) · get_code("5d1755bb165b0225")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 torch
import pickle

torch.manual_seed(0)

# The function all_gather takes a single parameter 'data'
# Looking at the function body, it:
# 1. Pickles the data
# 2. Converts it to a ByteTensor
# 3. Gathers it across processes
# 4. Unpickles it back

# Since we're in a non-distributed setting (world_size == 1),
# the function will just pickle and unpickle the data.
# We can pass any picklable Python object.

# Create some sample data - a dictionary with various types
sample_data = {
    'tensor': torch.randn(2, 4),
    'list': [1, 2, 3, 4],
    'string': 'test_data',
    'number': 42,
    'nested': {'a': 1, 'b': 2}
}

ARGS = {
    'data': sample_data
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — 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
all_reduce Ran
ran, honoured the contract we drafted
microsoft/vq-diffusion/image_synthesis/distributed/distributed.py
code served (permissive licence) · get_code("68d08cf984f9fe2d")
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 (2, 4) 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 torch.nn as nn
from torch import distributed as dist

torch.manual_seed(0)

# The function all_reduce takes a tensor and optional parameters op and async_op
# It checks world_size and if > 1, calls dist.all_reduce on the tensor
# For a single process (world_size == 1), it just returns the tensor unchanged

# Create a small tensor (batch=2, dim=4)
tensor = torch.randn(2, 4)

# op parameter - use the default SUM reduction operation
op = dist.ReduceOp.SUM

# async_op parameter - boolean flag
async_op = False

ARGS = {
    "tensor": tensor,
    "op": op,
    "async_op": async_op,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
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 (2, 4) — shape (2, 4) 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
log_1_min_a Ran
ran, honoured the contract we drafted
microsoft/vq-diffusion/image_synthesis/modeling/transformers/diffusion_transformer.py
pointer only (licence: MIT); the stored copy get_code serves, from MuhangTian/TimeDiff, is pointer only (licence: NONE) · get_code("479771b269fc5883")
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 MuhangTian/TimeDiff, 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.

log_add_exp Ran
ran, honoured the contract we drafted
microsoft/vq-diffusion/image_synthesis/modeling/transformers/diffusion_transformer.py
pointer only (licence: MIT); the stored copy get_code serves, from MuhangTian/TimeDiff, is pointer only (licence: NONE) · get_code("032c0dece6594020")
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 MuhangTian/TimeDiff, 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.

reduce_dict Ran
ran; our contract draft was wrong, not the code
microsoft/vq-diffusion/image_synthesis/distributed/distributed.py
code served (permissive licence) · get_code("7dbdda0920e3d074")
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 dict. 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 torch

torch.manual_seed(0)

# Create a simple input dictionary with tensor values
input_dict = {
    'loss': torch.tensor(1.5),
    'accuracy': torch.tensor(0.95),
    'metric_a': torch.tensor([0.1, 0.2, 0.3, 0.4]),
}

ARGS = {
    'input_dict': input_dict,
    'average': True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
sum_except_batch Ran
ran; our contract draft was wrong, not the code
microsoft/vq-diffusion/image_synthesis/modeling/transformers/diffusion_transformer.py
pointer only (licence: MIT); the stored copy get_code serves, from MuhangTian/TimeDiff, is pointer only (licence: NONE) · get_code("5eb945b1f970f6af")
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 MuhangTian/TimeDiff, 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.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 6 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 6 later) and 0 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
log_add_exp 14 other papers
1 dated earlier, 12 later, 1 same year, order not determinable · 3 only as an assembly brick
2102.05379 (2021-02)
Argmax Flows and Multinomial Diffusion: Learning Categorical Distributions
2206.07771 (2022-06)
Discrete Contrastive Diffusion for Cross-Modal Music and Image Generation
and 11 more not named here
log_1_min_a 13 other papers
1 dated earlier, 11 later, 1 same year, order not determinable · 3 only as an assembly brick
2102.05379 (2021-02)
Argmax Flows and Multinomial Diffusion: Learning Categorical Distributions
2206.07771 (2022-06)
Discrete Contrastive Diffusion for Cross-Modal Music and Image Generation
and 10 more not named here
sum_except_batch 9 other papers
1 dated earlier, 7 later, 1 same year, order not determinable · 2 only as an assembly brick
2102.05379 (2021-02)
Argmax Flows and Multinomial Diffusion: Learning Categorical Distributions
2206.07771 (2022-06)
Discrete Contrastive Diffusion for Cross-Modal Music and Image Generation
and 6 more not named here
all_gather 3 other papers
2 later, 1 same year, order not determinable
Gu_Vector_Quantized_Diffusion_Model_for_Text-to-Image_Synthesis_CVPR_2022_paper (2022 (year only))
Vector Quantized Diffusion Model for Text-to-Image Synthesis
2308.07228 (2023-08)
RestoreFormer++: Towards Real-World Blind Face Restoration from Undegraded Key-Value Pairs
2404.11949 (2024-04)
Sketch-guided Image Inpainting with Partial Discrete Diffusion Process
all_reduce 3 other papers
2 later, 1 same year, order not determinable
Gu_Vector_Quantized_Diffusion_Model_for_Text-to-Image_Synthesis_CVPR_2022_paper (2022 (year only))
Vector Quantized Diffusion Model for Text-to-Image Synthesis
2404.11949 (2024-04)
Sketch-guided Image Inpainting with Partial Discrete Diffusion Process
2405.18765 (2024-05)
Large Brain Model for Learning Generic Representations with Tremendous EEG Data in BCI
reduce_dict 3 other papers
2 later, 1 same year, order not determinable
Gu_Vector_Quantized_Diffusion_Model_for_Text-to-Image_Synthesis_CVPR_2022_paper (2022 (year only))
Vector Quantized Diffusion Model for Text-to-Image Synthesis
2308.07228 (2023-08)
RestoreFormer++: Towards Real-World Blind Face Restoration from Undegraded Key-Value Pairs
2404.11949 (2024-04)
Sketch-guided Image Inpainting with Partial Discrete Diffusion Process

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

Vector quantized diffusion (VQ-Diffusion) is a powerful generative model for text-to-image synthesis, but sometimes can still generate low-quality samples or weakly correlated images with text input. We find these issues are mainly due to the flawed sampling strategy. In this paper, we propose two important techniques to further improve the sample quality of VQ-Diffusion. 1) We explore classifier-free guidance sampling for discrete denoising diffusion model and propose a more general and effective implementation of classifier-free guidance. 2) We present a high-quality inference strategy to alleviate the joint distribution issue in VQ-Diffusion. Finally, we conduct experiments on various datasets to validate their effectiveness and show that the improved VQ-Diffusion suppresses the vanilla version by large margins. We achieve an 8.44 FID score on MSCOCO, surpassing VQ-Diffusion by 5.42 FID score. When trained on ImageNet, we dramatically improve the FID score from 11.89 to 4.83, demonstrating the superiority of our proposed techniques.

For agents

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

get_harvested_code_for_paper("2205.16007")
get_code_for_paper("2205.16007")
have("2205.16007")

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

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

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

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

Connect an agent — have() is free.