2 "Tokenization" Posts

How Large Language Models (LLMs) Tokenize Text: Why Words Aren't What You Think

Understanding how LLMs break language into pieces—and why it matters more than you realize
What You'll Learn
  • Why language models break text into tokens instead of reading whole words
  • How subword tokenization balances vocabulary size with the amount of text a model must process
  • How Byte Pair Encoding (BPE) learns useful token boundaries from patterns in training data
  • Why the same sentence can use very different numbers of tokens across languages, code, and rare words
  • How tokenization can cause surprising failures in spelling, letter counting, and unusual inputs
  • Why token counts affect context limits, processing efficiency, and the cost of using an LLM

How Large Language Models (LLMs) Read Code: Seeing Patterns Instead of Logic

Exploring how large language models interpret code and what they miss
What You'll Learn
  • How an LLM reads code differently from a compiler or a human developer
  • Why models recognize programming patterns instead of executing the code they see
  • How embeddings let an LLM associate code with similar structures and meanings
  • Why comments, variable names, and familiar coding idioms can change a model’s interpretation
  • How statistically likely code can still be logically or operationally wrong
  • Why combining generative AI with compilers and static analysis produces safer coding tools