{"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/diverse-text-generation-via-variational","title":"Diverse Text Generation via Variational Encoder-Decoder Models with Gaussian Process Priors","arxiv_id":"2204.01227","date":"2022-04-04","proceeding":null,"authors":["Wanyu Du","Jianqiao Zhao","LiWei Wang","Yangfeng Ji"],"abstract":"Generating high quality texts with high diversity is important for many NLG applications, but current methods mostly focus on building deterministic models to generate higher quality texts and do not provide many options for promoting diversity. In this work, we present a novel latent structured variable model to generate high quality texts by enriching contextual representation learning of encoder-decoder models. Specifically, we introduce a stochastic function to map deterministic encoder hidden states into random context variables. The proposed stochastic function is sampled from a Gaussian process prior to (1) provide infinite number of joint Gaussian distributions of random context variables (diversity-promoting) and (2) explicitly model dependency between context variables (accurate-encoding). To address the learning challenge of Gaussian processes, we propose an efficient variational inference approach to approximate the posterior distribution of random context variables. We evaluate our method in two typical text generation tasks: paraphrase generation and text style transfer. Experimental results on benchmark datasets demonstrate that our method improves the generation quality and diversity compared with other baselines.","url_abs":"https://arxiv.org/abs/2204.01227v1","url_pdf":"https://arxiv.org/pdf/2204.01227v1.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":"diverse-text-generation-via-variational","repo_url":"https://github.com/wyu-du/gp-vae","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"decoder","task_name":"Decoder"},{"task_slug":"diversity","task_name":"Diversity"},{"task_slug":"gaussian-processes","task_name":"Gaussian Processes"},{"task_slug":"paraphrase-generation","task_name":"Paraphrase Generation"},{"task_slug":"representation-learning","task_name":"Representation Learning"},{"task_slug":"style-transfer","task_name":"Style Transfer"},{"task_slug":"text-generation","task_name":"Text Generation"},{"task_slug":"text-style-transfoer","task_name":"Text Style Transfer"},{"task_slug":"variational-inference","task_name":"Variational Inference"}],"methods":[{"method_slug":"gaussian-process","method_name":"Gaussian Process"},{"method_slug":"variational-inference","method_name":"Variational Inference"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2204.01227","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2204.01227"}},"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/wyu-du/gp-vae","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"unverified":5},"by_repo_kind":{"official":{"samples":5,"ran":0,"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":"d15ef235457ba9f5","entry":"construct_input_for_batch","repo":"wyu-du/gp-vae","repo_kind":"official","path":"models/t5/utils.py","file_url":"https://github.com/wyu-du/gp-vae/blob/HEAD/models/t5/utils.py","link_basis":"harvester_set","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":"d15ef235457ba9f5"}},{"code_sha256_prefix":"f145cea183a02846","entry":"evaluate","repo":"wyu-du/gp-vae","repo_kind":"official","path":"models/pg/training.py","file_url":"https://github.com/wyu-du/gp-vae/blob/HEAD/models/pg/training.py","link_basis":"harvester_set","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":"f145cea183a02846"}},{"code_sha256_prefix":"0fa184670e96ee9b","entry":"kl_anneal_weight","repo":"wyu-du/gp-vae","repo_kind":"official","path":"models/pg/utils.py","file_url":"https://github.com/wyu-du/gp-vae/blob/HEAD/models/pg/utils.py","link_basis":"harvester_set","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":"0fa184670e96ee9b"}},{"code_sha256_prefix":"54cd3d08a29ec251","entry":"make_batch_inputs","repo":"wyu-du/gp-vae","repo_kind":"official","path":"models/t5/utils.py","file_url":"https://github.com/wyu-du/gp-vae/blob/HEAD/models/t5/utils.py","link_basis":"harvester_set","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":"54cd3d08a29ec251"}},{"code_sha256_prefix":"5a0e39bae457be59","entry":"parse_data","repo":"wyu-du/gp-vae","repo_kind":"official","path":"models/t5/utils.py","file_url":"https://github.com/wyu-du/gp-vae/blob/HEAD/models/t5/utils.py","link_basis":"harvester_set","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":"5a0e39bae457be59"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}