Back to the Catalog
llm
tokens
context-windows
prompt-caching
latency
structured-output

LLM Mechanics: Tokens, Context, and Cost

40 questions

A practical quiz about how LLM APIs handle tokens, context, sampling, caching, streaming, structured output, and knowledge cutoffs. It includes production scenarios and cost calculations.

Questions

  1. Not answered. What does a text LLM receive after tokenization?
  2. Not answered. Why can an LLM miscount the letter r in a word it can use correctly?
  3. Not answered. Which tokenization behaviors are possible?
  4. Not answered. Why are subword tokenizers useful?
  5. Not answered. How many input tokens does this toy tokenizer produce?
  6. Not answered. How should you count billable input tokens for a known model?
  7. Not answered. Can one visible emoji consume more than one token?
  8. Not answered. What is the difference between a context window and a maximum output limit?
  9. Not answered. What is the largest possible output in this request?
  10. Not answered. What can happen when an API request sets a maximum output of 2,000 tokens?
  11. Not answered. Does fitting a document inside the context window guarantee that every detail will be used reliably?
  12. Not answered. Which data can use a request's context budget?
  13. Not answered. What is the main risk of removing the oldest items from an overlong conversation?
  14. Not answered. What does an autoregressive text model repeatedly do during ordinary generation?
  15. Not answered. What does lowering sampling temperature usually do to the next-token distribution?
  16. Not answered. What does top_p: 0.9 mean in nucleus sampling?
  17. Not answered. How many candidates are retained by this top-p filter?
  18. Not answered. Why can the same visible prompt produce different answers?
  19. Not answered. When a model supports temperature 0, does that make its answer factually correct?
  20. Not answered. Which practices help reproduce or diagnose changes across repeated API runs?
  21. Not answered. Why might an API recommend tuning either temperature or top-p rather than both at once?
  22. Not answered. Which prompt layout is most likely to maximize prefix-cache reuse across many requests?
  23. Not answered. At what prompt length is OpenAI's automatic prompt caching enabled by default?
  24. Not answered. Which statements about OpenAI prompt caching are correct?
  25. Not answered. What is the total token cost for this ten-request workload?
  26. Not answered. Which one-character edit is likely to destroy more prefix-cache reuse?
  27. Not answered. What does a prompt-cache hit not mean?
  28. Not answered. Which metric tells you how quickly a streamed response starts?
  29. Not answered. What is the approximate post-start generation throughput in this trace?
  30. Not answered. Which statements about streaming a text response are correct?
  31. Not answered. How should a client handle text deltas from an HTTP server-sent event stream?
  32. Not answered. Which change usually reduces total generation latency most directly?
  33. Not answered. If streamed and non-streamed requests generate the same tokens, how does streaming alone affect token cost?
  34. Not answered. What does strict mode for Structured Outputs add beyond basic JSON mode?
  35. Not answered. What must an application still handle when using strict Structured Outputs?
  36. Not answered. Which schema rules does OpenAI document for strict Structured Outputs?
  37. Not answered. Why can the first request with a new Structured Outputs schema be slower?
  38. Not answered. What does a model's knowledge cutoff mean?
  39. Not answered. Which statements about knowledge cutoffs are correct?
  40. Not answered. Which practices make answers about fast-changing facts more reliable?