相对于语义保持嵌入的梯度揭示大语言模型的不确定性
Gradients with Respect to Semantics Preserving Embeddings Tell the Uncertainty of Large Language Models
AI总结:
提出首个基于梯度的自由文本生成不确定性量化方法SemGrad,通过语义空间中的梯度计算实现高效且无需采样的不确定性估计。
摘要:
不确定性量化(UQ)是确保大语言模型(LLM)可信度的重要技术,因为LLM容易产生幻觉。现有的自由文本生成UQ方法严重依赖采样,导致计算成本高且方差大。在这项工作中,我们提出了首个基于梯度的自由文本生成UQ方法SemGrad,它无需采样且计算高效。与先前针对分类任务开发的在参数空间中操作的梯度方法不同,我们提出在语义空间中考虑梯度。我们的方法基于一个关键直觉:自信的LLM应在语义等价的输入扰动下保持稳定的输出分布。我们将这种稳定性解释为语义空间中的梯度,并引入语义保持分数(SPS)来识别最能捕捉语义的嵌入,并针对这些嵌入计算梯度。我们进一步提出了HybridGrad,它结合了SemGrad和参数梯度的优势。实验表明,我们的两种方法都提供了高效且有效的不确定性估计,在多个有效响应的设置中尤其优于现有方法。
英文摘要:
Uncertainty quantification (UQ) is an important technique for ensuring the trustworthiness of LLMs, given their tendency to hallucinate. Existing state-of-the-art UQ approaches for free-form generation rely heavily on sampling, which incurs high computational cost and variance. In this work, we propose the first gradient-based UQ method for free-form generation, SemGrad, which is sampling-free and computationally efficient. Unlike prior gradient-based methods developed for classification tasks that operates in parameter space, we propose to consider gradients in semantic space. Our method builds on the key intuition that a confident LLM should maintain stable output distributions under semantically equivalent input perturbations. We interpret the stability as the gradients in semantic space and introduce a Semantic Preservation Score (SPS) to identify embeddings that best capture semantics, with respect to which gradients are computed. We further propose HybridGrad, which combines the strengths of SemGrad and parameter gradients. Experiments demonstrate that both of our methods provide efficient and effective uncertainty estimates, achieving superior performance than state-of-the-art methods, particularly in settings with multiple valid responses.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。