用概率反演方法解析大模型生成逻辑,揭示文本生成的内在机制。
Probabilistic Attribution For Large Language Models

- 基于贝叶斯定理反推生成概率,构建与模型结构无关的归因分数。
- 通过条件熵与归因分数的交互分析,发现生成不稳定和异常响应。
- 适用于评估模型对提示敏感性、生成稳定性及训练收敛性,提升可解释性。
大型语言模型(LLMs)的生成特性体现在其根据前序标记计算每个响应标记的条件概率。这些概率编码了模型在训练中学习到的分布结构,并在推理中被利用。本文将这些概率置于随机过程的数学框架下,设计了一种不依赖模型结构的、基于概率的标记归因度量方法。通过贝叶斯规则反转下一个标记的对数概率,捕捉模型对标记序列分布的内部表征。该表征独立于模型的计算结构,能够给出给定提示时的响应条件概率,以及在移除某一标记后响应的条件概率。归因分数为这两者概率比值的对数。我们还计算了单个提示标记在其剩余上下文条件下的熵。熵与归因分数之间的相互作用揭示了大模型的行为特征。我们在7个提示上评估了8个模型,研究了异常现象、标记敏感性、响应稳定性、模型稳定性及训练收敛性,从而增强了可解释性,并引导用户关注生成中的不确定或不稳定部分。
原文摘要 · Abstract (English)
The generative nature of Large Language Models (LLMs) is reflected in the conditional probabilities they compute to sample each response token given the previous tokens. These probabilities encode the distributional structure that the model learns in training and exploits in inference. In this work, we use these probabilities to situate LLMs within the mathematical theory of stochastic processes. We use this framework to design a model-agnostic probabilistic token attribution measure, using Bayes rule to invert the next-token log-probabilities so as to capture the models internal representation of the distribution over token sequences. The representation is independent of the models computational structure. This representation yields the conditional probability of the response given the prompt, and of the response given the prompt with a token marginalized away. Our attribution score is the log of the ratio of these probabilities. We further compute the entropies of a single prompts token distributions, conditioned on the remaining context. The interplay between entropy and attribution score sheds light on LLM behavior. We evaluate 8 models across 7 prompts and investigate anomalies, token sensitivity, response stability, model stability, and training convergence, thereby improving interpretability and guiding users to focus on uncertain or unstable parts of the generation.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。