From Tokens to Words: On the Inner Lexicon of LLMs

要約

自然言語は単語で構成されているが、現代の大規模言語モデル(LLM)は、部分単語を入力として処理する。この矛盾から生じる自然な疑問は、LLMは単語を内部的に符号化しているのか、もしそうならどのように符号化しているのかということである。我々は、LLMが本質的なデトークニゼーションプロセスを行い、サブワード列が最後のトークンで首尾一貫した全単語表現に結合されるという証拠を提示する。我々の実験によれば、このプロセスは主にモデルの初期層と中間層で行われる。さらに、任意の分割(例えば、’cats’から’ca’と’ts’)、タイプミス、そして重要な語彙外単語に対して頑健であることを実証する。このような単語の最後のトークンの内部表現を入力としてモデルに与えると、学習中にそのような表現を入力として見たことがないにもかかわらず、完全な単語として「理解」することができる。この結果は、LLMがトークン化器の範囲を超えた潜在的語彙を保持していることを示唆している。これらの洞察は、訓練済みモデルの語彙を拡張するための、微調整不要の実用的なアプリケーションを提供する。新しい語彙の追加を可能にすることで、入力の長さと推論の反復を減らし、モデルの精度をほとんど落とすことなく、空間とモデルの待ち時間の両方を削減する。

要約(オリジナル)

Natural language is composed of words, but modern large language models (LLMs) process sub-words as input. A natural question raised by this discrepancy is whether LLMs encode words internally, and if so how. We present evidence that LLMs engage in an intrinsic detokenization process, where sub-word sequences are combined into coherent whole-word representations at their last token. Our experiments show that this process primarily takes place within the early and middle layers of the model. We further demonstrate its robustness to arbitrary splits (e.g., ‘cats’ to ‘ca’ and ‘ts’), typos, and importantly-to out-of-vocabulary words: when feeding the last token internal representations of such words to the model as input, it can ‘understand’ them as the complete word despite never seeing such representations as input during training. Our findings suggest that LLMs maintain a latent vocabulary beyond the tokenizer’s scope. These insights provide a practical, finetuning-free application for expanding the vocabulary of pre-trained models. By enabling the addition of new vocabulary words, we reduce input length and inference iterations, which reduces both space and model latency, with little to no loss in model accuracy.

arxiv情報

著者 Guy Kaplan,Matanel Oren,Yuval Reif,Roy Schwartz
発行日 2025-03-03 14:30:07+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, DeepL

カテゴリー: cs.AI, cs.CL パーマリンク