{"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/a-geometric-explanation-of-the-likelihood-ood","title":"A Geometric Explanation of the Likelihood OOD Detection Paradox","arxiv_id":"2403.18910","date":"2024-03-27","proceeding":null,"authors":["Hamidreza Kamkari","Brendan Leigh Ross","Jesse C. Cresswell","Anthony L. Caterini","Rahul G. Krishnan","Gabriel Loaiza-Ganem"],"abstract":"Likelihood-based deep generative models (DGMs) commonly exhibit a puzzling behaviour: when trained on a relatively complex dataset, they assign higher likelihood values to out-of-distribution (OOD) data from simpler sources. Adding to the mystery, OOD samples are never generated by these DGMs despite having higher likelihoods. This two-pronged paradox has yet to be conclusively explained, making likelihood-based OOD detection unreliable. Our primary observation is that high-likelihood regions will not be generated if they contain minimal probability mass. We demonstrate how this seeming contradiction of large densities yet low probability mass can occur around data confined to low-dimensional manifolds. We also show that this scenario can be identified through local intrinsic dimension (LID) estimation, and propose a method for OOD detection which pairs the likelihoods and LID estimates obtained from a pre-trained DGM. Our method can be applied to normalizing flows and score-based diffusion models, and obtains results which match or surpass state-of-the-art OOD detection benchmarks using the same DGM backbones. Our code is available at https://github.com/layer6ai-labs/dgm_ood_detection.","url_abs":"https://arxiv.org/abs/2403.18910v2","url_pdf":"https://arxiv.org/pdf/2403.18910v2.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":"a-geometric-explanation-of-the-likelihood-ood","repo_url":"https://github.com/layer6ai-labs/dgm_ood_detection","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"},{"method_slug":"normalizing-flows","method_name":"Normalizing Flows"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2403.18910","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2403.18910"}},"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/layer6ai-labs/dgm_ood_detection","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":3,"unverified":1},"by_repo_kind":{"official":{"samples":4,"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":0,"samples":[{"code_sha256_prefix":"cd42036d4fe7601c","entry":"float_to_str","repo":"layer6ai-labs/dgm_ood_detection","repo_kind":"official","path":"ood/wandb_visualization.py","file_url":"https://github.com/layer6ai-labs/dgm_ood_detection/blob/HEAD/ood/wandb_visualization.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"cd42036d4fe7601c"}},{"code_sha256_prefix":"baf97703298b1c79","entry":"plot_likelihood_ood_histogram","repo":"layer6ai-labs/dgm_ood_detection","repo_kind":"official","path":"main_ood.py","file_url":"https://github.com/layer6ai-labs/dgm_ood_detection/blob/HEAD/main_ood.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"baf97703298b1c79"}},{"code_sha256_prefix":"dca541016c7ced0d","entry":"standardize_sample_visualizing_format","repo":"layer6ai-labs/dgm_ood_detection","repo_kind":"official","path":"main_ood.py","file_url":"https://github.com/layer6ai-labs/dgm_ood_detection/blob/HEAD/main_ood.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"dca541016c7ced0d"}},{"code_sha256_prefix":"4cd8e5143aa1adef","entry":"visualize_trends","repo":"layer6ai-labs/dgm_ood_detection","repo_kind":"official","path":"ood/wandb_visualization.py","file_url":"https://github.com/layer6ai-labs/dgm_ood_detection/blob/HEAD/ood/wandb_visualization.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":"4cd8e5143aa1adef"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}