arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2606.08562cs.CL
收藏

LLM单词工厂内部

Inside the LLM Word Factory

Stein Faculty of Computer and Information Science(Stein计算机与信息科学学院)

Benzi Busigin, Yuval Pinter

AI总结:

通过激活修补实验,定位Llama2-7B中英语去分词化过程为第1层的两阶段机制:注意力传递非最终子词的令牌特定信号,MLP将其与局部嵌入组合。该结构泛化至八族十二模型,但深度取决于位置编码类型。

摘要:

Transformer语言模型处理以子词片段形式提供的输入,但自然语言语义通常依赖于词级概念。去分词化是模型调和这两个事实的过程,通过计算将子词聚合成词级表示。先前工作发现这主要发生在早期到中间层,但迄今为止该过程的确切机制尚未确定。我们通过控制配对实验中的激活修补深入探究去分词化,隔离不同模型组件的贡献,将Llama2-7B中的英语去分词化定位到第1层的两阶段过程。注意力从非最终子词传输令牌特定信号,必要时使用顺序中继,而MLP将其与局部嵌入组合。这种两阶段结构泛化至八族十二模型,但其发生的深度取决于位置编码类型:基于RoPE的模型在1到5层内去分词化,而学习绝对位置的模型需要5到10层。最后,我们提供一种仅基于早期层激活来确定去分词化成功与否的探针,根据上下文量不同,AUROC在0.94到0.97之间。

英文摘要:

Transformer language models process input provided as subword fragments, but natural language semantics usually rely on word-level concepts. Detokenization is the process where models reconcile these two facts, aggregating subwords into word-level representations through their computation. Prior work has found that this takes place mostly in early-to-middle layers, but so far the exact mechanics of the process have not been pinned down. We venture deep into detokenization using activation patching in controlled paired experiments that isolate the contribution of different model components, localizing English detokenization in Llama2-7B to a two-stage process at Layer 1. Attention transmits a token-specific signal from nonfinal subwords, using sequential relays if necessary, while the MLP composes it with the local embedding. This two-stage structure generalizes to twelve models from eight families, but the depth over which it takes place depends on the flavor of positional encoding: RoPE-based models detokenize over 1 to 5 layers, while learned-absolute models take 5 to 10. Finally, we provide a probe for determining the success of the detokenization process based on early-layer activations alone, performing at 0.94-0.97 AUROC depending on the amount of context.

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

↑