Skip to main content
QUICK REVIEW

[Paper Review] Out-of-Distribution Detection and Selective Generation for Conditional Language Models

Jie Ren, Jiaming Luo|arXiv (Cornell University)|Sep 30, 2022
Topic ModelingComputer Science12 citations
TL;DR

This paper proposes a lightweight, accurate out-of-distribution (OOD) detection method for conditional language models (CLMs) using model embeddings, significantly outperforming perplexity-based approaches. It enables selective generation by abstaining from low-quality outputs on OOD inputs, improving safety and reliability in real-world deployment for summarization and translation tasks.

ABSTRACT

Machine learning algorithms typically assume independent and identically distributed samples in training and at test time. Much work has shown that high-performing ML classifiers can degrade significantly and provide overly-confident, wrong classification predictions, particularly for out-of-distribution (OOD) inputs. Conditional language models (CLMs) are predominantly trained to classify the next token in an output sequence, and may suffer even worse degradation on OOD inputs as the prediction is done auto-regressively over many steps. Furthermore, the space of potential low-quality outputs is larger as arbitrary text can be generated and it is important to know when to trust the generated output. We present a highly accurate and lightweight OOD detection method for CLMs, and demonstrate its effectiveness on abstractive summarization and translation. We also show how our method can be used under the common and realistic setting of distribution shift for selective generation (analogous to selective prediction for classification) of high-quality outputs, while automatically abstaining from low-quality ones, enabling safer deployment of generative language models.

Motivation & Objective

  • To address the critical issue of unreliable model behavior on out-of-distribution (OOD) inputs in conditional language models (CLMs), where auto-regressive generation amplifies errors and produces low-quality outputs.
  • To develop a lightweight, accurate OOD detection method that does not require a separate model, leveraging only the CLM’s internal representations (embeddings).
  • To enable selective generation—abstaining from generating on OOD inputs while producing high-quality outputs on in-domain or near-domain inputs—thereby improving safety and reliability in real-world applications.
  • To establish a robust evaluation framework for OOD detection and selective generation in CLMs, including human evaluation for summarization quality.

Proposed method

  • Proposes a novel OOD score based on the cosine similarity between input and output sequence embeddings (input RMD and output RMD), which are derived from the CLM’s hidden states.
  • Uses the mean of the L2-normalized representations of the input and output sequences as a proxy for distributional divergence, forming the RMD (Representation Mean Distance) score.
  • Introduces a hybrid detection strategy combining the RMD score with perplexity to improve OOD detection performance, especially under distribution shift.
  • Employs a selective generation mechanism where the model abstains from generating if the OOD score exceeds a learned threshold, analogous to selective prediction in classification.
  • Trains and evaluates the method on abstractive summarization (XSum) and machine translation (WMT), using human-annotated quality ratings to validate performance.
  • Calibrates the OOD threshold using in-domain data to balance abstention rate and output quality, ensuring safe deployment.

Experimental results

Research questions

  • RQ1Can perplexity serve as a reliable signal for detecting out-of-distribution inputs in conditional language models?
  • RQ2How effective is a lightweight OOD detection method based solely on model embeddings compared to existing baselines?
  • RQ3Can combining perplexity with an embedding-based OOD score improve detection performance under distribution shift?
  • RQ4To what extent can selective generation—abstaining on OOD inputs—improve the quality of generated outputs in real-world settings?
  • RQ5How well do human-annotated quality ratings correlate with automated OOD and quality scores in summarization tasks?

Key findings

  • Perplexity is a poor OOD detection signal for CLMs, as it shows significant overlap between in-domain and OOD distributions, leading to high false positive rates.
  • The proposed RMD-based OOD score (using input and output embeddings) significantly outperforms perplexity and other baselines in detecting OOD examples on both summarization and translation tasks.
  • Combining the RMD score with perplexity improves selective generation performance, especially under distribution shift, enabling higher-quality outputs while reducing low-quality generations.
  • The method achieves high accuracy in OOD detection with negligible computational overhead, requiring only the CLM’s internal representations.
  • Human evaluations show strong correlation between low RMD scores and high-quality summaries, validating the method’s ability to identify trustworthy generations.
  • The selective generation strategy effectively reduces the generation of factually incorrect or nonsensical outputs on OOD inputs, enhancing model safety and reliability.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.