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 Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2110.04627")

Code

Syntology Ran 3 of 9 code samples harvested from 2 repositories linked to this paper; 6 have no recorded run. Of those that ran: 1 ran · our draft was wrong; 2 ran with no contract checked.

By repository: community (archive-listed): 9 samples from 2 repositories, 3 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

ai-forever/movqgan mentioned on GitHubpytorch report
lucidrains/DALLE2-pytorch mentioned on GitHubpytorch report
thuangb/enhancing-transformers mentioned on GitHubpytorchMIT report
thuanz123/enhancing-transformers mentioned on GitHubpytorchMIT 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.

Code Syntology ran Syntology

9 samples harvested; 3 ran; 0 honoured the contract we drafted; 6 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · our draft was wrong
2ran
6unverified

Licence: 0 of the 9 samples are pointer only, meaning Syntology does not serve that copy's text. 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; each sample names its own and says which. “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. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (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 from a repository marked official are listed first. 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 four 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; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). 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.

default_conv CuddleSabe/VQGAN/VQGAN/archs/common.py community (archive-listed) ran · our draft was wrong MIT (permissive) · 8b0e794d4d8f9b13 · report
get_position_from_periods CuddleSabe/VQGAN/VQGAN/models/lr_scheduler.py community (archive-listed) ran fingerprinted MIT (permissive) · cd569444547de84f · report
master_only CuddleSabe/VQGAN/VQGAN/utils/dist_util.py community (archive-listed) ran MIT (permissive) · f6b0e1eb5b7df3e3 · report
conv2d thuangb/enhancing-transformers/enhancing/losses/op/conv2d_gradfix.py community (archive-listed) unverified MIT (permissive) · 76042afc43214587 · report
conv_transpose2d thuangb/enhancing-transformers/enhancing/losses/op/conv2d_gradfix.py community (archive-listed) unverified MIT (permissive) · 5f98b4db51504bf7 · report
could_use_op thuangb/enhancing-transformers/enhancing/losses/op/conv2d_gradfix.py community (archive-listed) unverified MIT (permissive) · ce977f8c2571b94b · report
hinge_d_loss thuangb/enhancing-transformers/enhancing/losses/layers.py community (archive-listed) unverified MIT (permissive) · e3931d2003beff13 · report
least_square_d_loss thuangb/enhancing-transformers/enhancing/losses/layers.py community (archive-listed) unverified MIT (permissive) · 50984532271d504f · report
vanilla_d_loss thuangb/enhancing-transformers/enhancing/losses/layers.py community (archive-listed) unverified MIT (permissive) · 1c3cd7aa5e8128bd · report

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