arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2412.05768cs.CLcs.AI
收藏

揭示Transformer推理中的不确定性

Uncovering Uncertainty in Transformer Inference

Johns Hopkins University(约翰斯·霍普金斯大学);Applied Physics Laboratory(应用物理实验室)

Greyson Brothers, Willa Mannering, Amber Tien, John Winder

AI总结:

本研究在Transformer语言模型中验证迭代推理假设,发现残差流词元嵌入损失递减且收敛速率反映生成不确定性,还提出基于交叉熵的不确定性检测方法,可在习语数据集上区分正确与错误生成。

摘要:

我们在基于Transformer的语言模型语境下探究迭代推理假设(Iterative Inference Hypothesis,IIH),旨在理解模型的隐层表征如何逐步细化,以及正确生成与错误生成之间是否存在可观测的差异。我们的研究结果为IIH提供了实证支持,表明残差流中的第n个词元嵌入遵循损失递减的轨迹。此外,我们观察到残差嵌入收敛至稳定输出表征的速率反映了词元生成过程中的不确定性。最后,我们提出一种利用交叉熵检测该不确定性的方法,并在一个习语数据集上证明了其区分正确与错误词元生成的潜力。

英文摘要:

We explore the Iterative Inference Hypothesis (IIH) within the context of transformer-based language models, aiming to understand how a model's latent representations are progressively refined and whether observable differences are present between correct and incorrect generations. Our findings provide empirical support for the IIH, showing that the nth token embedding in the residual stream follows a trajectory of decreasing loss. Additionally, we observe that the rate at which residual embeddings converge to a stable output representation reflects uncertainty in the token generation process. Finally, we introduce a method utilizing cross-entropy to detect this uncertainty and demonstrate its potential to distinguish between correct and incorrect token generations on a dataset of idioms.

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

↑