Exercise 3: The Mechanical Reason LLMs Struggle to Count Letters — Possible Solution ==================================================================== WHAT A SUBWORD TOKEN ACTUALLY REPRESENTS ------------------------------ Per this chapter's own warn-box, "a subword token like 'ing' or 'plor' carries no meaning of its own — it's a compression-driven engineering choice, not a linguistic one." A token is simply whichever character sequence happened to accumulate enough frequency in the training corpus to earn a merge — it is an opaque unit as far as the model's own downstream processing is concerned, not a container that preserves easy access to the individual letters composing it. WHAT THE MODEL ACTUALLY "SEES" WHEN PROCESSING A WORD ------------------------------ Per this chapter's own worked example, a word like "tokenization" is likely represented as two tokens — "token" and "ization" — rather than twelve individual letters. Once tokenized, the model's own internal processing operates on these two opaque chunks, not on the sequence of individual characters t-o-k-e-n-i-z-a-t-i-o-n. The letter-level composition of each token is not something the rest of the model directly receives as an input. WHY THIS SPECIFICALLY CAUSES UNRELIABLE LETTER-COUNTING ------------------------------ If asked "how many letter 'a's are in a word," a model working from tokens rather than individual characters has to somehow recover letter-level information that was never explicitly preserved past the tokenization step. Since a token like "ization" is treated as a single opaque unit, the model has no direct, reliable route to enumerating the individual characters inside it — it can only guess or approximate, based on whatever letter-level patterns it managed to infer indirectly during training, rather than reading them off directly the way it could if it had been given the raw character sequence. WHY THIS IS A MECHANICAL EXPLANATION, NOT JUST A DESCRIPTION OF THE SYMPTOM ------------------------------ It would be possible to simply observe "LLMs are bad at counting letters" without knowing why. This chapter's own tokenization material supplies the actual causal chain: BPE tokenization (this chapter) → subword tokens carrying no inherent letter-level structure (this chapter's own warn-box) → the model operating on opaque chunks rather than individual characters → unreliable performance on any task that specifically requires character-level counting. Each step follows from the one before it, rather than the behavior being an unexplained quirk. WHY THIS WORKS AS AN ANSWER ------------------------------ It traces the specific mechanical chain from BPE's own tokenization process through to why a model working from subword tokens rather than individual characters would struggle specifically with letter-counting tasks, using this chapter's own definition of what a subword token is and is not.