Efficient Nearest Neighbor based Uncertainty Estimation for Natural Language Processing Tasks

Wataru Hashimoto, Hidetaka Kamigaito, Taro Watanabe
7/2/2024
cs.CLcs.AIcs.LG

No official code found. Best implementation: wataruhashimoto52/knn_ue (1 star, last commit 2025-02-06).

Abstract

Trustworthiness in model predictions is crucial for safety-critical applications in the real world. However, deep neural networks often suffer from the issues of uncertainty estimation, such as miscalibration. In this study, we propose $k$-Nearest Neighbor Uncertainty Estimation ($k$NN-UE), which is a new uncertainty estimation method that uses not only the distances from the neighbors, but also the ratio of labels in the neighbors. Experiments on sentiment analysis, natural language inference, and named entity recognition show that our proposed method outperforms the baselines and recent density-based methods in several calibration and uncertainty metrics. Moreover, our analyses indicate that approximate nearest neighbor search techniques reduce the inference overhead without significantly degrading the uncertainty estimation performance when they are appropriately combined.

View on arXivView PDF

Code Implementations(1)

Code for "Efficient Nearest Neighbor based Uncertainty Estimation for Natural Language Processing Tasks" in Findings of NAACL 2025.

10Shell, PythonFeb 2, 20251 years ago

Similar Papers

Cite this paper

@article{hashimoto2024efficient,
  title  = {Efficient Nearest Neighbor based Uncertainty Estimation for Natural Language Processing Tasks},
  author = {Wataru Hashimoto and Hidetaka Kamigaito and Taro Watanabe},
  year   = {2024},
  eprint = {2407.02138},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2407.02138v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2407.02138.svg)](https://codeofpaper.com/paper/2407.02138)

Discussion