RAG Tokenization: Why Financial Text Costs 3x More and Causes Silent Truncation | Ameya
Liam, in for Ameya Deshmukh, shows that financial text tokenizes two to three times worse than plain prose. The video links that to cost, context limits, and silent truncation at 384 tokens, and recommends measuring and chunking by tokens.
Before a model can read a single chunk, your text becomes numbers: not characters, but tokens. In this video, Liam, in for Ameya Deshmukh, explains why financial text tokenizes two to three times worse than plain prose, and how that quietly costs you money, context, and sometimes your answer.
Fixed vocabularies and shredding
A tokenizer has a fixed vocabulary of about 30,000 subword units. A common word maps to one token, and anything outside the vocabulary gets shredded into pieces. So the same sentence can be short or long in tokens depending entirely on which words you used.
Two strings, same length
The video compares two strings with identical character counts. "The cat sat on a mat" is 20 characters and six tokens, each a whole word. A dollar figure with EBITDA and a ticker is also 20 characters but 13 tokens: the same length on the page, and more than double the cost to the model.
The shredding is visible in the output. EBITDA is not in the vocabulary, so it fractures into three pieces. The double-hash marker means a piece continues the previous word with no space. Numbers are the worst case: the dollar amount in the example costs seven tokens for nine characters. Rare tokens are expensive tokens.
Characters per token
The clean way to see this is characters per token, where higher is more efficient. Plain business prose runs about eight characters per token, and everyday English around four. A dense financial string with dollar signs and quarters drops to 1.67, which means paying almost a token per character.
Three consequences
Because financial text tokenizes two to three times worse, three things follow:
- Cost. APIs bill per token, so the same document is two to three times more expensive.
- Context. The window is measured in tokens, not characters, so it fills faster than you would expect.
- Truncation. This is the sneaky one.
The truncation trap
The video names a popular embedding model, all-mpnet-base-v2, which silently discards anything past 384 tokens. There is no error and no warning. You think you embedded the whole chunk, but you embedded the first part and threw the rest away. If your financial chunks are token-heavy, they hit that wall sooner than the character count suggests.
Measure and chunk by tokens
The practical fix is simple. If tokens matter to you, and for financial text they do, measure and chunk by tokens, not characters. Count tokens with the same tokenizer your model uses and set chunk limits against that number. Then a 400-character chunk that is secretly 600 tokens cannot ambush you. The video adds that printing your own tokens once makes the cost model stop being abstract.
Key takeaways
- Tokenizers map common words to one token and shred everything else into subword pieces.
- Two strings of 20 characters can be six tokens or 13, depending on the vocabulary.
- Plain business prose is about eight characters per token, everyday English about four, and a dense financial string 1.67.
- Higher token counts raise API cost and fill the context window faster.
- all-mpnet-base-v2 silently discards anything past 384 tokens.
- Count tokens with the model's own tokenizer and size chunks by tokens.
Try it yourself
Take a sample of your own corpus, tokenize it with your model's tokenizer, and report the characters-per-token ratio. Also count how many chunks would exceed the model's token limit. The video says that if that count is not zero, you have just found silent data loss before it cost you an answer.
Chapters
- 0:00Introduction: Tokenization Mechanics in RAG Pipelines
- 0:45Fixed Vocabularies and Subword Shredding
- 1:30Plain Prose vs Financial String Token Counts
- 2:15Characters Per Token Metric: Comparing English, Business, and Financial Text
- 3:00The Three Impact Pillars: Cost, Context Windows, and Truncation 03:45 Silent Data Loss: The 384 Token Limit in Common Embedding Models
Full transcript(auto-generated, with timestamps)
Introduction: Tokenization Mechanics in RAG Pipelines
[0:00]Namaste circumflex euros, this is Liam in for Amia. Build it with Claude then take it apart. Before a model can read a single chunk, your text becomes numbers a circumflex euros, not characters, tokens. And financial text tokenizes two to three times worse than plain prose. Today, why that quietly costs you money, context, and sometimes your answer. A tokenizer has a fixed vocabulary a circumflex euros, about 30,000 subword units. A common word maps to one token. Anything outside the vocabulary gets shredded into pieces. So, the same sentence can be short or long in tokens depending entirely on which words you used. Look at two strings with identical character counts. The cat sat on a mat a circumflex euros, 20 characters, six tokens, each a whole word. Now, a dollar figure with EBITDA and a ticker a
Fixed Vocabularies and Subword Shredding
[0:45]Circumflex euros, also 20 characters, but 13 tokens. Same length on the page, more than double the cost to the model. Watch how it shreds. EBITDA isn't in the vocabulary, so it fractures into three pieces. The double hash marker means this continues the previous word, no space. And numbers are the worst case a circumflex euros, that dollar amount costs seven tokens for nine characters. Rare tokens are expensive tokens. The clean way to see it is characters per token a circumflex euros, higher is more efficient. Plain business prose runs about eight characters per token. Everyday English around four. But a dense financial string with dollar signs and quarters drops to 1.67 a circumflex euros, you're paying almost a token per character. So, financial text tokenizing
Plain Prose vs Financial String Token Counts
[1:30]Two to three times worse has three consequences. Cost a circumflex euros, APIs bill per token, so the same document is two to three times more expensive. Context a circumflex euros, your window is measured in tokens, not characters, so it fills faster than you'd expect. And truncation, which is the sneaky one. Here's the trap. A popular embedding model, all-mpnet-base-v2, silently discards anything past 384 tokens. No error, no warning. You think you embedded the whole chunk. You embedded the first part and threw the rest away. If your financial chunks are token heavy, they hit that wall sooner than the character count suggests. This isn't theory a circumflex euros, it's the tokenizers actual output on the project's text. Feed it a clean sentence and you get whole word tokens. Feed it a
Characters Per Token Metric: Comparing English, Business, and Financial Text
[2:15]Financial string and you get this fractured list double hashes and all. Print your own tokens once and the cost model stops being abstract. So the practical move is simple. If tokens matter to you a circumflex euros and for financial text they do a circumflex euros, measure and chunk by tokens, not characters. Count tokens with the same tokenizer your model uses and set your chunk limits against that number. Then the 400 character chunk that's secretly 600 tokens can't ambush you. So keep three things. A tokenizer maps common words to one token and shreds everything else. So financial text costs two to three times more than prose. That hits cost, context, and truncation together. And models can truncate silently at their token limit a circumflex euros. Measure in tokens, not characters and
The Three Impact Pillars: Cost, Context Windows, and Truncation 03:45 Silent Data Loss: The 384 Token Limit in Common Embedding Models
[3:00]You'll never be surprised. Your turn. Take this prompt to your own corpus. Tokenize a sample with your model's tokenizer and report the characters per token ratio, plus how many chunks would exceed the model's token limit. If that count isn't zero, you just found silent data loss before it cost you an answer. Rag a circumflex euros tokenization. Count in tokens and nothing gets thrown away in silence. This is Liam in for Amy.
More from Humanitarians AI Fellows
3:25RAG Evaluation in Production: CI and CD Golden Set Gates and Live Monitoring
3:14RAG Embeddings: Mean Pooling, Memory Bandwidth, and the 12x Batching Speedup | Ameya
3:18RAG Chunking Explained: Fixed vs Recursive Splitting and Retrieval Quality | Ameya
2:05What Is An Agent Harness? | Aishwarya Patil
1:53What Is AI Red Teaming | Aishwarya Patil
4:14