Uncertainty Quantification for In-Context Learning of Large Language Models

Chen Ling,Xujiang Zhao,Xuchao Zhang,Wei Cheng,Yanchi Liu,Yiyou Sun,Mika Oishi,Takao Osaki,Katsushi Matsuda,Jie Ji,Guangji Bai,Liang Zhao,Haifeng Chen
2024-03-29
Abstract:In-context learning has emerged as a groundbreaking ability of Large Language Models (LLMs) and revolutionized various fields by providing a few task-relevant demonstrations in the prompt. However, trustworthy issues with LLM's response, such as hallucination, have also been actively discussed. Existing works have been devoted to quantifying the uncertainty in LLM's response, but they often overlook the complex nature of LLMs and the uniqueness of in-context learning. In this work, we delve into the predictive uncertainty of LLMs associated with in-context learning, highlighting that such uncertainties may stem from both the provided demonstrations (aleatoric uncertainty) and ambiguities tied to the model's configurations (epistemic uncertainty). We propose a novel formulation and corresponding estimation method to quantify both types of uncertainties. The proposed method offers an unsupervised way to understand the prediction of in-context learning in a plug-and-play fashion. Extensive experiments are conducted to demonstrate the effectiveness of the decomposition. The code and data are available at:
Computation and Language,Machine Learning
What problem does this paper attempt to address?
This paper mainly discusses the quantification of uncertainty in context learning in large language models (LLMs). The authors point out that although LLMs have shown revolutionary capabilities across various tasks, their responses may be unreliable, such as hallucinations. Existing methods attempt to quantify the uncertainty of LLMs, but often overlook the complexity of the models and the uniqueness of context learning. The paper proposes a new framework to decompose predictive uncertainty into two types of uncertainty: aleatoric (data inherent) uncertainty and epistemic (model parameter or configuration-related) uncertainty. They quantify these two uncertainties from the perspective of information entropy and design an estimation method for handling the free-form outputs of LLMs. The experimental section demonstrates the effectiveness of this decomposition and illustrates how the two uncertainties impact the model performance through specific applications and case studies. The authors also emphasize the importance of distinguishing the sources of uncertainty, for example, whether the incorrect predictions made by LLMs in context learning are due to the quality of examples or the models themselves. Their method provides an unsupervised way to understand the predictions of context learning and make necessary adjustments based on the model's confidence level in the task. The paper provides code and data for further research.