Efficient Nearest Neighbor based Uncertainty Estimation for Natural Language Processing Tasks

Wataru Hashimoto, Hidetaka Kamigaito, Taro Watanabe


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 (kNN-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.
Anthology ID:
2025.findings-naacl.246
Volume:
Findings of the Association for Computational Linguistics: NAACL 2025
Month:
April
Year:
2025
Address:
Albuquerque, New Mexico
Editors:
Luis Chiruzzo, Alan Ritter, Lu Wang
Venue:
Findings
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
4350–4366
Language:
URL:
https://preview.aclanthology.org/fix-sig-urls/2025.findings-naacl.246/
DOI:
Bibkey:
Cite (ACL):
Wataru Hashimoto, Hidetaka Kamigaito, and Taro Watanabe. 2025. Efficient Nearest Neighbor based Uncertainty Estimation for Natural Language Processing Tasks. In Findings of the Association for Computational Linguistics: NAACL 2025, pages 4350–4366, Albuquerque, New Mexico. Association for Computational Linguistics.
Cite (Informal):
Efficient Nearest Neighbor based Uncertainty Estimation for Natural Language Processing Tasks (Hashimoto et al., Findings 2025)
Copy Citation:
PDF:
https://preview.aclanthology.org/fix-sig-urls/2025.findings-naacl.246.pdf