{"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/cogview2-faster-and-better-text-to-image","title":"CogView2: Faster and Better Text-to-Image Generation via Hierarchical Transformers","arxiv_id":"2204.14217","date":"2022-04-28","proceeding":null,"authors":["Ming Ding","Wendi Zheng","Wenyi Hong","Jie Tang"],"abstract":"The development of the transformer-based text-to-image models are impeded by its slow generation and complexity for high-resolution images. In this work, we put forward a solution based on hierarchical transformers and local parallel auto-regressive generation. We pretrain a 6B-parameter transformer with a simple and flexible self-supervised task, Cross-modal general language model (CogLM), and finetune it for fast super-resolution. The new text-to-image system, CogView2, shows very competitive generation compared to concurrent state-of-the-art DALL-E-2, and naturally supports interactive text-guided editing on images.","url_abs":"https://arxiv.org/abs/2204.14217v2","url_pdf":"https://arxiv.org/pdf/2204.14217v2.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":"cogview2-faster-and-better-text-to-image","repo_url":"https://github.com/thudm/cogview2","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"image-generation","task_name":"Image Generation"},{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"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"}],"methods":[],"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":"CogView2(6B, Finetuned)","rank_in_archive_order":42,"of":69,"metrics":{"FID":"17.7"},"uses_additional_data":false},{"leaderboard":"/sota/text-to-image-generation-on-coco","task":"Text-to-Image Generation","dataset":"COCO (Common Objects in Context)","model":"CogView2(6B, Finetuned)","rank_in_archive_order":49,"of":69,"metrics":{"FID":"24"},"uses_additional_data":false}],"syntology":{"syntology_url":"https://syntology.ai/paper/2204.14217","atlas_url":"https://app.syntology.ai/?focus=2204.14217","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2204.14217"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/thudm/cogview2","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":8},"by_repo_kind":{"official":{"samples":8,"ran":8,"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":"a118f3203af4dd9a","entry":"adapt_to_style","repo":"thudm/cogview2","repo_kind":"official","path":"predict.py","file_url":"https://github.com/thudm/cogview2/blob/HEAD/predict.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a118f3203af4dd9a"}},{"code_sha256_prefix":"2fa3b41ba17c8001","entry":"get_masks_and_position_ids_coglm","repo":"thudm/cogview2","repo_kind":"official","path":"cogview2_completion.py","file_url":"https://github.com/thudm/cogview2/blob/HEAD/cogview2_completion.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2fa3b41ba17c8001"}},{"code_sha256_prefix":"e8897b6ec39c6011","entry":"get_masks_and_position_ids_comp","repo":"thudm/cogview2","repo_kind":"official","path":"comp_pipeline/base_completion.py","file_url":"https://github.com/thudm/cogview2/blob/HEAD/comp_pipeline/base_completion.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e8897b6ec39c6011"}},{"code_sha256_prefix":"397223b503ebad3d","entry":"get_recipe","repo":"thudm/cogview2","repo_kind":"official","path":"cogview2_completion.py","file_url":"https://github.com/thudm/cogview2/blob/HEAD/cogview2_completion.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"397223b503ebad3d"}},{"code_sha256_prefix":"3e675b963748514d","entry":"get_recipe","repo":"thudm/cogview2","repo_kind":"official","path":"cogview2_text2image.py","file_url":"https://github.com/thudm/cogview2/blob/HEAD/cogview2_text2image.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"3e675b963748514d"}},{"code_sha256_prefix":"bb0943b69ad212ca","entry":"make_text_understanding","repo":"thudm/cogview2","repo_kind":"official","path":"pretrain_coglm.py","file_url":"https://github.com/thudm/cogview2/blob/HEAD/pretrain_coglm.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"bb0943b69ad212ca"}},{"code_sha256_prefix":"5825bfe57509ed97","entry":"top_k_logits","repo":"thudm/cogview2","repo_kind":"official","path":"coglm_strategy.py","file_url":"https://github.com/thudm/cogview2/blob/HEAD/coglm_strategy.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5825bfe57509ed97"}},{"code_sha256_prefix":"5937f3082aa9e72e","entry":"top_k_logits_","repo":"thudm/cogview2","repo_kind":"official","path":"sr_pipeline/dsr_sampling.py","file_url":"https://github.com/thudm/cogview2/blob/HEAD/sr_pipeline/dsr_sampling.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5937f3082aa9e72e"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}