{"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/z-forcing-training-stochastic-recurrent","title":"Z-Forcing: Training Stochastic Recurrent Networks","arxiv_id":"1711.05411","date":"2017-11-15","proceeding":"NeurIPS 2017 12","authors":["Anirudh Goyal","Alessandro Sordoni","Marc-Alexandre Côté","Nan Rosemary Ke","Yoshua Bengio"],"abstract":"Many efforts have been devoted to training generative latent variable models\nwith autoregressive decoders, such as recurrent neural networks (RNN).\nStochastic recurrent models have been successful in capturing the variability\nobserved in natural sequential data such as speech. We unify successful ideas\nfrom recently proposed architectures into a stochastic recurrent model: each\nstep in the sequence is associated with a latent variable that is used to\ncondition the recurrent dynamics for future steps. Training is performed with\namortized variational inference where the approximate posterior is augmented\nwith a RNN that runs backward through the sequence. In addition to maximizing\nthe variational lower bound, we ease training of the latent variables by adding\nan auxiliary cost which forces them to reconstruct the state of the backward\nrecurrent network. This provides the latent variables with a task-independent\nobjective that enhances the performance of the overall model. We found this\nstrategy to perform better than alternative approaches such as KL annealing.\nAlthough being conceptually simple, our model achieves state-of-the-art results\non standard speech benchmarks such as TIMIT and Blizzard and competitive\nperformance on sequential MNIST. Finally, we apply our model to language\nmodeling on the IMDB dataset where the auxiliary cost helps in learning\ninterpretable latent variables. Source Code:\n\\url{https://github.com/anirudh9119/zforcing_nips17}","url_abs":"http://arxiv.org/abs/1711.05411v2","url_pdf":"http://arxiv.org/pdf/1711.05411v2.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":"z-forcing-training-stochastic-recurrent","repo_url":"https://github.com/anirudh9119/zforcing_nips17","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"variational-inference","task_name":"Variational Inference"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1711.05411","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1711.05411"}},"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/anirudh9119/zforcing_nips17","reach":null}],"summary":{"ran_honours":1,"ran_fixture":1,"unverified":3},"by_repo_kind":{"official":{"samples":5,"ran":2,"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":"719e6e89b87dad48","entry":"gaussian_kld","repo":"anirudh9119/zforcing_nips17","repo_kind":"official","path":"model.py","file_url":"https://github.com/anirudh9119/zforcing_nips17/blob/HEAD/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"719e6e89b87dad48"}},{"code_sha256_prefix":"6085c9a3c256c9fd","entry":"log_prob_gaussian","repo":"anirudh9119/zforcing_nips17","repo_kind":"official","path":"model.py","file_url":"https://github.com/anirudh9119/zforcing_nips17/blob/HEAD/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6085c9a3c256c9fd"}},{"code_sha256_prefix":"aece41ebf23011df","entry":"evaluate","repo":"anirudh9119/zforcing_nips17","repo_kind":"official","path":"train_timit.py","file_url":"https://github.com/anirudh9119/zforcing_nips17/blob/HEAD/train_timit.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":"aece41ebf23011df"}},{"code_sha256_prefix":"0d5dcce002c7d0e7","entry":"evaluate","repo":"anirudh9119/zforcing_nips17","repo_kind":"official","path":"train_blizzard.py","file_url":"https://github.com/anirudh9119/zforcing_nips17/blob/HEAD/train_blizzard.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":"0d5dcce002c7d0e7"}},{"code_sha256_prefix":"a55f25173e59eb5b","entry":"log_prob_bernoulli","repo":"anirudh9119/zforcing_nips17","repo_kind":"official","path":"model.py","file_url":"https://github.com/anirudh9119/zforcing_nips17/blob/HEAD/model.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":"a55f25173e59eb5b"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}