[Paper Review] PnPOOD : Out-Of-Distribution Detection for Text Classification via Plug andPlay Data Augmentation
PnPOOD proposes a plug-and-play data augmentation method for out-of-distribution (OOD) detection in text classification using the Plug and Play Language Model (PPLM) to generate high-quality OOD samples near class boundaries. It significantly improves OOD detection performance and model calibration, outperforming prior methods on SST and 20 Newsgroup datasets while addressing data leakage issues in existing benchmarks.
While Out-of-distribution (OOD) detection has been well explored in computer vision, there have been relatively few prior attempts in OOD detection for NLP classification. In this paper we argue that these prior attempts do not fully address the OOD problem and may suffer from data leakage and poor calibration of the resulting models. We present PnPOOD, a data augmentation technique to perform OOD detection via out-of-domain sample generation using the recently proposed Plug and Play Language Model (Dathathri et al., 2020). Our method generates high quality discriminative samples close to the class boundaries, resulting in accurate OOD detection at test time. We demonstrate that our model outperforms prior models on OOD sample detection, and exhibits lower calibration error on the 20 newsgroup text and Stanford Sentiment Treebank dataset (Lang, 1995; Socheret al., 2013). We further highlight an important data leakage issue with datasets used in prior attempts at OOD detection, and share results on a new dataset for OOD detection that does not suffer from the same problem.
Motivation & Objective
- To address the lack of robust OOD detection methods in NLP, especially for intent classification in conversational agents.
- To overcome limitations in prior OOD detection approaches, including poor model calibration and data leakage from overlapping training and test OOD distributions.
- To develop a plug-and-play, data augmentation-based method that generates high-quality, boundary-aware OOD samples for improved detection.
- To provide a fair evaluation by introducing a new OOD benchmark dataset free from data leakage, derived from the 20 Newsgroup dataset.
- To demonstrate superior performance in OOD detection metrics (AUROC, AUPR) and reduced calibration error compared to state-of-the-art methods.
Proposed method
- Leverages the Plug and Play Language Model (PPLM) to generate out-of-distribution (OOD) samples by conditioning on in-domain (ID) text embeddings.
- Uses entropy regularization during training to encourage OOD samples to have high entropy, pushing them toward uniformity and improving discriminability.
- Generates OOD samples that are concentrated near the decision boundaries of the ID classifier, enhancing detection sensitivity.
- Employs Maximum Softmax Probability (MSP) as the final detection score, with model fine-tuning using both ID and PPLM-generated OOD data.
- Replaces generic OOD datasets like Gutenberg with domain-specific OOD data from the 20 Newsgroup dataset to eliminate data leakage.
- Applies post-hoc Dirichlet calibration to further reduce Expected Calibration Error (ECE).
Experimental results
Research questions
- RQ1Can PPLM-based data augmentation generate high-quality OOD samples that are close to the decision boundary of the ID classifier?
- RQ2Does the proposed PnPOOD method improve OOD detection performance compared to existing state-of-the-art methods on standard NLP benchmarks?
- RQ3To what extent does PnPOOD reduce model calibration error compared to prior approaches?
- RQ4How does data leakage in prior OOD detection benchmarks affect model evaluation, and can a new benchmark mitigate this?
- RQ5Can the method generalize across multiple domain combinations in zero-shot OOD detection settings?
Key findings
- PnPOOD achieves state-of-the-art performance on the SST-2 dataset, with an AUROC of 0.89 and AUPR of 0.51 when detecting OOD samples from the 'Politics' domain.
- On the 20 Newsgroup dataset, PnPOOD achieves an AUROC of 0.89 and AUPR of 0.51 when detecting OOD samples from 'Sports' and 'Politics' domains, outperforming MSP and MSP+ER baselines.
- The method reduces Expected Calibration Error (ECE) by up to 30% compared to MSP and MSP+ER baselines, demonstrating improved model calibration.
- PnPOOD significantly outperforms prior methods in FPR@90TPR, achieving a value of 0.31 on the 'Politics' domain, compared to 0.33 for MSP+ER.
- The authors identify and resolve a critical data leakage issue in prior OOD benchmarks, showing that prior results may be overestimated due to overlapping OOD and ID data.
- Post-hoc Dirichlet calibration further reduces ECE, confirming that PnPOOD produces well-calibrated models even after calibration.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.