{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/cogview-mastering-text-to-image-generation","title":"CogView: Mastering Text-to-Image Generation via Transformers","arxiv_id":"2105.13290","date":"2021-05-26","proceeding":"NeurIPS 2021 12","authors":["Ming Ding","Zhuoyi Yang","Wenyi Hong","Wendi Zheng","Chang Zhou","Da Yin","Junyang Lin","Xu Zou","Zhou Shao","Hongxia Yang","Jie Tang"],"abstract":"Text-to-Image generation in the general domain has long been an open problem, which requires both a powerful generative model and cross-modal understanding. We propose CogView, a 4-billion-parameter Transformer with VQ-VAE tokenizer to advance this problem. We also demonstrate the finetuning strategies for various downstream tasks, e.g. style learning, super-resolution, text-image ranking and fashion design, and methods to stabilize pretraining, e.g. eliminating NaN losses. CogView achieves the state-of-the-art FID on the blurred MS COCO dataset, outperforming previous GAN-based models and a recent similar work DALL-E.","url_abs":"https://arxiv.org/abs/2105.13290v3","url_pdf":"https://arxiv.org/pdf/2105.13290v3.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"cogview-mastering-text-to-image-generation","repo_url":"https://github.com/THUDM/CogView","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"cogview-mastering-text-to-image-generation","repo_url":"https://github.com/JunnYu/x-transformers-paddle","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"jax","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"cogview-mastering-text-to-image-generation","repo_url":"https://github.com/thudm/cogview2","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"cogview-mastering-text-to-image-generation","repo_url":"https://github.com/thudm/visualglm-6b","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"image-generation","task_name":"Image Generation"},{"task_slug":"super-resolution","task_name":"Super-Resolution"},{"task_slug":"text-to-image-generation-1","task_name":"Text to Image Generation"},{"task_slug":"text-to-image-generation","task_name":"Text-to-Image Generation"},{"task_slug":"zero-shot-text-to-image-generation","task_name":"Zero-Shot Text-to-Image Generation"}],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"},{"method_slug":"vq-vae","method_name":"VQ-VAE"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/text-to-image-generation-on-coco","task":"Text-to-Image Generation","dataset":"COCO (Common Objects in Context)","model":"CogView","rank_in_archive_order":53,"of":69,"metrics":{"FID":"27.1","FID-1":"19.4","FID-2":"13.9","FID-4":"19.4","FID-8":"23.6","Inception score":"18.2"},"uses_additional_data":true}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2105.13290","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2105.13290"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"deterministic:regex_extraction","url":"https://github.com/google/sentencepiece","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/thudm/cogview2","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/JunnYu/x-transformers-paddle","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/thudm/visualglm-6b","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/THUDM/CogView","reach":null}],"summary":{"ran":3,"ran_fixture":1,"unverified":2},"by_repo_kind":{"official":{"samples":6,"ran":4,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"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"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"53e3098c733174fa","entry":"Decoder","repo":"THUDM/CogView","repo_kind":"official","path":"vqvae/vqvae_zc.py","file_url":"https://github.com/THUDM/CogView/blob/HEAD/vqvae/vqvae_zc.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"53e3098c733174fa"}},{"code_sha256_prefix":"0461c74c5c0064d7","entry":"Encoder","repo":"THUDM/CogView","repo_kind":"official","path":"vqvae/vqvae_zc.py","file_url":"https://github.com/THUDM/CogView/blob/HEAD/vqvae/vqvae_zc.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0461c74c5c0064d7"}},{"code_sha256_prefix":"35e92eea2aef1aa8","entry":"ResBlock","repo":"THUDM/CogView","repo_kind":"official","path":"vqvae/vqvae_zc.py","file_url":"https://github.com/THUDM/CogView/blob/HEAD/vqvae/vqvae_zc.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"35e92eea2aef1aa8"}},{"code_sha256_prefix":"ecf5254f4cf87fef","entry":"gumbel_softmax","repo":"THUDM/CogView","repo_kind":"official","path":"vqvae/vqvae_zc.py","file_url":"https://github.com/THUDM/CogView/blob/HEAD/vqvae/vqvae_zc.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ecf5254f4cf87fef"}},{"code_sha256_prefix":"687bcd3449f0d286","entry":"Quantize","repo":"THUDM/CogView","repo_kind":"official","path":"vqvae/vqvae_zc.py","file_url":"https://github.com/THUDM/CogView/blob/HEAD/vqvae/vqvae_zc.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"687bcd3449f0d286"}},{"code_sha256_prefix":"abe55b2ef91d5da8","entry":"VQVAE","repo":"THUDM/CogView","repo_kind":"official","path":"vqvae/vqvae_zc.py","file_url":"https://github.com/THUDM/CogView/blob/HEAD/vqvae/vqvae_zc.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"abe55b2ef91d5da8"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}