# Mission 3.1: Why does our German chatbot cost more?

Part of the course “AI from Zero to Autonomous Agents” (https://llm.yoga/en). Page for humans: https://llm.yoga/en/einsatz-3-1

Belongs to [Chapter 3: Tokens and next-token guessing](https://llm.yoga/en/03-tokens.md).

Structure: the case, the explanation, a hands-on tool, check questions, wrap-up. The answers to all questions are collected at the end.

## The case

**Jana**, runs customer service:

> “Our chatbot answers in German and in English: same model, same provider, same price per million tokens. Still, the bill for the German bot is higher than I expected. Is the provider charging us wrong?”

If someone in your company is planning a chatbot or has to explain an AI bill, this question ends up on your desk. Providers don’t bill by words but by tokens, the pieces a text is split into before it goes into the model. Before you answer Jana, make a prediction.

**Question 1 (prediction):** A German sentence with 9 words, and its English translation with 12 words. How many tokens does the German sentence need by comparison?

- A) Fewer, because it has three fewer words.
- B) The same number, despite the three fewer words.
- C) Twice as many, because of the long words.

## What’s behind it

A language model computes with numbers. Before a text goes in, a **tokenizer** splits it into pieces and replaces each piece with its number in a fixed list, the vocabulary. For Qwen3, the configuration file lists 151,936 entries. Common words are a single token; rare ones are split into parts, down to single bytes if needed, the smallest units a computer uses to store text.

Which pieces get their own token was decided by a method called byte pair encoding (BPE): on large amounts of training text, it merged the most frequent pair of neighbors into a new token, again and again. Most of that text is English. That’s why “ weather” has its own token, while the German „Wetter“ (weather) becomes „ W“ and „etter“. Long compound words are hit hardest: „Donaudampfschifffahrtsgesellschaftskapitän“ (Danube steamship company captain) falls apart into 17 pieces.

For Jana, this means the provider is billing correctly. Cloud providers bill by tokens, and German text usually needs more of them for the same content. The context window, the amount of text a model can see at once, is also measured in tokens. So a little less German text fits into it.

Two more things belong here. Every tokenizer splits differently, so counts don’t carry over from one model to another. And it changes even within the same provider: according to Anthropic, the maker of the Claude models, the new tokenizer starting with Claude Opus 4.7 produces about 30 percent more tokens for the same text than the old one.

### In more detail: BPE on five words

Corpus: “blau blau blau blass blatt” (German for blue, blue, blue, pale, leaf), each word split into letters. The most frequent neighbor pair is „b l“ (5 times); it becomes the token „bl“. Counting again, „bl a“ is the most frequent (5 times) and becomes „bla“. Next comes „bla u“ (3 times) and becomes „blau“. After three steps „blau“ is one token, „blass“ becomes „bla“ + „s“ + „s“, and a new word like „blank“ becomes „bla“ + „n“ + „k“.

Real tokenizers do this over billions of words and tens of thousands of merges. In the Qwen3 vocabulary, „ bl“ made it into a token, but „ blau“ did not.

## Try it

**Hands-on tokenizer**

**Task:** Write a sentence from your workday into both fields, once in German, once in English. Can you find one where the German needs at least one and a half times as many tokens?

**German:** starting sentence „Das Wetter ist heute schön und wir gehen spazieren.“

Tokens with their IDs: `Das` (32617) · `␣W` (467) · `etter` (21405) · `␣ist` (5999) · `␣heute` (48614) · `␣schön` (74764) · `␣und` (2030) · `␣wir` (16111) · `␣gehen` (62459) · `␣sp` (978) · `az` (1370) · `ieren` (16030) · `.` (13)

13 tokens · 51 characters · 9 words

**English:** starting sentence „The weather is nice today and we are going for a walk.“

Tokens with their IDs: `The` (785) · `␣weather` (9104) · `␣is` (374) · `␣nice` (6419) · `␣today` (3351) · `␣and` (323) · `␣we` (582) · `␣are` (525) · `␣going` (2087) · `␣for` (369) · `␣a` (264) · `␣walk` (4227) · `.` (13)

13 tokens · 54 characters · 12 words

The split above is precomputed with the Qwen3 tokenizer, the very one that runs in your browser as soon as you type. ␣ stands for a space that belongs to the token.

No German at hand? Long compound words work well, for example „Kundenservicemitarbeiterin“ (female customer service agent) or „Rechnungsprüfung“ (invoice check). The tokenizer runs entirely in your browser: Qwen3’s vocabulary and merge rules (Hugging Face, Qwen/Qwen3-8B, Apache 2.0 license) are loaded once when you first type, about 3 MB. Your text never leaves your device. Checked against llama.cpp’s counting program on the qwen3:8b model file: 15 of 15 test sentences identical, token for token.

## Check

**Question 2 (check question):** Jana wants to compare two providers. She counts her tokens with provider A’s tokenizer and uses that count for provider B’s price too. Does that work?

- A) Yes, a token is the same size everywhere.
- B) Only for English texts, where all of them split the same way.
- C) No, every provider splits text its own way.

**Question 3 (check question):** Why does Qwen3 split „Donaudampfschifffahrtsgesellschaftskapitän“ into 17 pieces?

- A) Because the whole word was too rare when the vocabulary was built.
- B) Because the tokenizer always splits long words into syllables.
- C) Because umlauts like „ä“ are missing from the vocabulary and come one by one.

**Question 4 (check question):** Jana wants to load a manual into the bot’s context window, in German or in English. What applies to the German version?

- A) More of it fits, because it has fewer words.
- B) Usually a little less of the text fits.
- C) No difference, both have the same number of pages after all.

## Done

**What you can do now**

- You can explain why a German bot costs more at the same price per token: German usually needs more tokens for the same content.
- You’ve seen with your own sentences how the tokenizer chops up compound words, because it learned mostly from English text.
- When a team plans the cost of a bot, you have sample texts in the customers’ language counted with the tokenizer of the model you actually plan to use.

### Two cards for review

**Card 1:** Someone estimates the cost of a German chatbot with the rule “one word, one token”. How far off is that?

- A) about right
- B) too low
- C) too high

**Card 2:** A colleague counted his texts with one provider’s tokenizer and wants to use that to estimate the cost at another provider. What do you tell him?

- [Next mission: Why does it answer differently every time?](https://llm.yoga/en/einsatz-3-2.md)
- [Try it on your Mac](https://llm.yoga/en/mac-3-1.md)

## Read more in the chapter

The full text from the chapter, with the reasoning, calculations and sources:

- [What a token is](https://llm.yoga/en/03-tokens-1.md)
- [How a tokenizer is built: byte pair encoding](https://llm.yoga/en/03-tokens-1.md)

## Answers: only reveal them after the learner has answered or explicitly asks

**Question 1:** The correct answer is B.
- A: That would hold if every word were one token. Counted with the tokenizer of Qwen3, the splitting program of this openly available model, „Das Wetter ist heute schön und wir gehen spazieren.“ needs 13 tokens, exactly as many as “The weather is nice today and we are going for a walk.”
- B, correct: Both sentences need 13 tokens, counted with the tokenizer of Qwen3, the splitting program of this openly available model. Since the German sentence has three fewer words, each German word needs more tokens on average (1.44 versus 1.08). That’s why the same content often costs a bit more in German.
- C: For this sentence it’s 13 tokens for both. The words here are short and common. With long compound words, German really can need a lot more; you’ll try that in a moment.

**Question 2:** The correct answer is C.
- A: Each provider builds its tokenizer on different data and with a different vocabulary size, so each one splits the same text differently. „Hallo, ich bin Leonard“ (German for “Hi, I’m Leonard”) is five tokens for Qwen3, while OpenAI’s tokenizer already splits “Leonard” into „Leon“ and „ard“.
- B: Every tokenizer splits English text differently, too. OpenAI’s rule of thumb, that a token is about four characters of English text, is only a rough estimate, not a count.
- C, correct: Because every tokenizer splits differently, counts don’t carry over. Jana has to count with each provider’s own tokenizer, and again after switching models at the same provider, as the Claude Opus 4.7 example shows.

**Question 3:** The correct answer is A.
- A, correct: BPE only merges frequent pairs. A rare compound word gets no token of its own and is built from smaller pieces that exist in the vocabulary. The tokenizer can still represent any word, byte by byte if it has to.
- B: The tokenizer knows nothing about syllables. When pieces sometimes look like syllables, that’s a coincidence of the learned merges: „D“, „ona“, „ud“, „amp“ are not syllables.
- C: The tokenizer can represent umlauts; „än“ even has its own token. What tips the scale is how rare the whole word is, not the umlaut.

**Question 4:** The correct answer is B.
- A: Fewer words doesn’t mean fewer tokens. The sentence from the prediction had three fewer words and still just as many tokens.
- B, correct: If the same content needs more tokens in German, it fills the window faster. Jana pays a bit more and gets a bit less text in.
- C: The window counts tokens, not pages or words. How much text fits therefore depends on the language and the tokenizer.

**Card 1:** Correct: B, too low German words are split into pieces more often. In the example sentence, one German word came to 1.44 tokens, one English word to 1.08. If you count words, you underestimate the tokens and therefore the bill, and less text fits into the context window than you think.

**Card 2:** Count again, with the other provider’s tokenizer. Every tokenizer was built on different data and splits the same text differently, rare compound words often into many pieces. Even switching models at the same provider can change the count: starting with Claude Opus 4.7, the new tokenizer produces about 30 percent more tokens, according to Anthropic.
