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

  1. Count the Tokens
  1. Subword Splitting
  1. Punctuation Counts
  1. Tokens per Word
  1. Will It Fit?
  1. The Price of a Call
  1. Two Kinds of Token
  1. Input or Output?
  1. The Two-Part Bill
  1. End-to-End Call Cost
  1. Comparing Three Calls
  1. The Average Call
  1. The System Prompt
  1. The System Prompt Tax
  1. Calls in a Budget
  1. Tokens on a Budget
  1. How Long Will It Take?
  1. The Split Matters
  1. Pricing per Million Tokens
  1. Tokens from the Bill

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