Token problems: 3 of 20
By Prof. Tom Yeh
Published: 2026-05-28
URL: https://www.byhand.ai/p/library-agents-tokens-punctuation-counts
Token problems: the workbook
- Punctuation Counts
Does punctuation count as a token? Yes. Most tokenizers treat each mark as its own token, carrying structure the model needs: sentence boundaries, pauses, questions. Agents that read or write code, JSON, or structured data pay this cost on every bracket and comma.
Problem
An AI agent counts each punctuation mark as its own token. The agent receives Hello, world!. How many tokens does it count?
Write each token in a box

Count the filled boxes

Practice 1
An AI agent counts each punctuation mark as its own token. The agent receives Wait, what?. How many tokens does it count?
Write each token in a box

Count the filled boxes

Practice 2
An AI agent counts each punctuation mark as its own token. The agent receives Stop, look, and listen!. How many tokens does it count?
Write each token in a box

Count the filled boxes

Next: 4. Tokens per Word