[Paper Review] Rainproof: An Umbrella To Shield Text Generators From Out-Of-Distribution Data
This paper proposes RAINPROOF, a black-box Out-of-Distribution (OOD) detection framework for text generators that uses soft-probability distributions to detect distributional shifts without access to internal model states. It introduces LOFTER, a realistic benchmark for OOD detection in text generation, and demonstrates that RAINPROOF improves end-task performance by filtering only harmful OOD samples, unlike traditional detectors that degrade performance by rejecting well-generated outputs.
Implementing effective control mechanisms to ensure the proper functioning and security of deployed NLP models, from translation to chatbots, is essential. A key ingredient to ensure safe system behaviour is Out-Of-Distribution (OOD) detection, which aims to detect whether an input sample is statistically far from the training distribution. Although OOD detection is a widely covered topic in classification tasks, most methods rely on hidden features output by the encoder. In this work, we focus on leveraging soft-probabilities in a black-box framework, i.e. we can access the soft-predictions but not the internal states of the model. Our contributions include: (i) RAINPROOF a Relative informAItioN Projection OOD detection framework; and (ii) a more operational evaluation setting for OOD detection. Surprisingly, we find that OOD detection is not necessarily aligned with task-specific measures. The OOD detector may filter out samples well processed by the model and keep samples that are not, leading to weaker performance. Our results show that RAINPROOF provides OOD detection methods more aligned with task-specific performance metrics than traditional OOD detectors.
Motivation & Objective
- To develop a practical, black-box OOD detection method for text generators that does not require access to internal model states or OOD training data.
- To address the gap in OOD detection for conditional text generation, where existing methods from classification tasks are poorly adapted due to high-vocabulary token spaces.
- To create a more realistic evaluation benchmark that includes language shifts (e.g., Spanish to Catalan) and domain shifts (e.g., medical vs. news), beyond standard English GLUE benchmarks.
- To align OOD detection with end-task performance, ensuring that filtering improves rather than harms model reliability in real-world deployment.
- To demonstrate that OOD detection should not be evaluated solely on detection metrics but jointly with downstream task performance.
Proposed method
- RAINPROOF uses relative information projection (RIP) to compute a novelty score based on the divergence between predicted soft probabilities and a reference distribution or the uniform distribution.
- In the absence of reference data (scenario s₀), it computes the negentropy of the predicted distribution as a measure of normality.
- In the presence of reference data (scenario s₁), it applies information projection to compare the model’s output distribution to a data-driven reference set.
- The framework is fully unsupervised and operates solely on soft-probability outputs, making it deployable on any pre-trained language model via API.
- Threshold selection is based on controlling the false positive rate by preserving 99% of in-distribution samples, avoiding reliance on OOD data.
- The method aggregates scores across token generations via averaging, preserving sequence-level uncertainty critical for detection.
Experimental results
Research questions
- RQ1Can OOD detection in text generation be effectively performed using only soft-probability outputs, without access to internal model representations?
- RQ2Does OOD detection that improves downstream task performance exist, or do current detectors degrade performance by filtering well-generated samples?
- RQ3How do language shifts (e.g., Dutch to Afrikaans) and domain shifts (e.g., medical to news) affect OOD detection performance in text generation?
- RQ4Can a unified evaluation framework better reflect the operational value of OOD detectors by jointly measuring detection and end-task performance?
- RQ5Is there a method that aligns OOD detection with task-specific metrics rather than purely with OOD detection AUC?
Key findings
- RAINPROOF outperforms traditional OOD detectors like MSP and CQE in both OOD detection AUC and downstream BLEU scores, especially in language shift scenarios.
- On the LOFTER benchmark, RAINPROOF increased BLEU scores by +5.4 BLEU points on average in language shift tasks (e.g., Dutch to Afrikaans) when using the s₀ setting.
- Traditional detectors like MSP reduced BLEU scores by up to -3.1 points in OOD settings, indicating they filter out well-generated samples.
- The use of negentropy and information projection in RAINPROOF enables effective detection even without reference data, achieving strong performance in s₀ scenarios.
- The study reveals a critical misalignment: OOD detectors with high AUC may harm end-task performance, highlighting the need for joint evaluation with downstream metrics.
- Thresholding based on preserving 99% of in-distribution samples proved effective and practical, avoiding the need for OOD data during 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.