Back to articles

Translated vocabulary

Tokens: why does Portuguese take more space?

What a token is, and why the language changes how much fits in a conversation.

The title of this page asks a question whose premise you should measure, not accept: does Portuguese really take more space? What the sources support is more general, and that is what this text presents.

Phenomenon

A token is the unit the model processes, and tokens are how a conversation's size is measured and, on commercial APIs, how cost is measured. The same content, written in different languages, can become very different numbers of tokens. How much fits in the context window depends on that.

Mechanism

Anthropic's glossary says that, for Claude, a token represents roughly 3.5 characters of English, and that the exact number varies by language. What a token is depends on how the tokenizer was trained: Ahia et al. (EMNLP 2023) write that what counts as a token depends on the training data and the model, with large variation in the number of tokens needed to convey the same information in different languages. Looking at the OpenAI API across 22 languages, they show evidence that speakers of many languages pay more and get worse results. Petrov et al. (NeurIPS 2023) measured the same text translated into several languages and found tokenization-length differences of up to 15 times, including in tokenizers trained for multilingual support. According to the authors, that affects cost, processing time, and how much content fits as context. The count also changes between models. Anthropic's token-counting documentation says that models from Claude Opus 4.7 onward use a new tokenizer, that the same text produces about 30% more tokens than on earlier models, and that you should count again on the model you intend to use.

What this does not prove

It does not prove that Portuguese uses more tokens than English. The summaries of the studies cited talk about disparity between languages in general, and those summaries do not give numbers specific to Portuguese. Those numbers have to be measured, which is what the check below does. It also does not prove that more tokens mean worse answers: Ahia et al. report worse results in several languages, but that is a measurement on specific benchmarks.

A check you can run

Measure it in your case. 1. Take a Portuguese text of about 500 words and a translation of it into English. 2. Count the tokens of each with the same tokenizer. Anthropic's API has a free counting endpoint (documentation below). The documentation warns that the count is an estimate and can differ a little from real usage. 3. Divide the two numbers. That ratio is the answer for your text and your model, and only for them. 4. Repeat with a second model and compare. Sources: Anthropic, Glossary (Tokens): https://platform.claude.com/docs/en/about-claude/glossary (opens in a new tab) Anthropic, Token counting: https://platform.claude.com/docs/en/build-with-claude/token-counting (opens in a new tab) Petrov et al., Language Model Tokenizers Introduce Unfairness Between Languages, NeurIPS 2023: https://arxiv.org/abs/2305.15425 (opens in a new tab) Ahia et al., Do All Languages Cost the Same? Tokenization in the Era of Commercial Language Models, EMNLP 2023: https://aclanthology.org/2023.emnlp-main.614/ (opens in a new tab)

Comments

Loading comments…