{"slug": "how-an-llm-turns-words-into-numbers-and-what-those-numbers-cost", "title": "How an LLM Turns Words Into Numbers — and What Those Numbers Cost", "summary": "A language model cannot read letters or words, only numbers, so every input sentence is first broken into tokens — fragments that are usually larger than a letter and often smaller than a word — and each token is assigned a fixed integer ID from the model's vocabulary. Common words stay whole and are cheap, while long rare words split into reusable pieces that drive up the token count and therefore the cost, as illustrated by the sentence \"I love tokenizing unhappiness\" which becomes seven tokens from four words.", "body_md": "Member-only story\n\n# How an LLM Turns Words Into Numbers — and What Those Numbers Cost\n\nA language model can’t read. It has no letters and no words — only numbers. So the first thing that happens to your sentence is a translation, and that translation quietly decides your bill. Let’s follow one real sentence all the way through.\n\n### Step 1: Break the sentence into tokens\n\nThe model works with tokens — fragments usually bigger than a letter and often smaller than a word. Common words stay whole; rare ones split into reusable pieces. Take this sentence:\n\n“I love tokenizing unhappiness.”\n\nIt breaks apart roughly like this:\n\n```\n[\"I\", \" love\", \" token\", \"izing\", \" un\", \"happiness\", \".\"]\n```\n\nSeven tokens from four words. Look at the split: `love`\n\nstayed whole (it's common), but `tokenizing`\n\nbecame `token`\n\n+ `izing`\n\n, and `unhappiness`\n\nbecame `un`\n\n+ `happiness`\n\n. That `izing`\n\npiece is reused across *organizing*, *realizing*, *criticizing* — the model learned it once. The lesson is already visible: short common words are cheap, long rare words are expensive.\n\n### Step 2: Turn tokens into numbers\n\nEach token has a fixed entry in the model’s vocabulary — an integer ID:\n\n```\n[\"I\", \" love\", \" token\", \"izing\", \" un\", \"happiness\", \".\"]…\n```\n\n", "url": "https://wpnews.pro/news/how-an-llm-turns-words-into-numbers-and-what-those-numbers-cost", "canonical_source": "https://blog.devgenius.io/how-an-llm-turns-words-into-numbers-and-what-those-numbers-cost-a1fae5bf0c82?source=rss----4e2c1156667e---4", "published_at": "2026-07-24 08:38:53+00:00", "updated_at": "2026-07-24 08:57:39.905053+00:00", "lang": "en", "topics": ["large-language-models", "natural-language-processing", "ai-infrastructure"], "entities": [], "alternates": {"html": "https://wpnews.pro/news/how-an-llm-turns-words-into-numbers-and-what-those-numbers-cost", "markdown": "https://wpnews.pro/news/how-an-llm-turns-words-into-numbers-and-what-those-numbers-cost.md", "text": "https://wpnews.pro/news/how-an-llm-turns-words-into-numbers-and-what-those-numbers-cost.txt", "jsonld": "https://wpnews.pro/news/how-an-llm-turns-words-into-numbers-and-what-those-numbers-cost.jsonld"}}