Papers › Types of Out-of-Distribution Texts and How to Detect Them

Types of Out-of-Distribution Texts and How to Detect Them

14 Sep 2021EMNLP 2021 11arXiv:2109.06827archive 2025-07-28

Udit Arora, William Huang, He He

Despite agreement on the importance of detecting out-of-distribution (OOD) examples, there is little consensus on the formal definition of OOD examples and how to best detect them. We categorize these examples by whether they exhibit a background shift or a semantic shift, and find that the two major approaches to OOD detection, model calibration and density estimation (language modeling for text), have distinct behavior on these types of OOD data. Across 14 pairs of in-distribution and OOD English natural language understanding datasets, we find that density estimation methods consistently beat calibration methods in background shift settings, while performing worse in semantic shift settings. In addition, we find that both methods generally fail to detect examples from challenge data, highlighting a weak spot for current methods. Since no single method works well across all settings, our results call for an explicit definition of OOD examples when evaluating different detection methods.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2109.06827")

Code

Syntology Ran 0 of 12 code samples harvested from 1 repository linked to this paper; 12 have no recorded run.

By repository: official repository: 12 samples from 1 repository, 0 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

uditarora/ood-text-emnlp officialmentioned in papermentioned on GitHubpytorchMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

12 samples harvested; 0 ran; 0 honoured the contract we drafted; 12 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

12unverified

Licence: 0 of the 12 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from uditarora/ood-text-emnlp. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: 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. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

compute_all uditarora/ood-text-emnlp/perplexity.py official repository unverified MIT (permissive) · f3167e070ba7c977 · report
compute_auroc uditarora/ood-text-emnlp/utils.py official repository unverified MIT (permissive) · 72563a8679267472 · report
compute_far uditarora/ood-text-emnlp/utils.py official repository unverified MIT (permissive) · 4bd8eb730cf38934 · report
compute_perplexity uditarora/ood-text-emnlp/perplexity.py official repository unverified MIT (permissive) · b29cddb5f632a9d9 · report
compute_px uditarora/ood-text-emnlp/utils.py official repository unverified MIT (permissive) · 83b21e96c79e998a · report
encode uditarora/ood-text-emnlp/msp_eval.py official repository unverified MIT (permissive) · f9a4adc707cb9193 · report
get_dataloader uditarora/ood-text-emnlp/roberta_fine_tune.py official repository unverified MIT (permissive) · b41e11872936971a · report
process_custom_dataset uditarora/ood-text-emnlp/roberta_fine_tune.py official repository unverified MIT (permissive) · 30912a8b3a57ba75 · report
process_entailment uditarora/ood-text-emnlp/msp_eval.py official repository unverified MIT (permissive) · 374d3df6220579b7 · report
process_hf_dataset uditarora/ood-text-emnlp/roberta_fine_tune.py official repository unverified MIT (permissive) · d33fb2634b456ea3 · report
process_msp uditarora/ood-text-emnlp/msp_eval.py official repository unverified MIT (permissive) · 87d7cfb062dec677 · report
setup uditarora/ood-text-emnlp/perplexity.py official repository unverified MIT (permissive) · 0975a4d4fcffe722 · report

Tasks

Density EstimationLanguage ModelingLanguage ModellingNatural Language UnderstandingOut of Distribution (OOD) Detection

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections