Token-uitwissing als voetafdruk van impliciete vocabulaire items in LLM's
Token Erasure as a Footprint of Implicit Vocabulary Items in LLMs
June 28, 2024
Auteurs: Sheridan Feucht, David Atkinson, Byron Wallace, David Bau
cs.AI
Samenvatting
LLM's verwerken tekst als reeksen tokens die ruwweg overeenkomen met woorden, waarbij minder voorkomende woorden worden weergegeven door meerdere tokens. Individuele tokens zijn echter vaak semantisch niet gerelateerd aan de betekenissen van de woorden/concepten waaruit ze bestaan. Bijvoorbeeld, de tokenizer van Llama-2-7b splitst het woord "northeastern" in de tokens ['_n', 'ort', 'he', 'astern'], waarvan geen enkel token overeenkomt met semantisch betekenisvolle eenheden zoals "north" of "east." Evenzo kunnen de algemene betekenissen van eigennamen zoals "Neil Young" en uitdrukkingen met meerdere woorden zoals "break a leg" niet direct worden afgeleid uit hun samenstellende tokens. Mechanistisch gezien, hoe zetten LLM's dergelijke willekeurige groepen tokens om in nuttige hogere-niveau representaties? In dit werk ontdekken we dat de laatste token-representaties van eigennamen en woorden met meerdere tokens een uitgesproken "uitwissingseffect" vertonen, waarbij informatie over vorige en huidige tokens snel wordt vergeten in de vroege lagen. Gebruikmakend van deze observatie, stellen we een methode voor om het impliciete vocabulaire van een autoregressieve LLM "uit te lezen" door verschillen in token-representaties tussen lagen te onderzoeken, en presenteren we de resultaten van deze methode voor Llama-2-7b en Llama-3-8B. Voor zover wij weten, is dit de eerste poging om het impliciete vocabulaire van een LLM te onderzoeken.
English
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.