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 -Nearest Neighbor Uncertainty Estimation (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 arXiv@article{hashimoto2025_2407.02138, title={ Efficient Nearest Neighbor based Uncertainty Estimation for Natural Language Processing Tasks }, author={ Wataru Hashimoto and Hidetaka Kamigaito and Taro Watanabe }, journal={arXiv preprint arXiv:2407.02138}, year={ 2025 } }