VKVlad KulikovPublic / lectures
RL for LLM12 / 13

Module 12. RL infrastructure for LLMs: memory, rollouts, and asynchrony

Choose your answers and select “Check”. Numbers accept a decimal point, comma, or simple fraction. Answers and drafts are saved in this browser and shared between RU/EN.

Use the author’s worked answers to review open questions and code tasks yourself. Code does not run on this site.

Checked: 0 / 10 · Correct: 0

Question P01 · Placement does not determine synchrony

The rollout engine is a separate vLLM server and the trainer is another process. Which statement is correct?

One correct option

Question P02 · Logical full-training memory

A model has 7 billion parameters. The profile uses 2 bytes for each model parameter, 2 bytes for its gradient, and 8 bytes for the two Adam moments. There is no master copy.

Compute the logical full-training state:

  1. in decimal GB;
  2. in binary GiB.

Round GiB to two decimal places.

Question P03 · KV cache for long responses

A teaching architecture has:

  • 32 layers;
  • 8 KV heads;
  • head dimension 128;
  • bf16 values, or 2 bytes per element;
  • 16 sequences with 8192 retained tokens each.

Estimate the useful KV-cache payload in GiB. Exclude pages, block tables, and temporary buffers.

Question P04 · Two architectural axes

Match each description to one combination.

  1. One GPU pool; generation finishes before training starts.
  2. Separate GPU pools with a shared batch barrier.
  3. One pool releases memory between phases and overlaps only limited preparation.
  4. A queue connects separate pools and the trainer may consume multiple policy versions.

Combinations:

A. colocated + synchronous;
B. disaggregated + synchronous;
C. colocated + limited overlap;
D. disaggregated + asynchronous.

Match each item to an answer

Question P05 · Pipeline fill and drain

Generating one batch takes G=45G=45 s and training it takes T=30T=30 s. There are n=8n=8 batches.

Compute:

  1. sequential time;
  2. ideal two-stage pipeline time;
  3. speedup.

Round the speedup to three decimal places.

Question P06 · A straggling response

Four rollouts run concurrently for 4, 4, 4, and 12 seconds. The batch closes only after the slowest rollout.

Compute useful utilization of the four-worker capacity.

Question P07 · First queue check

A queue receives 8 thousand tokens per second on average, while the trainer processes 10 thousand tokens per second.

  1. Compute ρ=λ/μ\rho=\lambda/\mu.
  2. Does the system pass the first-order stability check?
  3. Why does this not guarantee short delays?

Only your selection or numeric part is checked automatically. Compare your reasoning with the author’s worked answer.

Question P08 · Effective sample size

Importance weights for four rollouts are (1,1,1,5)(1,1,1,5).

Compute:

  1. ESS;
  2. normalized ESS.

Round to four decimal places.

Question P09 · Version age

The current trainer version is 112. Rollouts were collected by versions (108,109,110,110)(108,109,110,110).

Compute:

  1. version lags;
  2. mean lag;
  3. maximum lag.

Only your selection or numeric part is checked automatically. Compare your reasoning with the author’s worked answer.

Question P10 · Checkpoint interval

Writing a checkpoint takes C=120C=120 s and the mean time between failures in the simplified model is M=8M=8 hours.

Using Young's formula

I∗=2CM,I^*=\sqrt{2CM},

compute the interval in seconds and minutes.

Question P11 · Zero lag but nonzero mismatch

Rollout and trainer recomputation use the same weight version, so policy lag is zero. Sequence log-probabilities still differ.

Name at least four possible causes and give the correct diagnostic order.

Question P12 · Which rollout can be accepted

A collector sends tokens, a response mask, reward, and policy_version, but omits:

  • tokenizer and chat-template versions;
  • decoding parameters;
  • verifier version;
  • termination versus truncation.

May the trainer use this record? What should happen?