{"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/consistency-regularization-for-variational","title":"Consistency Regularization for Variational Auto-Encoders","arxiv_id":"2105.14859","date":"2021-05-31","proceeding":"NeurIPS 2021 12","authors":["Samarth Sinha","Adji B. Dieng"],"abstract":"Variational auto-encoders (VAEs) are a powerful approach to unsupervised learning. They enable scalable approximate posterior inference in latent-variable models using variational inference (VI). A VAE posits a variational family parameterized by a deep neural network called an encoder that takes data as input. This encoder is shared across all the observations, which amortizes the cost of inference. However the encoder of a VAE has the undesirable property that it maps a given observation and a semantics-preserving transformation of it to different latent representations. This \"inconsistency\" of the encoder lowers the quality of the learned representations, especially for downstream tasks, and also negatively affects generalization. In this paper, we propose a regularization method to enforce consistency in VAEs. The idea is to minimize the Kullback-Leibler (KL) divergence between the variational distribution when conditioning on the observation and the variational distribution when conditioning on a random semantic-preserving transformation of this observation. This regularization is applicable to any VAE. In our experiments we apply it to four different VAE variants on several benchmark datasets and found it always improves the quality of the learned representations but also leads to better generalization. In particular, when applied to the Nouveau Variational Auto-Encoder (NVAE), our regularization method yields state-of-the-art performance on MNIST and CIFAR-10. We also applied our method to 3D data and found it learns representations of superior quality as measured by accuracy on a downstream classification task.","url_abs":"https://arxiv.org/abs/2105.14859v2","url_pdf":"https://arxiv.org/pdf/2105.14859v2.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":"consistency-regularization-for-variational","repo_url":"https://github.com/sinhasam/crvae","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"image-generation","task_name":"Image Generation"},{"task_slug":"variational-inference","task_name":"Variational Inference"}],"methods":[{"method_slug":"variational-inference","method_name":"Variational Inference"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/image-generation-on-binarized-mnist","task":"Image Generation","dataset":"Binarized MNIST","model":"CR-NVAE","rank_in_archive_order":1,"of":10,"metrics":{"nats":"76.93"},"uses_additional_data":false},{"leaderboard":"/sota/image-generation-on-celeba-64x64","task":"Image Generation","dataset":"CelebA 64x64","model":"CR-NVAE","rank_in_archive_order":37,"of":39,"metrics":{"bits/dimension":"1.86"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2105.14859","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2105.14859"}},"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/sinhasam/crvae","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":3},"by_repo_kind":{"official":{"samples":3,"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":"ef29c3439e7dd6ef","entry":"cr_loss","repo":"sinhasam/crvae","repo_kind":"official","path":"CRVAE/losses.py","file_url":"https://github.com/sinhasam/crvae/blob/HEAD/CRVAE/losses.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ef29c3439e7dd6ef"}},{"code_sha256_prefix":"1dd5ea0b99a78c1f","entry":"elbo_loss","repo":"sinhasam/crvae","repo_kind":"official","path":"CRVAE/losses.py","file_url":"https://github.com/sinhasam/crvae/blob/HEAD/CRVAE/losses.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1dd5ea0b99a78c1f"}},{"code_sha256_prefix":"1a7c7df34fb7edbc","entry":"get_augmentation","repo":"sinhasam/crvae","repo_kind":"official","path":"CRVAE/augmentations.py","file_url":"https://github.com/sinhasam/crvae/blob/HEAD/CRVAE/augmentations.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1a7c7df34fb7edbc"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}