{"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/any-variational-autoencoder-can-do-arbitrary","title":"Posterior Matching for Arbitrary Conditioning","arxiv_id":"2201.12414","date":"2022-01-28","proceeding":null,"authors":["Ryan R. Strauss","Junier B. Oliva"],"abstract":"Arbitrary conditioning is an important problem in unsupervised learning, where we seek to model the conditional densities $p(\\mathbf{x}_u \\mid \\mathbf{x}_o)$ that underly some data, for all possible non-intersecting subsets $o, u \\subset \\{1, \\dots , d\\}$. However, the vast majority of density estimation only focuses on modeling the joint distribution $p(\\mathbf{x})$, in which important conditional dependencies between features are opaque. We propose a simple and general framework, coined Posterior Matching, that enables Variational Autoencoders (VAEs) to perform arbitrary conditioning, without modification to the VAE itself. Posterior Matching applies to the numerous existing VAE-based approaches to joint density estimation, thereby circumventing the specialized models required by previous approaches to arbitrary conditioning. We find that Posterior Matching is comparable or superior to current state-of-the-art methods for a variety of tasks with an assortment of VAEs (e.g.~discrete, hierarchical, VaDE).","url_abs":"https://arxiv.org/abs/2201.12414v4","url_pdf":"https://arxiv.org/pdf/2201.12414v4.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":"any-variational-autoencoder-can-do-arbitrary","repo_url":"https://github.com/lupalab/posterior-matching","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"jax","reach":null}],"tasks":[{"task_slug":"density-estimation","task_name":"Density Estimation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2201.12414","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2201.12414"}},"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":"deterministic:regex_extraction","url":"https://github.com/lupalab/posterior-matching","reach":null},{"provenance":"deterministic:regex_extraction","url":"https://github.com/deepmind/dm-haiku","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/openai/vdvae","reach":null}],"summary":{"ran_draft_wrong":3,"unverified":23},"by_repo_kind":{"official":{"samples":10,"ran":1,"repositories":1},"found_in_text":{"samples":14,"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":12,"samples":[{"code_sha256_prefix":"9419abf027f0115d","entry":"get_width_settings","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"9419abf027f0115d"}},{"code_sha256_prefix":"10fcb117ffee5145","entry":"pad_channels","repo":"lupalab/posterior-matching","repo_kind":"official","path":"posterior_matching/models/vdvae.py","file_url":"https://github.com/lupalab/posterior-matching/blob/HEAD/posterior_matching/models/vdvae.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"10fcb117ffee5145"}},{"code_sha256_prefix":"95d3df9fe1921426","entry":"parse_layer_string","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"95d3df9fe1921426"}},{"code_sha256_prefix":"4086bb07fed39601","entry":"Block","repo":"lupalab/posterior-matching","repo_kind":"official","path":"posterior_matching/models/vdvae.py","file_url":"https://github.com/lupalab/posterior-matching/blob/HEAD/posterior_matching/models/vdvae.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":"4086bb07fed39601"}},{"code_sha256_prefix":"701b897fce8a34e9","entry":"Encoder","repo":"lupalab/posterior-matching","repo_kind":"official","path":"posterior_matching/models/vdvae.py","file_url":"https://github.com/lupalab/posterior-matching/blob/HEAD/posterior_matching/models/vdvae.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":"701b897fce8a34e9"}},{"code_sha256_prefix":"a42f907e5c7b7a4d","entry":"LogisticMixture","repo":"lupalab/posterior-matching","repo_kind":"official","path":"posterior_matching/models/vdvae.py","file_url":"https://github.com/lupalab/posterior-matching/blob/HEAD/posterior_matching/models/vdvae.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":"a42f907e5c7b7a4d"}},{"code_sha256_prefix":"b0f8e415415e8379","entry":"PosteriorMatchingDecoder","repo":"lupalab/posterior-matching","repo_kind":"official","path":"posterior_matching/models/vdvae.py","file_url":"https://github.com/lupalab/posterior-matching/blob/HEAD/posterior_matching/models/vdvae.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":"b0f8e415415e8379"}},{"code_sha256_prefix":"18273b05e6809fa2","entry":"PosteriorMatchingDecoderBlock","repo":"lupalab/posterior-matching","repo_kind":"official","path":"posterior_matching/models/vdvae.py","file_url":"https://github.com/lupalab/posterior-matching/blob/HEAD/posterior_matching/models/vdvae.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":"18273b05e6809fa2"}},{"code_sha256_prefix":"6e0c276984d84108","entry":"PosteriorMatchingVDVAE","repo":"lupalab/posterior-matching","repo_kind":"official","path":"posterior_matching/models/vdvae.py","file_url":"https://github.com/lupalab/posterior-matching/blob/HEAD/posterior_matching/models/vdvae.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":"6e0c276984d84108"}},{"code_sha256_prefix":"00c1496a0adf1aa4","entry":"_LogisticMixtureDist","repo":"lupalab/posterior-matching","repo_kind":"official","path":"posterior_matching/models/vdvae.py","file_url":"https://github.com/lupalab/posterior-matching/blob/HEAD/posterior_matching/models/vdvae.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":"00c1496a0adf1aa4"}},{"code_sha256_prefix":"dcfe042d53ba91db","entry":"calculate_bias_shape","repo":"deepmind/dm-haiku","repo_kind":"found_in_text","path":"haiku/_src/bias.py","file_url":"https://github.com/deepmind/dm-haiku/blob/HEAD/haiku/_src/bias.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":"dcfe042d53ba91db"}},{"code_sha256_prefix":"60d1392c43f39704","entry":"check_jax_usage","repo":"deepmind/dm-haiku","repo_kind":"found_in_text","path":"haiku/_src/config.py","file_url":"https://github.com/deepmind/dm-haiku/blob/HEAD/haiku/_src/config.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":"60d1392c43f39704"}},{"code_sha256_prefix":"3dcc91ac4323976a","entry":"check_not_none","repo":"deepmind/dm-haiku","repo_kind":"found_in_text","path":"haiku/_src/base.py","file_url":"https://github.com/deepmind/dm-haiku/blob/HEAD/haiku/_src/base.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":"3dcc91ac4323976a"}},{"code_sha256_prefix":"6a0640e81b20a064","entry":"compute_adjusted_padding","repo":"deepmind/dm-haiku","repo_kind":"found_in_text","path":"haiku/_src/conv.py","file_url":"https://github.com/deepmind/dm-haiku/blob/HEAD/haiku/_src/conv.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":"6a0640e81b20a064"}},{"code_sha256_prefix":"93ec9c5f4286cbf7","entry":"get_1x1","repo":"lupalab/posterior-matching","repo_kind":"official","path":"posterior_matching/models/vdvae.py","file_url":"https://github.com/lupalab/posterior-matching/blob/HEAD/posterior_matching/models/vdvae.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":"93ec9c5f4286cbf7"}},{"code_sha256_prefix":"aa70735ae381c2da","entry":"get_3x3","repo":"lupalab/posterior-matching","repo_kind":"official","path":"posterior_matching/models/vdvae.py","file_url":"https://github.com/lupalab/posterior-matching/blob/HEAD/posterior_matching/models/vdvae.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":"aa70735ae381c2da"}},{"code_sha256_prefix":"533c7323fed6b625","entry":"module_auto_repr","repo":"deepmind/dm-haiku","repo_kind":"found_in_text","path":"haiku/_src/config.py","file_url":"https://github.com/deepmind/dm-haiku/blob/HEAD/haiku/_src/config.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":"533c7323fed6b625"}},{"code_sha256_prefix":"c2aac7a3368f16d4","entry":"multinomial","repo":"deepmind/dm-haiku","repo_kind":"found_in_text","path":"haiku/_src/basic.py","file_url":"https://github.com/deepmind/dm-haiku/blob/HEAD/haiku/_src/basic.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":"c2aac7a3368f16d4"}},{"code_sha256_prefix":"71a177ba7a67e972","entry":"ndim_at_least","repo":"deepmind/dm-haiku","repo_kind":"found_in_text","path":"haiku/_src/basic.py","file_url":"https://github.com/deepmind/dm-haiku/blob/HEAD/haiku/_src/basic.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":"71a177ba7a67e972"}},{"code_sha256_prefix":"f6f51ced321b0151","entry":"one_hot","repo":"deepmind/dm-haiku","repo_kind":"found_in_text","path":"haiku/_src/basic.py","file_url":"https://github.com/deepmind/dm-haiku/blob/HEAD/haiku/_src/basic.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":"f6f51ced321b0151"}},{"code_sha256_prefix":"de4b41a490b3f147","entry":"rng_reserve_size","repo":"deepmind/dm-haiku","repo_kind":"found_in_text","path":"haiku/_src/config.py","file_url":"https://github.com/deepmind/dm-haiku/blob/HEAD/haiku/_src/config.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":"de4b41a490b3f147"}},{"code_sha256_prefix":"9fb0c6433beb4e20","entry":"safe_get_module_name","repo":"deepmind/dm-haiku","repo_kind":"found_in_text","path":"haiku/_src/base.py","file_url":"https://github.com/deepmind/dm-haiku/blob/HEAD/haiku/_src/base.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":"9fb0c6433beb4e20"}},{"code_sha256_prefix":"d53951146fe6a788","entry":"to_dimension_numbers","repo":"deepmind/dm-haiku","repo_kind":"found_in_text","path":"haiku/_src/conv.py","file_url":"https://github.com/deepmind/dm-haiku/blob/HEAD/haiku/_src/conv.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":"d53951146fe6a788"}},{"code_sha256_prefix":"93a365e0dfc01f8c","entry":"to_haiku_dict","repo":"deepmind/dm-haiku","repo_kind":"found_in_text","path":"haiku/_src/data_structures.py","file_url":"https://github.com/deepmind/dm-haiku/blob/HEAD/haiku/_src/data_structures.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":"93a365e0dfc01f8c"}},{"code_sha256_prefix":"96c9cc45cd31b59c","entry":"to_immutable_dict","repo":"deepmind/dm-haiku","repo_kind":"found_in_text","path":"haiku/_src/data_structures.py","file_url":"https://github.com/deepmind/dm-haiku/blob/HEAD/haiku/_src/data_structures.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":"96c9cc45cd31b59c"}},{"code_sha256_prefix":"dce7b6e14066c25e","entry":"to_mutable_dict","repo":"deepmind/dm-haiku","repo_kind":"found_in_text","path":"haiku/_src/data_structures.py","file_url":"https://github.com/deepmind/dm-haiku/blob/HEAD/haiku/_src/data_structures.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":"dce7b6e14066c25e"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}