# $k$Folden: $k$-Fold Ensemble for Out-Of-Distribution Detection

Source: [$k$Folden: $k$-Fold Ensemble for Out-Of-Distribution Detection](<https://www.sota2.com/research/paper/68fa6b331e209131cea2cd40>)

Collection index: [llms.txt](<https://www.sota2.com/research/llms.txt>)

Data updated: 2025-10-25T23:43:15.362Z

Authors: Xiaoya Li, Jiwei Li, Xiaofei Sun, Chun Fan, Tianwei Zhang, Fei Wu, Yuxian Meng, Jun Zhang

Published: 2021-08-29T01:52:11.000Z

## Abstract

Out-of-Distribution (OOD) detection is an important problem in natural language processing (NLP). In this work, we propose a simple yet effective framework $k$Folden, which mimics the behaviors of OOD detection during training without the use of any external data. For a task with $k$ training labels, $k$Folden induces $k$ sub-models, each of which is trained on a subset with $k-1$ categories with the left category masked unknown to the sub-model. Exposing an unknown label to the sub-model during training, the model is encouraged to learn to equally attribute the probability to the seen $k-1$ labels for the unknown label, enabling this framework to simultaneously resolve in- and out-distribution examples in a natural way via OOD simulations. Taking text classification as an archetype, we develop benchmarks for OOD detection using existing text classification datasets. By conducting comprehensive comparisons and analyses on the developed benchmarks, we demonstrate the superiority of $k$Folden against current methods in terms of improving OOD detection performances while maintaining improved in-domain classification accuracy. The code and datasets can be found at: \\url{https://github.com/ShannonAI/kfolden-ood-detection}.

## Recorded benchmark results

A research result applies to its stated dataset, split, metric and evaluation configuration. Compare like-for-like settings, preserve the metric's unit and direction, and distinguish paper-reported results from independent reproduction. The best result recorded here is not a claim of exhaustive, current global coverage.

- [OOD Detection on TACRED](<https://www.sota2.com/research/sota/ood-detection-on-tacred.md>): OOD Detection; TACRED; AUROC: 0.531.

- [Open-set selective classification on TREC-10 (test)](<https://www.sota2.com/research/sota/open-set-selective-classification-on-trec-10-test.md>): Open-set selective classification; TREC-10 (test); AUAC: 93.5.

- [OOD Detection on TREC-10](<https://www.sota2.com/research/sota/ood-detection-on-trec-10.md>): OOD Detection; TREC-10; AUROC: 84.7.

- [OOD Detection on Emotion](<https://www.sota2.com/research/sota/ood-detection-on-emotion.md>): OOD Detection; Emotion; AUROC: 0.853.

- [Open-set selective classification on Emotion (test)](<https://www.sota2.com/research/sota/open-set-selective-classification-on-emotion-test.md>): Open-set selective classification; Emotion (test); AUAC: 90.6.

- [OOD Detection on AGNews](<https://www.sota2.com/research/sota/ood-detection-on-agnews.md>): OOD Detection; AGNews; AUROC: 0.725.

- [Open-set selective classification on AGNews (test)](<https://www.sota2.com/research/sota/open-set-selective-classification-on-agnews-test.md>): Open-set selective classification; AGNews (test); AUAC: 85.8.

- [Open-set selective classification on TACRED (test)](<https://www.sota2.com/research/sota/open-set-selective-classification-on-tacred-test.md>): Open-set selective classification; TACRED (test); AUAC: 84.9.

## Original sources and implementation

[Original paper](<https://arxiv.org/abs/2108.12731>)

[PDF](<https://arxiv.org/pdf/2108.12731.pdf>)
