Module 3. Bandits, exploration, and one-step decisions
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 · Why "pseudo"
single answer
Pseudo-regret is not so named because it is fake. What does the prefix mean?
Question P02 · Regret from gaps and pull counts
numeric answer · tolerance ±0.5
Three arms with gaps were pulled on average times.
What is the expected regret ?
Question P03 · The limits of the UCB1 guarantee
single answer
The UCB1 bound gives . What follows from it, and what does not?
Question P04 · What transfers from UCB and Thompson
single answer
The module warns against porting bandit recipes to LLMs directly. Which transfer does it call useful?
Question P05 · Conditions for IPS unbiasedness
multiple answers
Which conditions are needed for to be unbiased? Select all that apply.
Question P06 · IPS, SNIPS and the effective sample size
coding task
Specification: weights . ; ; Kish effective sample size .
Input format: line 1 — the number of records ; then lines of r mu pi.
Output format: lines 1–3 — IPS, SNIPS and ESS (4 decimals).
Starter code:
import numpy as np
def offline_estimates(rewards, behavior, target):
"""Return (ips, snips, ess)."""
# YOUR CODE HERE
raise NotImplementedError
if __name__ == "__main__":
n = int(input())
rows = [tuple(float(x) for x in input().split()) for _ in range(n)]
r = [row[0] for row in rows]
mu = [row[1] for row in rows]
pi = [row[2] for row in rows]
ips, snips, ess = offline_estimates(r, mu, pi)
for value in (ips, snips, ess):
print(f"{value:.4f}")
Open tests:
| stdin | stdout |
|---|---|
3 ⏎ 1 0.2 0.6 ⏎ 0 0.5 0.1 ⏎ 1 0.3 0.3 | 1.3333 ⏎ 0.9524 ⏎ 1.7570 |
2 ⏎ 1 0.5 0.5 ⏎ 0 0.5 0.5 | 0.5000 ⏎ 0.5000 ⏎ 2.0000 |
Question P07 · What double robustness does not give
single answer
The DR estimator stays consistent if at least one of the two models is correct. What can it still not do?
Question P08 · Generation temperature versus training exploration
single answer
Why can raising the decoding temperature not be called exploration in the RL sense?
Question P09 · How many candidates Best-of-N needs
numeric answer · tolerance ±0.5
Each independent candidate succeeds with probability , and the verifier detects success without error.
What is the minimum number of candidates for a success probability of at least ?
Question P10 · Why Best-of-N is not a bandit
single answer
Why is ordinary Best-of-N with a frozen LLM not a standard online multi-armed bandit?
Question P11 · The unbiased pass@k estimator
coding task
Specification: a task produced programs of which passed the tests, . The finite-sample estimator is , with for .
Input format: one line — , , . Output format: one line — the estimate (6 decimals).
Starter code:
from math import comb
def pass_at_k(n: int, c: int, k: int) -> float:
# YOUR CODE HERE
raise NotImplementedError
if __name__ == "__main__":
n, c, k = (int(x) for x in input().split())
print(f"{pass_at_k(n, c, k):.6f}")
Open tests:
| stdin | stdout |
|---|---|
10 3 4 | 0.833333 |
8 2 2 | 0.464286 |
5 0 3 | 0.000000 |
6 6 2 | 1.000000 |
Question P12 · Entropy collapse: observation or theorem
single answer
A 2026 preprint reports a substantial entropy drop across several RLVR configurations on mathematics. How does the course ask you to read that?