Serving a Model: Batching, the Key-Value Cache and Quantisation · seed 1 · A4, ink-friendly. The answer key prints on its own page for grown-ups.

Serving tokens without recomputing the past

Computing · Machine Learning · ages 23-24
Name ______________________   Date ____________
  1. What does the key-value cache store?

    • The training dataset
    • Past attention keys and values
    • User passwords
  2. What work remains once model weights are frozen for serving?

    • Generating output tokens
    • Learning new weights
    • Labelling training data
  3. A served model produces output one token at a time.

    Circle one:   True   False

  4. What puts a ceiling on that batch growth?

    • Weight memory plus growing cached context per request
    • The number of users online
    • The training loss
  5. Why does cost per request fall as the batch grows?

    • Accuracy rises with batch size
    • Weights shrink with batch size
    • One round of weight reads serves many requests
  6. How do you judge whether quantisation was worth it?

    • By speed alone
    • By throughput and cost gains against measured accuracy loss
    • By model size alone
  7. Serving and training share the same bottleneck, so one tuning fixes both.

    Circle one:   True   False

  8. Long-context traffic grows and batches must shrink. What explains the squeeze?

    • Tokenizers slow down
    • Training restarts nightly
    • Cached context per request eats the memory batching needs
LightMySky · lightmysky.comW1-mt_Nv1-WLGIO4-s1

Answer key

For grown-ups. Fold this page away before handing over the rest.

Serving tokens without recomputing the past W1-mt_Nv1-WLGIO4-s1

  1. Past attention keys and values · Stored keys and values spare earlier tokens from recompute.
  2. Generating output tokens · Serving is inference: read tokens so far and pick the next.
  3. True · Each pick extends the context for the next pick.
  4. Weight memory plus growing cached context per request · Weights and per-token caches together fill memory.
  5. One round of weight reads serves many requests · Batching amortises the slow memory reads across requests.
  6. By throughput and cost gains against measured accuracy loss · Both sides of the trade need numbers from your own tasks.
  7. False · Bandwidth limits serving while compute limits training.
  8. Cached context per request eats the memory batching needs · Stored context grows with request length, crowding out batch slots.
Worksheet · LightMySky