{"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/hierarchical-vaes-know-what-they-don-t-know","title":"Hierarchical VAEs Know What They Don't Know","arxiv_id":"2102.08248","date":"2021-02-16","proceeding":null,"authors":["Jakob D. Havtorn","Jes Frellsen","Søren Hauberg","Lars Maaløe"],"abstract":"Deep generative models have been demonstrated as state-of-the-art density estimators. Yet, recent work has found that they often assign a higher likelihood to data from outside the training distribution. This seemingly paradoxical behavior has caused concerns over the quality of the attained density estimates. In the context of hierarchical variational autoencoders, we provide evidence to explain this behavior by out-of-distribution data having in-distribution low-level features. We argue that this is both expected and desirable behavior. With this insight in hand, we develop a fast, scalable and fully unsupervised likelihood-ratio score for OOD detection that requires data to be in-distribution across all feature-levels. We benchmark the method on a vast set of data and model combinations and achieve state-of-the-art results on out-of-distribution detection.","url_abs":"https://arxiv.org/abs/2102.08248v7","url_pdf":"https://arxiv.org/pdf/2102.08248v7.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":"hierarchical-vaes-know-what-they-don-t-know","repo_url":"https://github.com/JakobHavtorn/hvae-oodd","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"hierarchical-vaes-know-what-they-don-t-know","repo_url":"https://github.com/larsmaaloee/BIVA","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"tf","reach":null},{"paper_slug":"hierarchical-vaes-know-what-they-don-t-know","repo_url":"https://github.com/vlievin/biva-pytorch","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"hierarchical-vaes-know-what-they-don-t-know","repo_url":"https://github.com/HenryLHH/HVAE-OOD","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"ood-detection","task_name":"Out of Distribution (OOD) Detection"},{"task_slug":"out-of-distribution-detection","task_name":"Out-of-Distribution Detection"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2102.08248","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2102.08248"}},"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/HenryLHH/HVAE-OOD","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/JakobHavtorn/hvae-oodd","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/larsmaaloee/BIVA","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/vlievin/biva-pytorch","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_violates":2,"ran":4,"ran_fixture":2,"unverified":2},"by_repo_kind":{"official":{"samples":7,"ran":5,"repositories":2},"listed":{"samples":3,"ran":3,"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":9,"samples":[{"code_sha256_prefix":"f1e2aae146835900","entry":"collapse_multiclass_to_binary","repo":"jakobhavtorn/hvae-oodd","repo_kind":"official","path":"scripts/dvae_run.py","file_url":"https://github.com/jakobhavtorn/hvae-oodd/blob/HEAD/scripts/dvae_run.py","link_basis":"first_harvest_node","language":"python","status":"ran_violates","verification_level":2,"contract_check":"VIOLATES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f1e2aae146835900"}},{"code_sha256_prefix":"206ee3d6cd55d66b","entry":"Evaluator","repo":"HenryLHH/HVAE-OOD","repo_kind":"listed","path":"oodd/evaluators/evaluator.py","file_url":"https://github.com/HenryLHH/HVAE-OOD/blob/HEAD/oodd/evaluators/evaluator.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"206ee3d6cd55d66b"}},{"code_sha256_prefix":"dc6ee9ad5fc8272b","entry":"Evaluator","repo":"JakobHavtorn/hvae-oodd","repo_kind":"official","path":"oodd/evaluators/evaluator.py","file_url":"https://github.com/JakobHavtorn/hvae-oodd/blob/HEAD/oodd/evaluators/evaluator.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"dc6ee9ad5fc8272b"}},{"code_sha256_prefix":"b651589551fe9755","entry":"compute_pr_auc","repo":"jakobhavtorn/hvae-oodd","repo_kind":"official","path":"scripts/dvae_run.py","file_url":"https://github.com/jakobhavtorn/hvae-oodd/blob/HEAD/scripts/dvae_run.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b651589551fe9755"}},{"code_sha256_prefix":"bdc76537e9b03197","entry":"compute_roc_auc","repo":"jakobhavtorn/hvae-oodd","repo_kind":"official","path":"scripts/dvae_run.py","file_url":"https://github.com/jakobhavtorn/hvae-oodd/blob/HEAD/scripts/dvae_run.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"bdc76537e9b03197"}},{"code_sha256_prefix":"c4ad01fdc639a488","entry":"dd_dict","repo":"HenryLHH/HVAE-OOD","repo_kind":"listed","path":"oodd/evaluators/evaluator.py","file_url":"https://github.com/HenryLHH/HVAE-OOD/blob/HEAD/oodd/evaluators/evaluator.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c4ad01fdc639a488"}},{"code_sha256_prefix":"52e8065c446abf3d","entry":"defaultdict_with_dict","repo":"HenryLHH/HVAE-OOD","repo_kind":"listed","path":"oodd/evaluators/evaluator.py","file_url":"https://github.com/HenryLHH/HVAE-OOD/blob/HEAD/oodd/evaluators/evaluator.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"52e8065c446abf3d"}},{"code_sha256_prefix":"4a2c579f74fae949","entry":"get_decode_from_p","repo":"jakobhavtorn/hvae-oodd","repo_kind":"official","path":"scripts/ood-llr.py","file_url":"https://github.com/jakobhavtorn/hvae-oodd/blob/HEAD/scripts/ood-llr.py","link_basis":"first_harvest_node","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4a2c579f74fae949"}},{"code_sha256_prefix":"42790bde311491f1","entry":"get_save_path","repo":"jakobhavtorn/hvae-oodd","repo_kind":"official","path":"scripts/ood-llr.py","file_url":"https://github.com/jakobhavtorn/hvae-oodd/blob/HEAD/scripts/ood-llr.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":"42790bde311491f1"}},{"code_sha256_prefix":"1421d48bfd48d085","entry":"log_normal","repo":"larsmaaloee/BIVA","repo_kind":"official","path":"layers/_loss.py","file_url":"https://github.com/larsmaaloee/BIVA/blob/HEAD/layers/_loss.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":"1421d48bfd48d085"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}