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

基于权重的语言模型去标记化分析:无需推理即可理解推理的第一阶段

Weight-based Analysis of Detokenization in Language Models: Understanding the First Stage of Inference Without Inference

Tohoku University(东北大学);RIKEN(理化学研究所);Kyoto University(京都大学);MBZUAI(穆罕默德·本·扎耶德人工智能大学)

Go Kamoda, Benjamin Heinzerling, Tatsuro Inaba, Keito Kudo, Keisuke Sakaguchi, Kentaro Inui

AI总结:

本文提出无需推理仅通过分析模型权重理解语言模型去标记化阶段的方法,引入GPT-2第一层注意力解析分解,量化三类效应贡献,揭示注意力偏向邻近标记及去标记化机制的权重基础解释。

摘要:

根据推理阶段假设,语言模型的早期层会将子词标记化输入(不一定对应语言学意义上的有意义分割)映射到更有意义的表示,形成模型的“内部词汇”。此前对这一去标记化阶段的分析主要依赖探测和干预(如路径修补),这些方法需要选择特定输入、挑选要修补的组件子集,然后观察模型行为的变化。本文表明,去标记化阶段的几个重要方面可仅通过分析模型权重来理解,无需执行任何模型推理步骤。具体而言,我们引入了GPT-2第一层注意力的解析分解方法,该分解产生可解释的术语,用于量化位置相关、标记相关和混合效应的相对贡献。通过聚焦分解中的术语,我们发现了基于权重的解释,可说明注意力对邻近标记的偏向性以及用于去标记化的注意力机制。

英文摘要:

According to the stages-of-inference hypothesis, early layers of language models map their subword-tokenized input, which does not necessarily correspond to a linguistically meaningful segmentation, to more meaningful representations that form the model's "inner vocabulary". Prior analysis of this detokenization stage has predominantly relied on probing and interventions such as path patching, which involve selecting particular inputs, choosing a subset of components that will be patched, and then observing changes in model behavior. Here, we show that several important aspects of the detokenization stage can be understood purely by analyzing model weights, without performing any model inference steps. Specifically, we introduce an analytical decomposition of first-layer attention in GPT-2. Our decomposition yields interpretable terms that quantify the relative contributions of position-related, token-related, and mixed effects. By focusing on terms in this decomposition, we discover weight-based explanations of attention bias toward close tokens and attention for detokenization.

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

↑