{"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/enhancing-out-of-distribution-detection-in","title":"Enhancing Out-of-Distribution Detection in Natural Language Understanding via Implicit Layer Ensemble","arxiv_id":"2210.11034","date":"2022-10-20","proceeding":null,"authors":["Hyunsoo Cho","Choonghyun Park","Jaewook Kang","Kang Min Yoo","Taeuk Kim","Sang-goo Lee"],"abstract":"Out-of-distribution (OOD) detection aims to discern outliers from the intended data distribution, which is crucial to maintaining high reliability and a good user experience. Most recent studies in OOD detection utilize the information from a single representation that resides in the penultimate layer to determine whether the input is anomalous or not. Although such a method is straightforward, the potential of diverse information in the intermediate layers is overlooked. In this paper, we propose a novel framework based on contrastive learning that encourages intermediate features to learn layer-specialized representations and assembles them implicitly into a single representation to absorb rich information in the pre-trained language model. Extensive experiments in various intent classification and OOD datasets demonstrate that our approach is significantly more effective than other works.","url_abs":"https://arxiv.org/abs/2210.11034v1","url_pdf":"https://arxiv.org/pdf/2210.11034v1.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":"enhancing-out-of-distribution-detection-in","repo_url":"https://github.com/hyunsoocho77/lacl-official","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"contrastive-learning","task_name":"Contrastive Learning"},{"task_slug":"intent-classification","task_name":"Intent Classification"},{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"natural-language-understanding","task_name":"Natural Language Understanding"},{"task_slug":"ood-detection","task_name":"Out of Distribution (OOD) Detection"},{"task_slug":"out-of-distribution-detection","task_name":"Out-of-Distribution Detection"},{"task_slug":"intent-classification-1","task_name":"intent-classification"}],"methods":[{"method_slug":"contrastive-learning","method_name":"Contrastive Learning"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2210.11034","atlas_url":"https://app.syntology.ai/?focus=2210.11034","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2210.11034"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/hyunsoocho77/lacl-official","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":8,"unverified":1},"by_repo_kind":{"official":{"samples":9,"ran":8,"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":"8009738e5585203d","entry":"Supervised_NT_xent","repo":"hyunsoocho77/lacl-official","repo_kind":"official","path":"loss.py","file_url":"https://github.com/hyunsoocho77/lacl-official/blob/HEAD/loss.py","link_basis":"harvester_set","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":"8009738e5585203d"}},{"code_sha256_prefix":"24b2927037c0889f","entry":"collate_fn","repo":"hyunsoocho77/lacl-official","repo_kind":"official","path":"utils.py","file_url":"https://github.com/hyunsoocho77/lacl-official/blob/HEAD/utils.py","link_basis":"harvester_set","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":"24b2927037c0889f"}},{"code_sha256_prefix":"e5c1aadbdcf0a0eb","entry":"collate_fn2","repo":"hyunsoocho77/lacl-official","repo_kind":"official","path":"utils.py","file_url":"https://github.com/hyunsoocho77/lacl-official/blob/HEAD/utils.py","link_basis":"harvester_set","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":"e5c1aadbdcf0a0eb"}},{"code_sha256_prefix":"1388ea7bf1dcf255","entry":"fpr_at_95","repo":"hyunsoocho77/lacl-official","repo_kind":"official","path":"evaluation.py","file_url":"https://github.com/hyunsoocho77/lacl-official/blob/HEAD/evaluation.py","link_basis":"harvester_set","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":"1388ea7bf1dcf255"}},{"code_sha256_prefix":"3aa2f062aac00de2","entry":"get_sim_mat","repo":"hyunsoocho77/lacl-official","repo_kind":"official","path":"loss.py","file_url":"https://github.com/hyunsoocho77/lacl-official/blob/HEAD/loss.py","link_basis":"harvester_set","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":"3aa2f062aac00de2"}},{"code_sha256_prefix":"7e7ca6d67f5c378d","entry":"mean_pooling","repo":"hyunsoocho77/lacl-official","repo_kind":"official","path":"model.py","file_url":"https://github.com/hyunsoocho77/lacl-official/blob/HEAD/model.py","link_basis":"harvester_set","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":"7e7ca6d67f5c378d"}},{"code_sha256_prefix":"779bf38fd1a03f1f","entry":"merge_keys","repo":"hyunsoocho77/lacl-official","repo_kind":"official","path":"evaluation.py","file_url":"https://github.com/hyunsoocho77/lacl-official/blob/HEAD/evaluation.py","link_basis":"harvester_set","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":"779bf38fd1a03f1f"}},{"code_sha256_prefix":"bdbebc60e2bde280","entry":"reg_loss","repo":"hyunsoocho77/lacl-official","repo_kind":"official","path":"loss.py","file_url":"https://github.com/hyunsoocho77/lacl-official/blob/HEAD/loss.py","link_basis":"harvester_set","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":"bdbebc60e2bde280"}},{"code_sha256_prefix":"5cb7b677118e1dba","entry":"LACL_load_aug","repo":"hyunsoocho77/lacl-official","repo_kind":"official","path":"utils.py","file_url":"https://github.com/hyunsoocho77/lacl-official/blob/HEAD/utils.py","link_basis":"harvester_set","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":"5cb7b677118e1dba"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}