Skip to Content
Recodocs

03 · Spend inference compute

Choose two inspections before the shift ends, then measure what extra model samples buy when an exact solver and a strict verifier can check the result.

8 min read
Part 1
Measure the model
Model
Qwen2.5-1.5B-Instruct
Data
Synthetic facilities helpdesk
Hardware
Tesla T4 and CPU, in Google Colab
Open in Colab

Which two inspections fit before handover?

You’re the north-yard operator. On the synthetic Facilities Helpdesk board, five inspections are waiting, including the ventilation fan you looked up in Lesson 01. You have 28 minutes left. Pick exactly two assets from the board and earn as much total priority as you can. The two highest-priority cards take 29 minutes together, so choosing them would carry an inspection past handover.

Industrial ventilation fan representing F-250 on the north-yard inspection board.F-250 · Ventilation fan

North-yard Facilities Inspection Board

Pick two assets before the shift ends.

AssetMinutesPriority
F-2501514
V-2001410
P-210116
F-22074
V-23072

Change one fact. Start with 28 minutes left. Then give the operator 29 minutes with the same five inspection cards. Which pair would you submit for each shift?

Check which pair fits

28 minutes left. F-250 + P-210 takes 26 minutes and earns 20 priority points.

29 minutes left. F-250 + V-200 takes 29 minutes and earns 24 priority points.

At 28 minutes, fitting the two highest-priority cards would require one more minute.

Synthetic shift board from the paired development orders. Illustrative factory fan photo by Augapfel, cropped under CC BY 2.0.

More tokens bought no strict wins on these orders

Strict optimum rate versus mean token proxy per work order. Vote and Verify share a point at each matched budget.

1
0%50%100%90% target0200400600800Exact solverGreedy2 samples4 samplesMean proxy tokens per work order
Source: Lesson 03 verified T4 notebook. Exact solver timings use the Colab CPU.

Give each selector the same proposals

If two methods see different options, a better result might come from a better candidate rather than a better selector. Hold the options fixed when the experiment asks which selector is better.

For each order, the notebook sends Qwen the eligible assets, durations and priorities. It asks for a bare JSON array of two asset IDs. Greedy decodes one reply. At each larger sample count, Vote chooses the most frequent parsed pair, breaking ties by the earliest tied ballot. Verify chooses the highest-priority feasible parsed pair and returns an empty selection if none is feasible. Vote and Verify receive the same raw replies at their matched count.

OpenAI’s 2024 International Olympiad in Informatics evaluation used a fixed 50-submission cap per problem. The company reported 213 points for its selection strategy and estimated 156 points on average under random selection. That estimated comparator illustrates why comparisons should hold the allowance fixed and name how each selection result was obtained. Here the two selectors share the same generated batch. OpenAI, coding evaluation

The parser calls Python’s JSON decoder on the whole trimmed response. A decoding error produces an empty tuple. The next check confirms two distinct listed assets and tests whether their total duration fits. At 28 minutes, an exact grade also requires priority 20. If several feasible pairs reach the same best score, they can all pass.

# Parse the whole reply before checking the inspection constraints.
candidates = [parse_pair(answer) for answer in raw_candidates]
selected = choose_pair(order, candidates, policy)
verdict = grade_pair(order, selected, optimum)

The exact solver checks every two-asset combination from the board. For order ii, let AiA_i be the listed assets, BiB_i be the minutes left, and let each asset have duration tat_a and priority vav_a. Its objective is

Vi∗=max⁡P⊆Ai∑a∈Pva,∣P∣=2,∑a∈Pta≤Bi.\begin{aligned} V_i^* &= \max_{P\subseteq A_i}\sum_{a\in P} v_a,\\ &\quad |P|=2,\quad \sum_{a\in P} t_a\le B_i. \end{aligned}

A pair passes if its two assets are distinct and eligible, its total duration fits, and its priority equals the optimum. DoorDash reported that its replacement dispatch optimiser matched its incumbent in more than 99% of comparison cases and that the differences involved equally good solutions. Its comparison illustrates why the helpdesk grades the constraints and objective and allows different optimal pairs. DoorDash Engineering, dispatch optimisation

Every measured batch reached selection with an empty set of usable pairs

Parsed proposals, grouped by sample count on the same 24 work orders

2
SamplesNo feasibleFeasible onlyOptimum presentDistinct pairs¹
124/24000
224/24000
424/24000

¹ Median distinct parsed pairs per order.

Source: Lesson 03 verified T4 notebook, candidate-batch rollup. No feasible = all orders minus orders with a feasible parsed proposal.

A batch earns credit for candidate coverage when a parsed pair meets the constraint. Google DeepMind’s AlphaCode 2 generated programs, applied compilation and public-test checks, and clustered the survivors by behaviour before ranking submissions. Its technical report says filtering removed about 95% on average. Candidate count, usable diversity and selection are separate measurements in both designs. AlphaCode 2 technical report, pp. 2–4

Read the raw ballot and the returned decision

First, hold the sample count at four and compare the budgets. The four raw replies were identical at 28 and 29 minutes. Two contain F-250 and V-200. The pair exceeds the first budget and is optimal at the second, but the strict parser rejects both batches. As a separate format check, look at the two Verify · 2 replies at 28 minutes. Both contain the exact pair inside Markdown fences, and both still receive no_pair.

F250-tight · 28 minutes left · five listed assets

Exact solver
["F-250", "P-210"] · 26 minutes · priority 20
Greedy raw
```json ["F-250", "V-230"] ```
Verify · 2 raw
```json ["F-250", "P-210"] ``` ```json ["F-250", "P-210"] ```
Verify · 2 decision
[] · no_pair

Both two-sample replies contained the exact optimum inside Markdown fences. The parser rejected the full strings before verification.

F250-tight and F250-loose · same five assets · 28 versus 29 minutes

28 min optimum
["F-250", "P-210"] · 26 minutes · priority 20
29 min optimum
["F-250", "V-200"] · 29 minutes · priority 24
Both raw batches
```json ["F-250", "V-230"] ``` ```json ["F-250", "V-200"] ``` ```json ["F-250", "V-200"] ``` ```json ["F-250", "V-230"] ```
Both decisions
[] · no_pair

Verify · 4 received the same replies at both budgets. The F-250/V-200 pair becomes optimal with the extra minute. The strict parser passed no pair to the verifier in either case.

The exact solver was optimal across all six development slices

Recorded order outcomes and strict optima by anchor-ticket slice

3

All 24 orders per policy

Recorded disposition

PolicyOptimalNo pair
Exact solver240
Greedy024
Vote · 2024
Verify · 2024
Vote · 4024
Verify · 4024

All model arms tied by slice

Strict optima / work orders, per arm

Anchor sliceExact solverEach model arm
Manual4/40/4
Numeric4/40/4
Multi-source4/40/4
Ambiguity4/40/4
Boundary4/40/4
Follow-up4/40/4
Source: Lesson 03 verified T4 notebook, policy scorecard and by-slice grades. The order carries its anchor ticket’s slice label.

Every recorded policy failure occurred at the parse boundary. All 168 sampled replies ended after 19 tokens, below the 32-token cap, with a complete JSON array wrapped in Markdown. Removing the wrappers in an offline readback recovered all 168 arrays. The measured selectors passed each raw string directly to json.loads, which rejected the opening fence. The data establish zero usable model outputs under this contract. On the tight order, a human can recognise the optimum inside both two-sample replies. Vote and Verify work only with parsed pairs, so that distinction never reaches selection.

Each slice labels the work order by the category of its anchor ticket. The exact solver succeeded on all six slices. The model path returned empty selections on all six. The small groups describe this paired planning workload.

Download the raw proposals, selected pairs and receipts.

Separate response time from inspection time

The 28-minute constraint describes field work. The timing chart describes how long the desk took to select the work. The T4 measurement includes chat formatting, tokenisation, device transfer, generation and decoding, with CUDA synchronised at both ends. The scored model latency adds each selector’s CPU time to the corresponding generation receipt before taking a median. The exact solver’s CPU timing covers enumeration. Both exclude service queues and network waits.

CPU enumeration took 0.039 ms at the median

Generation and selection per measured order, with start-up broken out

4

Set-up and repeated F-250 order

Same greedy input for first and warm generation, ms

StageWall time, ms
Model load20373.1
First generation4403.1
Warm repeat 11180.9
Warm repeat 21668.7

All development orders

Median measured policy wall time, ms

PolicyMedian, ms
Exact solver0.039
Greedy1194.2
Vote · 21259.3
Verify · 21259.3
Vote · 41369.4
Verify · 41369.4
Source: Lesson 03 verified T4 notebook. Exact solver timings use the Colab CPU.

The first F-250 generation took 4,403 ms. The two repeat timings were 1,181 and 1,669 ms after the same model load. Those three receipts describe the same input. The policy medians use the full post-warm-up development workload.

Count token work and GPU memory

One F-250 reply used a 160-token prompt and generated 19 tokens through the end marker. In a two-sample batch, each sequence conditions on that prompt. The proxy charges the prompt once per sequence and adds the actual generated lengths through the first end marker. For order ii with kk samples:

Ci(k)=kTprompt,i+∑j=1kTgenerated,ij.C_i(k)=kT_{\mathrm{prompt},i} +\sum_{j=1}^{k}T_{\mathrm{generated},ij}.
# Charge the input per sequence and count the output through its first EOS.
token_proxy = samples * prompt_tokens + sum(generated_lengths)
# Measure the batch peak above the allocation just before generating it.
extra_bytes = peak_bytes - idle_bytes

The proxy records token work. Accelerator batching can share work, so elapsed time scales differently. Peak CUDA allocation comes from PyTorch’s allocator. The idle allocation is the total peak minus the extra peak reported for the same request. External CUDA usage and reserved allocator blocks are outside this measurement.

Peak allocation above the idle level grew from 14.5 to 58.9 MiB

PyTorch CUDA allocated memory per generation batch, min / median / max in MiB

5
SamplesTotal allocated, MiBAbove idle, MiB
12967.0 / 2967.1 / 2967.114.5 / 14.5 / 14.5
22981.4 / 2981.6 / 2981.628.9 / 29.1 / 29.1
43011.1 / 3011.4 / 3011.458.6 / 58.9 / 58.9
Source: Lesson 03 verified T4 notebook, candidate-batch memory triples. MiB derived by dividing bytes by 2²⁰.

Keep comparisons paired

Each candidate policy faces the same work orders as its comparator. The bootstrap resamples anchor equipment families and keeps both inspection budgets together. Assets recur across other shortlists, and all orders share a synthetic construction recipe. The interval describes sensitivity across these anchor families.

Δ^=p^candidate−p^incumbent.\widehat{\Delta}= \widehat{p}_{\mathrm{candidate}}- \widehat{p}_{\mathrm{incumbent}}.

The exact solver gained 24 wins. The model selectors gained zero

Paired change in strict pass rate and family-bootstrap interval, percentage points

6
Candidate vs comparatorChange95% intervalGained / lost
Exact solvervs Greedy+100+100 to +10024 / 0
Vote · 2vs Greedy00 to 00 / 0
Verify · 2vs Greedy00 to 00 / 0
Vote · 4vs Greedy00 to 00 / 0
Verify · 4vs Greedy00 to 00 / 0
Verify · 2vs Vote · 200 to 00 / 0
Verify · 4vs Vote · 400 to 00 / 0
Source: Lesson 03 verified T4 notebook, 1,500 draws over the 12 paired anchor families. Percentage points derived from proportions.

The model intervals collapse to zero because the selections all failed. Dividing extra total proxy tokens by the change in the number of strict wins would require a positive denominator. Even Verify · 4, with 12,864 more proxy tokens than Greedy, added zero strict wins.

Snell and colleagues found that difficulty-aware allocation on their maths benchmark could approach verifier-guided best-of-N with a quarter of the generations in a low-budget comparison. They report that difficulty bins based on verifier predictions weakened the gains at higher budgets. On the inspection board an escalation policy first needs a proposal that the checker can read. Snell et al., §5.3 and Figure 4

What to keep

PolicyStrict optimaFeasible returnsMedian wall, msMean proxy tokensProxy tokens per net added win vs Greedy
Exact solver24/2424/240.0390—
Greedy0/240/241,194.2179—
Vote · 20/240/241,259.3357—
Verify · 20/240/241,259.3357—
Vote · 40/240/241,369.4715—
Verify · 40/240/241,369.4715—

The five-card board has a tractable exact search and a complete structured priority list. Use the exact solver for this board. Inspect contract failures before adding samples, then measure parsed coverage separately from selection. If a future board adds travel, skills or many more inspection choices, repeat the exact-baseline comparison on that workload. For this benchmark the dash means the proxy-per-added-win ratio is undefined for the model policies or outside the model-token comparison for the CPU reference.

How it was built

ItemSetting
DatasetSynthetic Facilities Helpdesk development split, 120 source tickets in 12 equipment families. SHA-256 51dbc208b6b20a620237dd76ce0a2db4f10aa75f4f8fc404121e301b8d79a0cf.
Orders24 orders, two budgets per anchor family. Five same-yard assets per order. Six source slices. The release split stays sealed.
ModelQwen/Qwen2.5-1.5B-Instruct, revision 989aa7980e4cf806f80c7fef2b1adb7bc71aa306. Inference only.
SamplingOne greedy sequence or two or four sampled sequences. Temperature 0.65, top-p 0.9 for sampling, up to 32 new tokens per sequence.
GradeBare JSON array, two distinct listed assets, fit within the order’s budget and reach the exact optimum. Model target at least 90% strict.
Pairing1,500 bootstrap draws over anchor equipment families, 95% percentile interval.
RuntimeColab Tesla T4 with CUDA 13.0. Python 3.13.16, PyTorch 2.14.1+cu130, Transformers 4.51.3.

Time and cost. The queue receipt recorded 152.5 seconds from runner start to completion. The workload timer after shared environment setup recorded 127.8 seconds, including the 20.4-second model load. The measured token proxy and GPU memory describe compute. Billing and live service latency were outside the measurement. Scorecard and timings · Runtime receipt

Run it yourself

Download the executed T4 notebook and inspect its recorded outputs. The opening work list corresponds to the board above. Keep selection and grading independent defines the solver and verifier. Measure the token and wall-time budget records the receipts. Choose a development budget compares all six arms.

Next to try, not tested here

  1. First predict the best pair when you take one minute away from F250-loose. Then change only that order’s budget and compare the exact and selected pairs in records.policies.
  2. Predict which F-250 replies would parse if you unwrap only a single complete Markdown fence. Replay the recorded strings through a separately labelled parser variant. Check strict optima and over-budget pairs before changing the generation budget.
  3. Predict whether trying more samples at the same temperature will buy useful diversity after the format is controlled. Hold the requests and parser fixed and inspect distinct parsed pairs, optimal-candidate coverage and peak allocation in summary.candidate_batches.

Next, ingest documents with layout to make reliable structured inputs available to the desk.

How is this page?

Last updated on