Module 19. Evaluating Modern LLM Systems: From Benchmarks to Decisions
Try each exercise first. Expand worked answers or project guidance when needed; their open state is shared between RU/EN.
Download course files (.zip) 2588.1 KBThe archive preserves the source folder structure, both languages, and supporting files.
E1. Discrimination and paired comparison
Plan N=500 tasks per system assuming success probabilities 0.955 and 0.950. Compute the rough standard error and under the independent-rate approximation. Then use a paired 200-item table with 150 both correct, 20 A-only, 10 B-only, and 20 both wrong to compute the exact two-sided McNemar value.
Show answer and solution
Solution. Under the rough independent-rate approximation,
The assumed 0.005 difference is much smaller than the planned half-width ; these settings cannot promise fine discrimination. An observed interval requires actual outcomes. In the paired table, accuracies are and , but McNemar uses only 30 discordant outcomes. Under the null, A-only count is ; the exact two-sided value is . Pairing preserves information lost in two aggregate rates.
E2. Finite-sample pass@k
For , , compute unbiased pass@1, pass@5, and pass@10, then compare them with the plug-in formula.
Show answer and solution
Solution. Of generated programs, are correct. The probability that a size- subset contains no correct program is , hence
For , values are 0.2000, 0.718266, and 0.956656 at . The plug-in approximation gives 0.2000, 0.672320, and 0.892626 because substituting the noisy observed proportion into a nonlinear function introduces bias. The combinatorial estimator is unbiased under independent draws from one fixed sampling policy. The rise from one to ten samples measures candidate-generation headroom with a selector, not reliability of one deployment call.
E3. Judge, working context, and golden-set size
A judge gives A 650 wins out of 1,000 when A is first and 350 after swapping. Compute the average rate for candidate A. For , compute mean accuracy and the share above 0.9. Finally, plan a golden set for and a three-point half-width.
Show answer and solution
Solution. Candidate A's two-order average is ; a fixed first position would show 0.65 versus 0.35 and create a false 30-point gap.
For , mean accuracy on is . The condition is ; combining the intervals at both edges gives share
The normal planning approximation gives , so round up to 683. A final interval should use a method such as Wilson; this formula explains the planning size.
The project notebook saves outputs from two rules on 200 fictional refund requests. A ignores packaging integrity; B mishandles the 30-day boundary. A passes the ordinary suite but fails critical exceptions; B passes exceptions but misses four ordinary cases. The trajectory suite performs repeated ledger writes and inspects final state. Neither system passes all predeclared gates. These are deterministic teaching rules, not LLM results or sampled customer traffic.
In this experiment A gets 200/200 ordinary requests right and B gets 196/200. The difference is 0.02; a paired percentile bootstrap with 5000 resamples gives [0.005, 0.04], while exact McNemar gives . There are only four disagreements, all in one direction. The empirical bootstrap cannot create a B-only success absent from its source data and may give an overconfident interval near this boundary. Do not declare a win from that interval alone; repeated fictional templates also provide no evidence of customer-level generalization.
E4 [project]
Build a 200–500 item call-once evaluation harness. Version prompts and models, preserve raw predictions, latency, and cost, compare two systems pairwise, and add both a bootstrap interval and McNemar analysis.
Project demos and guidance
Demo for this project exercise: English project-demo notebook for Module 19, section “Demo 1”. It shows a compact reproducible example on small inputs, not a completed solution to the full-scale project.
E5 [project]
Create three complementary suites for one application: normal traffic, rare critical cases, and an environment-based tool trajectory. Pre-register the primary metric and acceptable regression, then observe whether the preferred model changes across the three views.
Project demos and guidance
Demo for this project exercise: English project-demo notebook for Module 19, section “Demo 2”. It shows a compact reproducible example on small inputs, not a completed solution to the full-scale project.