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