arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2606.29693cs.LG
收藏

IG-Lens: 通过伸缩积分梯度实现跨Transformer层的精确加性概率归因

IG-Lens: Exact Additive Probability Attribution Across Transformer Layers via Telescoping Integrated Gradients

Hanoi University of Science and Technology(河内科技大学)

Duc Anh Nguyen

AI总结:

提出IG-Lens方法,通过沿隐藏状态路径应用伸缩积分梯度,实现对解码器Transformer中预测概率的逐层精确加性归因,并满足完整性。

摘要:

我们对仅解码器Transformer提出一个简单问题:预测token的概率实际上是在哪两层之间产生的?现有的逐层读取工具只能近似回答。Logit lens及其训练变体报告每层的概率水平,但不提供加性分解;它们的估计有偏且随深度非单调。直接logit归因和相关的残差流方法是加性的,但仅在logit空间中,softmax非线性破坏了概率空间中的加性,而概率正是人们通常关心的量。Layer Conductance对每层积分梯度,但将每个梯度归因于其自己的基线,因此不求和为预测的总变化。我们引入IG-Lens,这是一种沿从基线到最终层的隐藏状态单一路径应用积分梯度的伸缩方法。将每个段归因于其终止的层,得到逐层归因,其总和恰好是目标概率的变化,且softmax位于积分路径内部而非线性化。我们的默认估计器将每个积分步归因于其观测到的目标概率变化(一种基于IDGI的预测感知重加权),而非原始梯度。由于读取是一维概率,这会将每个段折叠为端点值的伸缩和,因此完整性在任何步数下精确成立(达到浮点精度),消除了Riemann离散化误差,同时抑制了显示梯度敏感性但输出无变化的步。我们给出伸缩恒等式及其证明,验证了浮点精度下的完整性,并描述了一种单次批处理实现,无需任何反向调用即可计算完整的逐token-层映射。代码:此https URL。

英文摘要:

We ask a simple question about decoder-only transformers: between which two layers is the probability of a predicted token actually produced? Existing layer-wise readout tools answer only approximately. The logit lens and its trained variant report a per-layer level of probability but give no additive decomposition; their estimates are biased and non-monotone across depth. Direct Logit Attribution and related residual-stream methods are additive, but only in logit space, the softmax nonlinearity breaks additivity in probability space, precisely the quantity one usually cares about. Layer Conductance integrates gradients per layer, but attributes each to its own baseline and so does not sum to the total change in prediction. We introduce IG-Lens, a telescoping application of Integrated Gradients along a single path through the hidden states from a baseline to the final layer. Crediting each segment to the layer it terminates at yields a layer-wise attribution whose sum is exactly the change in target probability, with the softmax inside the integration path rather than linearized away. Our default estimator credits each integration step its observed change in target probability (a prediction-aware reweighting in the spirit of IDGI) rather than its raw gradient. Because the readout is a one-dimensional probability, this collapses each segment to a telescoping sum of endpoint values, so completeness holds exactly (to floating point) at any step count, removing Riemann discretization error while suppressing steps that show gradient sensitivity without a change in output. We give the telescoping identity and its proof, verify completeness to floating point, and describe a single-pass batched implementation computing the full token-by-layer map without any backward call. Code: https://github.com/anhnda/IGLens.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑