How long is a piece of string? A brief empirical analysis of tokenizers
Abstract
Frontier LLMs are increasingly utilised across academia, society and industry. A commonly used unit for comparing models, their inputs and outputs, and estimating inference pricing is the token. In general, tokens are used as a stable currency, assumed to be broadly consistent across tokenizers and contexts, enabling direct comparisons. However, tokenization varies significantly across models and domains of text, making naive interpretation of token counts problematic. We quantify this variation by providing a comprehensive empirical analysis of tokenization, exploring the compression of sequences to tokens across different distributions of textual data. Our analysis challenges commonly held heuristics about token lengths, finding them to be overly simplistic. These findings show that native token counts are not a model-independent measurement unit, complicating comparisons of context length, inference cost, throughput, and benchmark sequence length across foundation models. We hope the insights of our study add clarity and intuition toward tokenization in contemporary LLMs.