Token Erasure 作为 LLM 中隐式词汇项的足迹
Token Erasure as a Footprint of Implicit Vocabulary Items in LLMs
AI总结:
本文发现LLMs在处理多token单词和命名实体时存在“擦除”效应,并基于此提出一种通过检查各层token表示差异来“读出”自回归LLM隐式词汇的方法。
摘要:
LLMs 将文本处理为大致对应于单词的 token 序列,其中不常见的单词由多个 token 表示。然而,单个 token 通常在语义上与它们组成的单词/概念的含义无关。例如,Llama-2-7b 的分词器将单词 "northeastern" 拆分为 token ['_n', 'ort', 'he', 'astern'],这些 token 都不对应于像 "north" 或 "east" 这样具有语义意义的单元。同样,像 "Neil Young" 这样的命名实体和像 "break a leg" 这样的多词表达的整体含义无法直接从其组成 token 中推断出来。从机制上讲,LLMs 如何将这种任意的 token 组转换为有用的高层表示?在这项工作中,我们发现命名实体和多 token 单词的最后一个 token 表示表现出明显的 "erasure" 效应,即关于先前和当前 token 的信息在早期层中被迅速遗忘。基于这一观察,我们提出了一种方法,通过检查各层 token 表示的差异来 "读出" 自回归 LLM 的隐式词汇,并展示了该方法在 Llama-2-7b 和 Llama-3-8B 上的结果。据我们所知,这是探测 LLM 隐式词汇的首次尝试。
英文摘要:
LLMs process text as sequences of tokens that roughly correspond to words, where less common words are represented by multiple tokens. However, individual tokens are often semantically unrelated to the meanings of the words/concepts they comprise. For example, Llama-2-7b's tokenizer splits the word "northeastern" into the tokens ['_n', 'ort', 'he', 'astern'], none of which correspond to semantically meaningful units like "north" or "east." Similarly, the overall meanings of named entities like "Neil Young" and multi-word expressions like "break a leg" cannot be directly inferred from their constituent tokens. Mechanistically, how do LLMs convert such arbitrary groups of tokens into useful higher-level representations? In this work, we find that last token representations of named entities and multi-token words exhibit a pronounced "erasure" effect, where information about previous and current tokens is rapidly forgotten in early layers. Using this observation, we propose a method to "read out" the implicit vocabulary of an autoregressive LLM by examining differences in token representations across layers, and present results of this method for Llama-2-7b and Llama-3-8B. To our knowledge, this is the first attempt to probe the implicit vocabulary of an LLM.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。