All Questions
Llm Inference Serving easy

Your API lets clients omit max_tokens, and the default is the full 8K-token context. Most replies are under 300 tokens, but a few runaway generations loop for thousands of tokens. What does setting a sensible default cap, such as 1K tokens, accomplish?

  1. A It mainly speeds up prefill, since the server sizes the prompt's KV cache based on the max_tokens value.
  2. B It bounds worst-case decode time and KV memory per request, at the risk of cutting off long valid answers.
  3. C It has no effect on capacity, since KV cache is allocated only for tokens the model actually generated.
  4. D It lowers inter-token latency for every request, since each decode step is cheaper with a smaller cap.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions