VKVlad KulikovPublic / lectures
RL for LLM1 / 13

Module 1. Introduction: Reinforcement Learning for LLMs

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 / 9 · Correct: 0

Question P01 · The limits of "an LLM is a policy"

Step 1.1.4 — An LLM as a policy: the exact correspondence and its boundary

single answer

In the token formulation st=(x,y<t)s_t=(x,y_{<t}), at=yta_t=y_t, and an LLM genuinely defines πθ(a∣s)\pi_\theta(a\mid s). What caveat does the module attach to that statement?

One correct option

Question P02 · Four questions instead of a label

Step 1.1.5 — Reward, return, discounting, and the RL objective

single answer

The module rejects "supervised learning has a right answer, RL only has a reward". What does it offer instead?

One correct option

Question P03 · What each abstraction hides

Step 1.2.1 — Three useful abstractions: response, token, and macro-action

multiple answers

The three formulations of an LLM task each hide something deliberately. Select every correct pairing.

Select all correct options

Question P04 · What a denser signal does not do

Step 1.2.2 — Sparse reward, credit assignment, and rollout cost

single answer

A value function, a group baseline and process rewards all make a sparse signal more informative. What does none of them do?

One correct option

Question P05 · Offline versus off-policy

Step 1.3.3 — Classical axes and their limits

single answer

Why are "offline" and "off-policy" not synonyms?

One correct option

Question P06 · The method map

Step 1.3.5 — SFT, DPO, PPO-RLHF, GRPO/RLVR, and Best-of-N

multiple answers

From the table in step 1.3.5 — which statements are true? Select all that apply.

Select all correct options

Question P07 · What the temperature formula describes

Step 1.4.2 — Temperature softmax: a first computable policy

single answer

The formula πi(T)∝exp⁡(zi/T)\pi_i(T) \propto \exp(z_i/T) and the monotonicity of entropy in TT are proved for fixed finite logits. Why need the API's temperature parameter not behave the same way?

One correct option

Question P08 · Entropy at a given temperature

Step 1.4.3 — Reproducible experiment: T↦H(T)T\mapsto H(T)

numeric answer · tolerance ±0.01

Logits z=(3,1,0)z = (3, 1, 0), temperature T=2T = 2.

What is the policy entropy in nats?

Question P09 · The exact corridor value under a finite horizon

Step 1.4.4 — Return and Monte Carlo evaluation in a corridor

coding task

A symmetric walk over cells 0..40..4; start at 22; left and right are equally likely. The episode terminates at 00 (reward 00) or at 44 (reward +1+1), and is also cut off after max_steps actions.

Specification: compute V(2)=Pr⁡(T4≤max_steps)V(2) = \Pr(T_4 \le \texttt{max\_steps}) exactly, by dynamic programming over the remaining step count — no simulation.

Input format: one line — max_steps. Output format: one line — the value (6 decimals).

Starter code:

def exact_corridor_value(max_steps: int) -> float:
    """Probability of reaching state 4 from state 2 within max_steps actions."""
    # YOUR CODE HERE
    raise NotImplementedError

if __name__ == "__main__":
    print(f"{exact_corridor_value(int(input())):.6f}")

Open tests:

stdinstdout
20.250000
40.375000
60.437500
200.499512

Question P10 · Standard error of the Monte Carlo estimate

Step 1.4.4 — Return and Monte Carlo evaluation in a corridor

numeric answer · tolerance ±0.002

The corridor return is a Bernoulli variable with p=1023/2048≈0.4995p = 1023/2048 \approx 0.4995. The estimate uses N=400N = 400 independent episodes.

What is the approximate standard error p(1−p)/N\sqrt{p(1-p)/N}?