Where is the signal in tokenization space?

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Geh, Renato Lui, Zhang, Honghua, Ahmed, Kareem, Wang, Benjie, Broeck, Guy Van den
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866912416496877568
author Geh, Renato Lui
Zhang, Honghua
Ahmed, Kareem
Wang, Benjie
Broeck, Guy Van den
author_facet Geh, Renato Lui
Zhang, Honghua
Ahmed, Kareem
Wang, Benjie
Broeck, Guy Van den
contents Large Language Models (LLMs) are typically shipped with tokenizers that deterministically encode text into so-called canonical token sequences, to which the LLMs assign probability values. One common assumption is that the probability of a piece of text is the probability of its canonical token sequence. However, the tokenization of a string is not unique: e.g., the Llama2 tokenizer encodes Tokens as [Tok,ens], but [Tok,en,s] also represents the same text. In this paper, we study non-canonical tokenizations. We prove that, given a string, it is computationally hard to find the most likely tokenization for an autoregressive LLM, as well as to compute the marginal probability over all possible tokenizations. We then show how the marginal is, in most cases, indistinguishable from the canonical probability. Surprisingly, we then empirically demonstrate the existence of a significant amount of signal hidden within tokenization space. Notably, by simply aggregating the probabilities of non-canonical tokenizations, we achieve improvements across a range of LLM evaluation benchmarks for a variety of architectures, including transformers and state space models.
format Preprint
id arxiv_https___arxiv_org_abs_2408_08541
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Where is the signal in tokenization space?
Geh, Renato Lui
Zhang, Honghua
Ahmed, Kareem
Wang, Benjie
Broeck, Guy Van den
Computation and Language
Machine Learning
Large Language Models (LLMs) are typically shipped with tokenizers that deterministically encode text into so-called canonical token sequences, to which the LLMs assign probability values. One common assumption is that the probability of a piece of text is the probability of its canonical token sequence. However, the tokenization of a string is not unique: e.g., the Llama2 tokenizer encodes Tokens as [Tok,ens], but [Tok,en,s] also represents the same text. In this paper, we study non-canonical tokenizations. We prove that, given a string, it is computationally hard to find the most likely tokenization for an autoregressive LLM, as well as to compute the marginal probability over all possible tokenizations. We then show how the marginal is, in most cases, indistinguishable from the canonical probability. Surprisingly, we then empirically demonstrate the existence of a significant amount of signal hidden within tokenization space. Notably, by simply aggregating the probabilities of non-canonical tokenizations, we achieve improvements across a range of LLM evaluation benchmarks for a variety of architectures, including transformers and state space models.
title Where is the signal in tokenization space?
topic Computation and Language
Machine Learning
url https://arxiv.org/abs/2408.08541