Tokenisation precedes a text embedding: the ID identifies a vocabulary entry, while the embedding supplies its numerical representation. ID 12 does not mean twice as much as ID 6. The numbers are labels, not financial quantities or semantic distances.
Two words, three tokens
interest rates. For this illustration, give the tokenizer the following fictional vocabulary and segmentation. Preserve the space, perform no normalisation and add no special tokens.| Piece, with quotes delimiting its characters | Vocabulary ID | Character count |
|---|---|---|
"interest" | 7 | 8 |
" rate" — starts with a space | 12 | 5 |
"s" | 3 | 1 |
[7, 12, 3]. There are 14 characters including one space, two words under whitespace splitting, and three tokens under this fictional rule. All characters here are ASCII, so the UTF-8 encoding also occupies 14 bytes. That equality is incidental: the single Unicode code point € occupies three UTF-8 bytes. A user-perceived character can itself contain several code points, so “character count” also needs a convention outside this ASCII example.The vocabulary was supplied, not learned by BPE or taken from a commercial model. Nothing here establishes a universal characters-per-token ratio. Another tokenizer can split the same phrase differently and assign entirely different IDs. Even a vocabulary alone may leave several possible segmentations: the segmentation rule selects among them.
How subword vocabularies are learned
Whole-word vocabularies need a policy for unseen names and spellings. Subword methods can represent many unfamiliar words by reusing smaller pieces. Those pieces need not coincide with meaningful roots or suffixes.
For a pretrained model, use its matching tokenizer and vocabulary. Substituting another tokenizer changes what the IDs denote. Training a tokenizer on financial language may alter sequence lengths, but it does not by itself teach a model accounting or establish predictive value.
The space and the decimal point matter
▁. A marker shown by one library is not a universal token format.BRK.B, US10Y, 25bps, 2.5% and USD 1.2bn before choosing cleaning rules. A period may belong to a ticker or a decimal; a percent sign or unit suffix carries economic meaning. Splitting a unit across pieces need not destroy it when the model retains the sequence. Deleting punctuation or dropping the suffix before tokenisation can destroy it. These are diagnostic examples, not claimed token counts for a particular model.Count the actual model input
Context capacity is measured using the model's tokenisation and input format. Instructions, document text, conversation formatting and special tokens can all occupy space; generation also needs room under the system's applicable limits. Count the final formatted input rather than estimating capacity from pages or English words. Truncation can otherwise remove the covenant qualification or risk-factor sentence the analysis needed.
Under a simple tariff with separate rates per million input and output tokens, the token charge is
Here the counts are billable tokens and the rates are currency per million tokens. This is an illustrative billing structure, not a product quotation; it excludes any separately priced categories or charges. No context size, price or model-specific count is asserted here.
For reproducible research, record the tokenizer version or artifact, vocabulary, normalisation, special-token policy and truncation rule alongside the model checkpoint. Preserve the original text so a changed cleaning rule can be audited. If fitting a tokenizer for a historical forecasting test, fit it within the eligible training corpus rather than using future disclosures to choose its vocabulary.
Sources
- Sennrich, Haddow and Birch (2016), Neural Machine Translation of Rare Words with Subword Units, §3.2 and Algorithm 1: character-based BPE training and application of learned merges.
- Wu et al. (2016), Google’s Neural Machine Translation System, §4.1: likelihood-based WordPiece vocabulary construction.
- Kudo (2018), Subword Regularization, §3.2: unigram probabilities, best segmentation and vocabulary pruning.
- Hugging Face, The tokenization pipeline, normalisation through post-processing; documentation checked 1 November 2026.
- Google, SentencePiece: Whitespace as a Basic Symbol, whitespace representation; documentation checked 1 November 2026.