{"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/transformer-based-conditional-variational","title":"Transformer-based Conditional Variational Autoencoder for Controllable Story Generation","arxiv_id":"2101.00828","date":"2021-01-04","proceeding":null,"authors":["Le Fang","Tao Zeng","Chaochun Liu","Liefeng Bo","Wen Dong","Changyou Chen"],"abstract":"We investigate large-scale latent variable models (LVMs) for neural story generation -- an under-explored application for open-domain long text -- with objectives in two threads: generation effectiveness and controllability. LVMs, especially the variational autoencoder (VAE), have achieved both effective and controllable generation through exploiting flexible distributional latent representations. Recently, Transformers and its variants have achieved remarkable effectiveness without explicit latent representation learning, thus lack satisfying controllability in generation. In this paper, we advocate to revive latent variable modeling, essentially the power of representation learning, in the era of Transformers to enhance controllability without hurting state-of-the-art generation effectiveness. Specifically, we integrate latent representation vectors with a Transformer-based pre-trained architecture to build conditional variational autoencoder (CVAE). Model components such as encoder, decoder and the variational posterior are all built on top of pre-trained language models -- GPT2 specifically in this paper. Experiments demonstrate state-of-the-art conditional generation ability of our model, as well as its excellent representation learning capability and controllability.","url_abs":"https://arxiv.org/abs/2101.00828v2","url_pdf":"https://arxiv.org/pdf/2101.00828v2.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":"transformer-based-conditional-variational","repo_url":"https://github.com/fangleai/TransformerCVAE","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"transformer-based-conditional-variational","repo_url":"https://github.com/20000607-lxc/TransformerCVAE-master","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"unanswered"}}],"tasks":[{"task_slug":"decoder","task_name":"Decoder"},{"task_slug":"representation-learning","task_name":"Representation Learning"},{"task_slug":"story-generation","task_name":"Story Generation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2101.00828","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2101.00828"}},"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":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/fangleai/TransformerCVAE","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/20000607-lxc/TransformerCVAE-master","reach":{"status":"unanswered"}}],"summary":{"ran_draft_wrong":4,"unverified":1},"by_repo_kind":{"official":{"samples":5,"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":5,"samples":[{"code_sha256_prefix":"a0d28893b7a128bf","entry":"compute_loss","repo":"fangleai/TransformerCVAE","repo_kind":"official","path":"eval_ppl.py","file_url":"https://github.com/fangleai/TransformerCVAE/blob/HEAD/eval_ppl.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a0d28893b7a128bf"}},{"code_sha256_prefix":"4a1118902f82a8f0","entry":"compute_loss_ae","repo":"fangleai/TransformerCVAE","repo_kind":"official","path":"eval_ppl.py","file_url":"https://github.com/fangleai/TransformerCVAE/blob/HEAD/eval_ppl.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4a1118902f82a8f0"}},{"code_sha256_prefix":"392539b5cc6f39e7","entry":"repeat_score","repo":"fangleai/TransformerCVAE","repo_kind":"official","path":"generate.py","file_url":"https://github.com/fangleai/TransformerCVAE/blob/HEAD/generate.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"392539b5cc6f39e7"}},{"code_sha256_prefix":"ba251e053dfad9ce","entry":"sample_sequence","repo":"fangleai/TransformerCVAE","repo_kind":"official","path":"generate.py","file_url":"https://github.com/fangleai/TransformerCVAE/blob/HEAD/generate.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ba251e053dfad9ce"}},{"code_sha256_prefix":"a8f76faa252a6539","entry":"top_k_top_p_filtering","repo":"fangleai/TransformerCVAE","repo_kind":"official","path":"generate.py","file_url":"https://github.com/fangleai/TransformerCVAE/blob/HEAD/generate.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a8f76faa252a6539"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}