Стирание токенов как след неявных лексических элементов в языковых моделях на основе машинного обучения.
Token Erasure as a Footprint of Implicit Vocabulary Items in LLMs
June 28, 2024
Авторы: Sheridan Feucht, David Atkinson, Byron Wallace, David Bau
cs.AI
Аннотация
LLM обрабатывают текст как последовательности токенов, которые грубо соответствуют словам, при этом менее распространенные слова представлены несколькими токенами. Однако отдельные токены часто не имеют семантической связи с значениями слов/концепций, которые они включают. Например, токенизатор Llama-2-7b разбивает слово "northeastern" на токены ['_n', 'ort', 'he', 'astern'], ни один из которых не соответствует семантически значимым единицам, таким как "north" или "east". Аналогично, общие значения именованных сущностей, таких как "Neil Young", и многословных выражений, например "break a leg", нельзя непосредственно вывести из составляющих их токенов. Механически, как LLM преобразуют такие произвольные группы токенов в полезные представления более высокого уровня? В данной работе мы обнаружили, что представления последнего токена именованных сущностей и много-токеновых слов проявляют выраженный "эффект стирания", где информация о предыдущих и текущих токенах быстро забывается на начальных слоях. Используя это наблюдение, мы предлагаем метод "вычитывания" неявного словаря авторегрессивного LLM путем изучения различий в представлениях токенов по слоям и представляем результаты этого метода для Llama-2-7b и Llama-3-8B. На наш взгляд, это первая попытка исследовать неявный словарь LLM.
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.Summary
AI-Generated Summary