Methods, as submitted
The algorithms
Plain-language summaries and the key formulas for every bandit in the lab. Each coursework algorithm is ported line for line from the 2023 notebook, so the “Port notes” record what the submitted code actually does wherever it differs from the paper.
Task 1.1 · Li, Chu, Langford & Wang (2011)
Offline replay with delayed feedback
The log was collected by a policy that chose uniformly at random, so the events where a bandit's choice coincides with the logged arm are an unbiased sample of what it would have seen online. Replay walks through the log, asks the bandit for an arm at every event, and only counts (and reveals) the matches.
For delays, the coursework version schedules every logged event to be revealed steps after it is read, and at each step hands the bandit the first revealed event that matches its choice. Lost feedback (a negative delay) is never revealed. Unlike the instant replay, it wraps around the log until the requested number of rounds has matched.
Port notes: what the 2023 code does
- Revealed events whose arm differs from the bandit's choice in that step are discarded, not kept for later.
- The lab adds a safety valve the notebook lacked: a delayed run that can never finish (for example 100% packet loss on an arm the bandit insists on) is stopped and reported as stalled.
Task 1.2 · Lancewicki, Segal, Koren & Mansour (ICML 2021)
Successive Elimination
Keep a set of active arms and pull them round-robin. Every arm carries a confidence interval around its observed mean; as soon as one arm's upper bound drops below another arm's lower bound, it can't be the best and is removed for good. With delays, the intervals simply use the feedback observed so far.
Port notes: what the 2023 code does
- n_i counts observed (matched) feedback; the mean divides by n_i + 10⁻¹⁰.
- The internal round counter t advances by |S| whenever all active arms have the same count; updates stop once t ≥ T.
- The elimination log uses np.any on the arm indices, so a round that eliminates only arm 0 is not recorded (the elimination itself still happens).
Task 1.3 · Lancewicki et al. (ICML 2021)
Phased Successive Elimination
Exploration happens in phases of growing length. At the start of phase ℓ the phase set copies the active set; each arm in it is pulled until it has enough observations for that phase, so an arm whose feedback is mostly lost cannot hold everyone else back. Elimination uses the same confidence intervals as SE.
Port notes: what the 2023 code does
- The threshold uses log₁₀ T (the paper's analysis uses the natural log) and compares the arm's total observations, not its observations within the phase.
- Arms are chosen from S_ℓ, so an arm eliminated from S mid-phase keeps being pulled until it reaches the phase threshold.
Task 1.4 · Lancewicki et al. (ICML 2021)
Optimistic-Pessimistic Successive Elimination
When feedback depends on the reward itself (say, non-clicks report late), the observed mean is biased. OPSE brackets the truth: missing feedback counts as 0 for a pessimistic lower bound and as 1 for an optimistic upper bound. Arms are eliminated only when even the optimistic view loses to another arm's pessimistic one.
Port notes: what the 2023 code does
- m_i (pulls) is incremented inside play(), which replay calls for every logged event, matched or not. Pulls therefore outrun observations ten to one, the optimistic bounds stay near 1, and on the course log no arm was ever eliminated.
- With every arm kept, OPSE pulls them evenly and its reward converges to the log's average click rate (0.2184 vs 0.2229).
Task 2 · after Agrawal & Goyal (COLT 2012)
Thompson Sampling (Gaussian)
Each arm's mean reward gets a Gaussian prior and rewards a Gaussian likelihood, so the posterior stays Gaussian and updates in closed form. Every round, draw one plausible mean per arm from its posterior and play the largest draw: uncertain arms win often enough to be explored, good arms win most of the time.
Port notes: what the 2023 code does
- The notebook's defaults μ₀ = 2.22, τ = 0.416, σ = 4 were tuned on the course log. With σ = 4 the prior dominates for hundreds of pulls, which is why posterior means sit well above the true click rates in the lab.
- Sampling uses the posterior variance as the normal's scale (rng.normal(mean, var)); the port keeps that.
- The 10-repeat helper constructed every bandit as mab_class(n_arms, n_rounds, rng=rng), which handed TS μ₀ = 20,000 (and an integer array that truncates every update). That is why the notebook's 10-repeat TS curve sits near 0.22 while its single run scored 0.4218.
Task 3 · Dimakopoulou, Ren & Zhou (NeurIPS 2021)
Doubly-Adaptive Thompson Sampling
DATS replaces the plain posterior with doubly-robust (augmented inverse-propensity) estimates whose adaptive weights stabilise the variance, so the arm means it samples from support valid confidence intervals even though the data were collected adaptively. It samples with an inflation factor κ, keeps a uniform exploration floor γ, and eliminates arms that are very unlikely to be best.
Port notes: what the 2023 code does
- The next arm is the one with the fewest multinomial draws, and its position in the active list is returned as if it were an arm id. Once arms are eliminated, DATS keeps playing arms 0 … |A|−1.
- The Monte-Carlo propensity p_a is proportional to the index of each arm's largest normal sample (np.argmax(r, axis=1)) rather than to how often the arm's sample is the largest.
- Every arm's pseudo-rewards use the reward just observed for the played arm, and n_pulls is incremented twice per update after the first round.
- On the course log it deactivated arm 2, the best arm, at its 28th round. After its fifth elimination, at round 854, the position bug confined it to arms 0–4. That explains its 0.245, below plain TS. The revival keeps the behaviour and documents it, and DR-003 measures what each quirk costs over 20 seeds.
Revival baseline · see Auer, Cesa-Bianchi & Fischer (2002)
ε-greedy (baseline, new in 2026)
With probability ε pull a uniformly random arm; otherwise pull the arm with the best running mean (unpulled arms count as infinitely good, so each is tried once). Not part of the coursework; included as a familiar yardstick.
Revival baseline · Auer, Cesa-Bianchi & Fischer (2002)
UCB1 (baseline, new in 2026)
Optimism in the face of uncertainty: add an exploration bonus that shrinks as an arm is pulled and play the arm with the highest mean plus bonus. Not part of the coursework; the classic reference point for SE.