Your LLM sees tokens, not prompts: why tokenization shapes cost, context and multilingual quality

mdancho84 · x · 2026-12-02

A long-form primer for data scientists moving into AI engineering: LLMs never see your prompt — they see tokens, and tokenization quietly affects context window limits, API cost, code generation, numbers/identifiers, multilingual performance, embeddings, chat templates and training.

The author also debunks common misconceptions: BPE is not automatically byte-level, SentencePiece is not a tokenization algorithm, and token IDs carry no semantics. The attached image outlines a technical handbook covering Unicode/UTF-8, normalization, BPE and byte-level BPE, SentencePiece/Unigram/WordPiece, special tokens and chat templates, multilingual/code tokenization, context length and cost, and worked edge cases.

Original post →

More from coding & agent

coding & agent channel →