VKVlad KulikovPublic / lectures
Modern LLMs15 / 20

Module 15. Reasoning Models and Test-Time Compute

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 KB

The archive preserves the source folder structure, both languages, and supporting files.

E1. Oracle coverage

Compute oracle coverage for p=0.25p=0.25 at N=1,4,8,16N=1,4,8,16. Explain why the table does not describe a verifier.

Show answer and solution

Solution. Under independent attempts, no candidate is correct with probability (1−p)N(1-p)^N, so oracle coverage is 1−(1−p)N1-(1-p)^N.

NNcoverage
10.250000
40.683594
80.899887
160.989977

This is the probability that a correct candidate exists; calculating it needs no verifier at all. It would equal system accuracy under perfect selection. The table specifies no real verifier TPR/FPR and therefore does not predict which candidate will be selected.

E2. Non-uniform distractors

Modify the exact voting model so that two distractors are common and four are rare. Compare it with the uniform-distractor case.

Show answer and solution

Solution. Make the comparison concrete by keeping pcorrect=0.4p_{correct}=0.4 and allocating the remaining 0.6 as (0.20, 0.20, 0.05, 0.05, 0.05, 0.05); the uniform baseline has six distractors at 0.10. In the multinomial-composition enumeration, replace only the probability vector and keep the tie rule fixed.

NNunique mode, uniformunique mode, skewrandom tie, uniformrandom tie, skew
10.4000000.4000000.4000000.400000
30.3520000.3520000.4720000.460000
50.5094400.4566400.5958400.554380
90.6710580.5831200.7370350.657549
170.8566880.7285380.8893160.775702

Common distractors consolidate wrong votes and compete more often with the correct mode. Equal one-shot correctness therefore does not imply equal self-consistency gains.

E3. Noisy verifier

Plot the noisy-verifier curve through N=64N=64 for TPR =0.85=0.85 and FPR =0.10=0.10. Identify diminishing returns.

Show answer and solution

Solution. Use the module scenario pcorrect=0.4p_{correct}=0.4: independently accept a correct candidate with probability 0.85 and an incorrect one with 0.10; select uniformly among accepted candidates and fall back to a random generated candidate if none are accepted. Exact enumeration gives:

NNaccuracy
10.400000
20.580000
40.752800
80.837403
160.849788
320.850000
640.850000

Gains diminish sharply around N=8N=8. The limit is q=0.4⋅0.85/(0.4⋅0.85+0.6⋅0.10)=0.85q=0.4\cdot0.85/(0.4\cdot0.85+0.6\cdot0.10)=0.85. Its equality to TPR is a numerical coincidence; the limit is correctness conditional on acceptance. §7 already provides a counterexample: TPR =0.90=0.90 gives a limit of 12/1312/13.

E4. FP8 KV

Recompute the KV table for 48 layers, KV width 512, and fp8 storage.

Show answer and solution

Solution. FP8 uses one byte per element, and K and V are stored separately:

Mtoken=2⋅48⋅512⋅1=49152 bytes=48 KiB.M_{token}=2\cdot48\cdot512\cdot1=49152\ \text{bytes}=48\ \text{KiB}.

TokensKV per request
5120.023438 GiB
1,0000.045776 GiB
4,0000.183105 GiB
16,0000.732422 GiB
64,0002.929688 GiB

This is 128/48=2.667128/48=2.667 times smaller than the original 128 KiB/token scenario. It is payload only, excluding scales, alignment, allocator overhead, and runtime buffers.

E5 [project]. Adaptive policy

Design an adaptive policy for a chat/code/math workload. Specify the routing signal, stopping rule, and cost of each routing error.

Project demos and guidance

Demo for this project exercise: English project-demo notebook for Module 15, sections “Demo 1” and “Demo 2” as starting points for this module’s projects. It shows a compact reproducible example on small inputs, not a completed solution to the full-scale project.

E6 [project]. API passport

Build a reasoning passport for one current API model using only official documentation, and record the snapshot date.

Project demos and guidance

This is an independent project task. Use the module’s demonstration notebooks as guidance.

Module notebooks

E7 [project]. Matched budget

Propose a matched-budget comparison between one long trajectory and eight short candidates.

Project demos and guidance

This is an independent project task. Use the module’s demonstration notebooks as guidance.

Module notebooks

E8. Unit tests as a verifier

Explain how a unit-test suite can be both more reliable than an LLM judge and still incomplete.

Show answer and solution

Solution. With fixed inputs and a deterministic environment, a test reproducibly checks a stated requirement. Answer position and verbosity do not change its verdict, and a failure supplies a counterexample. A suite nevertheless checks only its recorded inputs and assertions. A program may overfit visible examples or violate uncovered edge cases, security requirements, or performance constraints. A nondeterministic environment can also make a test flaky. Passing therefore supports correctness within tested coverage; hidden cases, property tests, fuzzing, and review of the specification provide additional evidence.