In this paper, we study the problem of uncertainty estimation and calibration for LLMs. We first formulate the uncertainty estimation problem for LLMs and then propose a supervised approach that takes advantage of the labeled datasets and estimates the uncertainty of the LLMs' responses. Based on the formulation, we illustrate the difference between the uncertainty estimation for LLMs and that for standard ML models and explain why the hidden neurons of the LLMs may contain uncertainty information. Our designed approach demonstrates the benefits of utilizing hidden activations to enhance uncertainty estimation across various tasks and shows robust transferability in out-of-distribution settings. We distinguish the uncertainty estimation task from the uncertainty calibration task and show that a better uncertainty estimation mode leads to a better calibration performance. Furthermore, our method is easy to implement and adaptable to different levels of model accessibility including black box, grey box, and white box.
翻译:本文研究大型语言模型(LLMs)的不确定性估计与校准问题。我们首先形式化LLMs的不确定性估计问题,随后提出一种监督方法,该方法利用标注数据集来估计LLM响应的不确定性。基于此形式化框架,我们阐释了LLMs与标准机器学习模型在不确定性估计上的差异,并解释了为何LLMs的隐藏神经元可能包含不确定性信息。我们设计的方法证明了利用隐藏激活增强跨任务不确定性估计的优越性,并在分布外场景中展现出鲁棒的迁移能力。我们区分了不确定性估计任务与不确定性校准任务,并证明更优的不确定性估计模式能带来更好的校准性能。此外,该方法实现简便,可适配不同模型访问层级(包括黑盒、灰盒与白盒场景)。