Why can’t it write exactly 100 words?
Length control in LLMs: tokens are not words, and nothing counts while it writes · Beginner · 5 min · tokens, llm · after Next-token prediction
A language model writes tokens, not words, one at a time, with no running word count. It ends the answer when the length feels right, so a request for 100 words lands near 100, rarely on it.
1 Guess first
2 Look
Words in, tokens seen, limits missed
1 / 3You see: “We are met on a great battle-field of that war.”
The model sees:
Wearemetonagreatbattle-fieldofthatwar.10 words · 12 tokens · no word counter anywhere
Tokens measured with o200k_base (GPT-4o), tiktoken 0.14.0, 2026-10-23
It reads and writes tokens: “battle-field” is two, the full stop is one. Words exist only in your counter.
The model never sees words, only tokens, and it stops when the answer feels long enough.
A tokenizer cuts text into pieces that don’t match words, and the model writes one next token at a time. Nothing keeps a running word count: to hit 100 it has to sense, from the tokens so far, roughly where it is, and pick the end at the right moment. It lands near, rarely on.
4 You are the model
You are the model. You see your text as token chips, not words. Say how many words each one makes.
text 1 of 3 · all you see is chips (· = a space). How many words?
Thecatsatonthewarmmatbythedoor.Illustrative sentences; tokens measured with o200k_base (GPT-4o), tiktoken 0.14.0, 2026-10-23
You are the model. You see chips, not words. Count the words.5 Check
To get closer, ask for a range (“90 to 110 words”) or a shape (“5 sentences of about 20 words”): smaller things to keep track of. Reasoning models do better; a 2025 benchmark of 26 models found them best at following lengths. For an exact count, use a word counter and ask it to trim.
7 Say it back
8 Mission · 5 min
In ChatGPT Free, send “Write exactly 100 words about the sea.” Paste the answer into a word counter (a doc’s word count works). Then, in a new chat, send “Write 5 numbered sentences of exactly 20 words each about the sea.” Count again. Which came closer to 100, and by how many words?
Three quick ones
Drawn at random from this lesson's pool; different next time.
Done?
Get an email when new lessons come out
New lessons arrive in the weekly digest, only in a week that has one. You confirm by email first; unsubscribe in one click.
Go deeper
Sources
- Tokens measured with OpenAI’s tiktoken 0.14.0, o200k_base (GPT-4o), on 2026-10-23; words = runs of text between spaces. “We are met on a great battle-field of that war.” = 10 words, 12 tokens (We| are| met| on| a| great| battle|-field| of| that| war|.). First 100 words of the Gettysburg Address = 112 tokens; first 100 words of the Declaration of Independence = 117 tokens; “Our state-of-the-art e-bike costs $1,299.99 (incl. VAT) in 2026.” = 9 words, 24 tokens. Role sentences: 10 words 11 tokens, 7 words 12 tokens, 9 words 24 tokens
- Texts: Gettysburg Address, Bliss copy (https://www.abrahamlincolnonline.org/lincoln/speeches/gettysburg.htm, checked 2026-10-23); Declaration of Independence transcript, US National Archives (https://www.archives.gov/founding-docs/declaration-transcript, checked 2026-10-23). The product line and the role sentences are illustrative
- Yuan et al., “Following Length Constraints in Instructions” (arXiv:2406.17744, v1 2024-06-25, https://arxiv.org/abs/2406.17744, checked 2026-10-23). Table 2, AlpacaEval-LI (802 prompts, template “Answer the following instruction using <MAX_LEN> words or less.”, MAX_LEN = the shortest of three strong models’ answers, words counted with NLTK excluding punctuation), share of answers over the limit: GPT-4 Turbo (gpt-4-turbo-2024-04-09) 49.3%, GPT-4o (2024-05-13) 39.0%, Claude 3 Opus 37.0%, Llama 3 70B Instruct 10.2%
- Zhang et al., “LIFEBench: Evaluating Length Instruction Following in Large Language Models” (arXiv:2505.16234, v2 2025-06-11, https://arxiv.org/abs/2505.16234, checked 2026-10-23): 10,800 instances, lengths 16 to 8192 words, 26 models; most follow short lengths but deteriorate sharply beyond a threshold; reasoning LLMs achieve state-of-the-art length following
- aifree.dev catalog, chatgpt-free (verified 2026-10-12): free text chats on chatgpt.com
- Tokens per word in the text, from the counts above: 24 ÷ 9 = 2.67 (the product line), 112 ÷ 100 = 1.12 (Gettysburg), 117 ÷ 100 = 1.17 (Declaration). The 87-word reply and the “90 to 110 words” range are illustrative examples
- https://docs.x.com/fundamentals/counting-characters (X developer docs, checked 2026-10-26): “Posts on X can contain up to 280 characters”; emoji and CJK characters count 2, every link 23
Published Oct 23, 2026 · updated Oct 26, 2026