Papers › TransGAN: Two Pure Transformers Can Make One Strong GAN, and That Can Scale Up

TransGAN: Two Pure Transformers Can Make One Strong GAN, and That Can Scale Up

14 Feb 2021NeurIPS 2021 12arXiv:2102.07074archive 2025-07-28

Yifan Jiang, Shiyu Chang, Zhangyang Wang

The recent explosive interest on transformers has suggested their potential to become powerful "universal" models for computer vision tasks, such as classification, detection, and segmentation. While those attempts mainly study the discriminative models, we explore transformers on some more notoriously difficult vision tasks, e.g., generative adversarial networks (GANs). Our goal is to conduct the first pilot study in building a GAN completely free of convolutions, using only pure transformer-based architectures. Our vanilla GAN architecture, dubbed TransGAN, consists of a memory-friendly transformer-based generator that progressively increases feature resolution, and correspondingly a multi-scale discriminator to capture simultaneously semantic contexts and low-level textures. On top of them, we introduce the new module of grid self-attention for alleviating the memory bottleneck further, in order to scale up TransGAN to high-resolution generation. We also develop a unique training recipe including a series of techniques that can mitigate the training instability issues of TransGAN, such as data augmentation, modified normalization, and relative position encoding. Our best architecture achieves highly competitive performance compared to current state-of-the-art GANs using convolutional backbones. Specifically, TransGAN sets new state-of-the-art inception score of 10.43 and FID of 18.28 on STL-10, outperforming StyleGAN-V2. When it comes to higher-resolution (e.g. 256 x 256) generation tasks, such as on CelebA-HQ and LSUN-Church, TransGAN continues to produce diverse visual examples with high fidelity and impressive texture details. In addition, we dive deep into the transformer-based generation models to understand how their behaviors differ from convolutional ones, by visualizing training dynamics. The code is available at https://github.com/VITA-Group/TransGAN.

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="2102.07074")

Code

Syntology Ran 8 of 8 code samples harvested from 3 repositories linked to this paper; 0 have no recorded run. Of those that ran: 2 ran · violated contract; 4 ran · our draft was wrong; 2 ran · fixture could not drive it.

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

VITA-Group/TransGAN officialmentioned in papermentioned on GitHubpytorch report
0xzayd/transformer-GAN mentioned on GitHubpytorch report
asarigun/MixerGANsformer mentioned on GitHubpytorch report
asarigun/TransGAN mentioned on GitHubpytorch report
hungtrankhanh/CS5260_project mentioned on GitHubpytorch report
lucidrains/transganformer mentioned on GitHubpytorch report
milmor/TransGAN mentioned on GitHubtf report
omihub777/vit-cifar mentioned on GitHubpytorch 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

8 samples harvested; 8 ran; 0 honoured the contract we drafted; 0 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.

2ran · violated contract
4ran · our draft was wrong
2ran · fixture could not drive it

Licence: 7 of the 8 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 3 repositories linked to this paper, official or community; each sample names its own and says which. Some samples are identical code Syntology first harvested from another repository; for those, this paper's copy is not located and its licence is not recorded. “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.

UpSampling asarigun/TransGAN/models.py community (archive-listed) ran · our draft was wrong MIT (permissive) · 399c4e0c0bf77fb5 · report
calculate_frechet_distance dsorge3/eeg_visual_classification_project/utils/fid_score.py community (archive-listed) ran · fixture could not drive it licence not identified · pointer only · 7b15399f0ed06269 · report
gelu hungtrankhanh/CS5260_project/models/TransGAN_8_8_1.py community (archive-listed) ran · our draft was wrong fingerprinted licence not identified · pointer only · 6a9faa89f4d1a831 · report
get_attn_mask hungtrankhanh/CS5260_project/models/TransGAN_8_8_1.py community (archive-listed) ran · fixture could not drive it licence not identified · pointer only · 6b6b6f726f8ac029 · report
pixel_upsample hungtrankhanh/CS5260_project/models/TransGAN_8_8_1.py community (archive-listed) ran · our draft was wrong licence not identified · pointer only · 9fadd038ce88c830 · report
combine_contexts identical code first harvested elsewhere ran · our draft was wrong licence of this copy not recorded · 85f67e8fb251251f · report
default identical code first harvested elsewhere ran · violated contract fingerprinted licence of this copy not recorded · 60fff7c3c400d7ff · report
exists identical code first harvested elsewhere ran · violated contract licence of this copy not recorded · aa5486a3650902d8 · report

Tasks

Data AugmentationImage Generation

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Image Generation CelebA 64x64 TransGAN-XL FID 12.23 #28 of 39 Archive leaderboard report
Image Generation LSUN Churches 256 x 256 TransGAN FID 8.94 #24 of 27 Archive leaderboard report
Image Generation STL-10 TransGAN FID 18.28 #14 of 31 Archive leaderboard report
Image Generation STL-10 TransGAN Inception score 10.43 #14 of 31 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.

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