Papers › Vector-quantized Image Modeling with Improved VQGAN

Vector-quantized Image Modeling with Improved VQGAN

9 Oct 2021ICLR 2022 4arXiv:2110.04627archive 2025-07-28

Jiahui Yu, Xin Li, Jing Yu Koh, Han Zhang, Ruoming Pang, James Qin, Alexander Ku, Yuanzhong Xu, Jason Baldridge, Yonghui Wu

Pretraining language models with next-token prediction on massive text corpora has delivered phenomenal zero-shot, few-shot, transfer learning and multi-tasking capabilities on both generative and discriminative language tasks. Motivated by this success, we explore a Vector-quantized Image Modeling (VIM) approach that involves pretraining a Transformer to predict rasterized image tokens autoregressively. The discrete image tokens are encoded from a learned Vision-Transformer-based VQGAN (ViT-VQGAN). We first propose multiple improvements over vanilla VQGAN from architecture to codebook learning, yielding better efficiency and reconstruction fidelity. The improved ViT-VQGAN further improves vector-quantized image modeling tasks, including unconditional, class-conditioned image generation and unsupervised representation learning. When trained on ImageNet at 256×256 resolution, we achieve Inception Score (IS) of 175.1 and Fr'echet Inception Distance (FID) of 4.17, a dramatic improvement over the vanilla VQGAN, which obtains 70.6 and 17.04 for IS and FID, respectively. Based on ViT-VQGAN and unsupervised pretraining, we further evaluate the pretrained Transformer by averaging intermediate features, similar to Image GPT (iGPT). This ImageNet-pretrained VIM-L significantly beats iGPT-L on linear-probe accuracy from 60.3% to 73.2% for a similar model size. VIM-L also outperforms iGPT-XL which is trained with extra web image data and larger model size.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 9 code samples harvested from 2 repositories linked to this paper: 9 ran (of which 0 constructed an object rather than computing a result; 7 with no instrument failure: 0 honoured, 0 violated, 7 with no contract checked; 2 where Syntology's instrument failed) · 0 unverified. Where Syntology's instrument failed: 1 where our contract draft was wrong; 1 where the contract check could not run; failures of Syntology's instrument, not of the code.

By repository: community (archive-listed): 9 samples from 2 repositories, 9 ran (7 with no instrument failure; 2 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

No sample is linked to this paper from 2 of its repositories that Syntology harvested for other papers:

Levels written between 2026-09-22 and 2026-09-26 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed.

ai-forever/movqgan mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Autoregressive Image Generation using Residual Quantization (arXiv:2203.01941; that paper's own run record: 1 ran (of which 1 constructed an object rather than computing a result; 1 with no instrument failure: 0 honoured, 0 violated, 1 with no contract checked; 0 where Syntology's instrument failed) · 0 unverified; the one sample that ran constructed an object rather than computing a result) and Kandinsky: an Improved Text-to-Image Synthesis with Image Prior and Latent Diffusion (arXiv:2310.03502; that paper's own run record: 12 ran (of which 1 constructed an object rather than computing a result; 5 with no instrument failure: 3 honoured, 0 violated, 2 with no contract checked; 7 where Syntology's instrument failed) · 6 unverified); nothing checks that they implement this paper's method. report
lucidrains/DALLE2-pytorch mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Hierarchical Text-Conditional Image Generation with CLIP Latents (arXiv:2204.06125; that paper's own run record: 33 ran (of which 7 constructed an object rather than computing a result; 23 with no instrument failure: 3 honoured, 6 violated, 14 with no contract checked; 10 where Syntology's instrument failed) · 5 unverified); nothing checks that they implement this paper's method. report
thuangb/enhancing-transformers mentioned on GitHubpytorchMITSyntology: 6 samples, 6 ran (0 instrument-failed) · 0 unverified report
thuanz123/enhancing-transformers mentioned on GitHubpytorchMITSyntology: not harvested report
CuddleSabe/VQGAN pytorchMITSyntology: 3 samples, 3 ran (2 instrument-failed) · 0 unverified report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

A paper named beside a repository with no sample linked to this paper is shown with that paper's own run record, not this paper's: “ran” means executed on a synthesized input, not that the code is correct, and “where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Papers are listed in arXiv-id order, at most three per repository.

Code Syntology ran Syntology

9 samples harvested: 9 ran (of which 0 constructed an object rather than computing a result; 7 with no instrument failure: 0 honoured, 0 violated, 7 with no contract checked; 2 where Syntology's instrument failed) · 0 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page has not changed since , the first build that kept a record date for it; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

1ran · our draft was wrong
1ran; the contract check could not run
7ran

Licence: 2 of the 9 samples are pointer only, meaning Syntology does not serve that copy's text. For 2 of them, this paper's copy is under a permissive licence and cleared, but the stored copy of the same code that Syntology serves is not; the licence label's tooltip gives Syntology's recorded reason. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 2 repositories linked to this paper, official or community; the list below is grouped by repository, each group headed by its name and what it is to the paper. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of six reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity.

thuangb/enhancing-transformers community (archive-listed) 6 samples, 6 ran (0 instrument-failed) · 0 unverified
conv2d in 119 papers enhancing/losses/op/conv2d_gradfix.py ran MIT (permissive) · 76042afc43214587 · report fixture: signature input:Tensor/4/float, weight:Tensor/4/float, bias:Tensor/1/float, stride:int/0/int, padding:int/0/int, dilation:int/0/int, groups:int/0/int · returned Tensor · level recorded 2026-09-24
conv_transpose2d in 7 papers enhancing/losses/op/conv2d_gradfix.py ran MIT (permissive) · 5f98b4db51504bf7 · report fixture: signature input:Tensor/4/float, weight:Tensor/4/float, bias:Tensor/1/float, stride:int/0/int, padding:int/0/int, output_padding:int/0/int, groups:int/0/int, dilation:int/0/int · returned Tensor · level recorded 2026-09-25
could_use_op in 5 papers enhancing/losses/op/conv2d_gradfix.py ran fingerprinted MIT (permissive) · ce977f8c2571b94b · report fixture: signature input:Tensor/4/float · returned bool · level recorded 2026-09-24
hinge_d_loss in 19 papers enhancing/losses/layers.py ran fingerprinted MIT (permissive) · e3931d2003beff13 · report fixture: signature logits_fake:Tensor/2/float, logits_real:Tensor/2/float · returned Tensor · level recorded 2026-09-26
least_square_d_loss enhancing/losses/layers.py ran fingerprinted MIT (permissive) · 50984532271d504f · report fixture: signature logits_fake:Tensor/2/float, logits_real:Tensor/2/float · returned Tensor · level recorded 2026-09-26
vanilla_d_loss in 16 papers enhancing/losses/layers.py ran fingerprinted MIT (permissive) · 1c3cd7aa5e8128bd · report fixture: signature logits_fake:Tensor/2/float, logits_real:Tensor/2/float · returned Tensor · level recorded 2026-09-26
CuddleSabe/VQGAN community (archive-listed) 3 samples, 3 ran (2 instrument-failed) · 0 unverified
default_conv in 70 papers VQGAN/archs/common.py ran · our draft was wrong MIT (permissive) · 8b0e794d4d8f9b13 · report fixture: signature in_channels:int/0/int, out_channels:int/0/int, kernel_size:int/0/int, bias:bool/0/bool · returned Conv2d · level recorded 2026-09-22
get_position_from_periods in 59 papers VQGAN/models/lr_scheduler.py ran; the contract check could not run (RAISES) fingerprinted MIT (permissive) here; the stored copy is pointer only · cd569444547de84f · report fixture: signature iteration:int/0/int, cumulative_period:list/1/int · returned int · level recorded 2026-09-24
master_only in 15 papers VQGAN/utils/dist_util.py ran MIT (permissive) here; the stored copy is pointer only · f6b0e1eb5b7df3e3 · report fixture: signature func:callable/0/? · returned function · level recorded 2026-09-24

Tasks

Image GenerationImage ReconstructionRepresentation LearningTransfer Learning

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Image Reconstruction ImageNet ViT-VQGAN (16x16) FID 1.28 #9 of 15 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Absolute Position EncodingsAdamAttentionAttention DropoutBPECosine AnnealingDense ConnectionsDiscriminative Fine-TuningDropoutGPTLabel SmoothingLayer NormalizationLinear LayerLinear Warmup With Cosine AnnealingMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxTransformerWeight Decay

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections