LearnThatStack Ace your next interview
LLM Fundamentals · question
Question 3 of 58

Why do token counts matter so much in practice?

beginner
← All LLM Fundamentals questions
Re-explain

Tokens are the unit a model bills, limits and produces. So the token count of a request sets its cost, whether it fits, and how long it takes.

  • Cost. Providers charge per token, and output tokens usually cost several times more than input tokens.
  • Fit. The prompt plus the output must fit the context window, or the call errors or gets truncated.
  • Latency. The model produces output tokens one at a time, so time to finish tracks output length.

A small prompt change can double the bill across millions of calls. So trim old chat history, and set a real max_tokens on every request.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

The diagram below the answer is the concept . Jump to it ↓

Tailored explanation · switch back to · ·
What should the new diagram focus on?
Guided practice for LLM Fundamentals One question at a time. Answer out loud, get graded, see what you missed.
How well did you know this?
AI:

Saved in this browser - sign in to keep your review list.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Interview lens How interviewers actually use this question

Likely follow-ups

What you can say

  1. Tokens are the unit a model bills, limits and produces, so a request's token count decides what it costs, whether it fits, and how long it takes.
  2. On cost, providers charge per token, and output tokens usually cost several times more than input tokens.
  3. On fit, the prompt plus the output has to fit in the context window, or the call errors or the output gets cut off.
  4. On latency, the model writes output one token at a time, so the time to finish grows with the length of the answer.
  5. It adds up fast at scale, because a small change to the prompt can double the bill across millions of calls.
  6. So I trim old chat history and set a real max_tokens on every request, sized to the answer I expect, because a cap that's too tight truncates the output.

Weak answers to avoid

  • Only says tokens cost money Cost is one effect out of three. Also cover fitting in the context window and latency that grows with output length, or the answer sounds like a note about billing.
  • Treats input and output tokens as equal Output tokens usually cost several times more and set how long the call takes. If you miss that, you miss the main lever, which is capping output with max_tokens.
  • Equates tokens with words A token is not a word, so budgets built on word counts drift. Say you would count tokens with the model's own tokenizer before relying on the number.
  • Explains the why but gives no action If you stop at why it matters, the answer sounds academic. End with what you do about it: trim old history and set max_tokens on every call.
Interview lens

Likely follow-ups, what you can say, and the weak answers to avoid.

Sign in free to open it Free account - the lens opens as soon as you're back.

Want a quick review of the fundamentals? See the LLM Fundamentals cheatsheet.

From the blog: Jev explained: the AI model that returns decisions, not text

← Back to all LLM Fundamentals questions
Pro · $10/mo

51 of 58 LLM Fundamentals answers are in Pro.

Full answers, code samples, and AI explanations that go simpler or deeper. Cancel anytime.

  • Full answers + code
  • AI explanations, simpler or deeper
  • 1,000 AI credits / month
  • Cancel anytime