Who’s talking? I asked, peering behind the mirror. Many dead spiders and a lot of dust were there. Then I pressed my left eye with my index finger. This was an old formula for detecting hallucinations, which I had read in To Believe or Not to Believe?, the gripping book by B. B. Bittner. It is sufficient to press on the eyeball, and all the real objects, in contradistinction to the hallucinated, will double. The mirror promptly divided into two and my worried and sleep-dulled face appeared in it.
--"Monday Starts on Saturday" by A. and B. Strugatsky
我们探究了 LLM 不确定性的量化, 目的是确定给定 query 时什么时候不确定性比较大. 然后同时考虑了下面两种不确定性:
epistemic uncertainties 是认知不确定性, 是 ground truth 知识缺失导致的.
aleatoric uncertainties 是即兴不确定性, 是 irreducible 的随机性导致的, 比如多个可能的回答.
我们得到了一个 information-theoretic metric, 允许可靠地检测当 epistemic uncertainties 比较大的时候, 什么情况模型的输出时不可靠的.
对于可测集
条件分布和 prompting: 设
首先是三个相关的实验, 即按照上述给的 prompt
的方法对语言模型进行提问, 观察正确回答和错误回答概率的变化. 实验一: 当初始时 LLM 有较低的认知不确定性时,
即使为错误答案, 在 的一定范围内, 模型给出正确回答的概率仍然维持较高的水平. 实验二: 当初始时 LLM 有较高的认知不确定性时,
为错误答案, 当 增大的时候模型给出正确回答的概率迅速降低为 0 ( 时就已经非常接近 0 了). 实验三: 对于更开放性的有多个正确答案的问题 (multi-label query), 考虑两个回答
, 且回答 的概率大于回答 的概率, 那么即使 , 模型回答 的概率仍然比较大. 但随着 增大, 模型回答 的概率是整体逐渐递减的.
上面的实验展示了 LLM 的回答对额外 in-context 信息是很敏感的, 这在单个 attention head 中就能观察到.
考虑理想化的 attention 机制. 令
我们假设真实分布
比如对于
而对于
我们假设有一个可学习的参数矩阵
一个 Self-attention head 定义为
此时不管
此时
不是特别理解这段分析在说什么.
首先有一个假设: 对同一个问题, 根据 ground-truth 采样得到的多个回答是相互独立的, 这表述为:
Assumption 4.1 (真实值独立假设) ground-truth 满足
Definition 4.2 (伪联合分布) 给定一族 prompt 函数
Remark 4.3
重要定理: 对于满足假设 4.1 的伪联合分布
这个定理给了期望风险的一个下界.
按照下面的方式可以计算
独立地采样样本
构造
构造经验分布, 对任意
计算估计值
并且在假定