ELLMEngineering Large
Language Models
Download PDF

Chapter 59

From Research Result to Production Decision

On this page

This chapter turns a reported result into a local comparison, then works through paired outcomes, uncertainty, cost, and canary gates.

Reconstruct the claim

For every candidate technique, write a result card:

Field Required record
Claim Exact metric, direction, and reported range
Boundary Kernel, layer, model, service, or product
Baseline Version, tuning effort, and excluded features
Workload Model, shapes, traffic distribution, and data
Hardware Accelerator, memory, topology, and host
Precision Storage, compute, accumulation, and calibration
Quality Tasks, slices, tolerance, and statistical uncertainty
Cost Compute, memory, network, engineering, and operations
Failure Unsupported shapes, overload, recovery, and fallback
Currency Paper version and reproduction date

Then map the claimed mechanism to a local bottleneck. A faster attention kernel may reduce queueing if it raises capacity at the saturated stage; it will have little effect when that queue is waiting on another resource. KV offload helps only to the extent that reclaimable KV capacity matters after weights and other state are reserved. Reasoning-time sampling depends on whether the reducer can recognize better candidates. Trace the causal path from the proposed change to the measured outcome.

Compare verified outcomes, not headline scores

Separate four claims: a provider announced a capability; an endpoint or checkpoint is accessible; an evaluation reports a gain; and the gain reproduces under your workload. These claims need different evidence. Do not fill unpublished training details with architectural guesses, or describe a restricted-access model as an ordinary public deployment option.

A useful comparison includes a dated hosted candidate, a feasible open-weight candidate, and the incumbent. For each, record reasoning budget, cached and uncached input, output, tool/verifier work, retries, elapsed time, and whether the task passed independent checks. Report cost per verified success alongside success rate and tail latency. This prevents a cheap but frequently failing route from appearing preferable merely because its tokens cost less.

For an illustrative batch of one hundred tasks, route A costs 20 units and completes eighty verified tasks: 0.25 units per success. Route B costs 30 units and completes ninety: about 0.33 per success. A is cheaper on that ratio, but B may be the only acceptable route if the required success floor is 85 percent. The result still needs workload slices and uncertainty; averages cannot decide which failures are tolerable. A fallback route requires a detector of failure, whose own accuracy and cost must be measured.

Public benchmarks also become development material. Terminal-Bench 4.0 removes tasks with public solutions and requires fresh trials after changes to tasks or agent resources. Keep development tasks separate from held-out adoption tests; record known benchmark exposure and public solutions; and do not tune prompts or routing on the final comparison set. Preserve failures, timeouts, and all planned repetitions in the denominator. Use paired task-level uncertainty and workload slices rather than selecting a favorable run. An observed ninety-percent success rate on one hundred tasks is not a guarantee that future success exceeds eighty-five percent.

Worked adoption decision: a cheaper serving candidate

The following is invented evaluation data for the documentation assistant, not a vendor benchmark. Before running it, the team freezes 400 independent task pairs, corpus and access snapshots, harness, model/prompt versions, retry rules and budgets. Each system receives every task. Verified success includes the required evidence and permitted final state; timeouts and failed retries stay in the denominator and cost totals.

Paired outcome Tasks
Both systems succeed 340
Only incumbent succeeds 20
Only candidate succeeds 30
Neither succeeds 10

The incumbent succeeds on 360/400 tasks (90%); the candidate on 370/400 (92.5%). The paired improvement is (30-20)/400 = 2.5 percentage points. Let each pair's difference be -1, 0 or 1. Its sample variance is (50 - 400*0.025^2)/399, giving an approximate standard error of 1.77 percentage points and a normal 95% interval of about -1.0 to +6.0 points. This supports neither a claim of proven superiority nor treating the two success counts as independent samples. Related tasks require grouped resampling; these invented independent pairs make the arithmetic transparent.

The prespecified gates are: the paired interval's lower endpoint exceeds a -2-point noninferiority margin; the candidate's two-sided 95% Wilson lower success bound exceeds 88%; no observed forbidden effects; p99 first-token latency at most 1.5 seconds; and at least 20% lower total cost per verified success. The candidate's Wilson lower bound is about 89.5%. These are illustrative acceptance rules for this workload, not guarantees about future traffic or a general security threshold.

Suppose all 400 incumbent attempts cost 160 units and all candidate attempts cost 120, including failed calls, retries, tools and allocated serving time. Cost per verified success is 160/360 ~= 0.444 versus 120/370 ~= 0.324, about a 27% reduction. Observed p99 first-token latency is 1.30 versus 1.45 seconds, and both have zero observed forbidden effects. No-token timeouts count as latency SLO failures; do not omit them from the latency denominator. The candidate passes the stated offline gates, but the narrow latency headroom justifies only a bounded canary. Zero violations in 400 trials does not establish absence of rare failures.

At a hypothetical 10,000 attempts daily, the observed per-attempt saving of 0.10 units would save 1,000 units per day. If integration costs 1,200 units, the arithmetic break-even is 1.2 full-traffic days, assuming the workload, retry behavior and cost remain unchanged. At a 5% canary, the same gross saving is only 50 units per day, before duplicate validation and rollback capacity. Do not use full-rollout economics to describe a canary.

The decision is to keep the incumbent as default and run a 5% canary for at least seven days and 2,000 adjudicated tasks, whichever takes longer. Pin the assignment rule and inspect tenant, language, permission and long-document slices. Roll back immediately on a confirmed unauthorized disclosure or duplicated write; stop admissions to the candidate if p99 first-token latency exceeds 1.5 seconds in two consecutive predeclared 1,000-request windows. At the planned endpoint, evaluate each adjudicated canary task against the pinned incumbent in an isolated copy of its pre-action environment and evidence snapshot. Only the candidate executes live effects; the comparator must not duplicate real writes. These same-task evaluations provide the paired outcomes required by the quality rule. If faithful isolated replay is unavailable, prespecify an unpaired control design and its uncertainty rule instead of calling unrelated traffic paired. Include duplicate evaluation overhead in canary economics, and evaluate quality and cost at the planned endpoint with grouped uncertainty when appropriate; do not repeatedly peek for a favorable promotion result.

Rollback switches the compatible routing manifest, preserves current permissions and deletion tombstones, and reconciles in-flight effects. Its owner rehearses the switch before the canary. Promotion requires the planned evidence and slice review; a changed model, verifier or routing rule starts a new comparison. If the candidate instead had p99 of 1.65 seconds, the offline decision would be no canary until a new bounded configuration passed the latency gate.

Run the adoption analysis and challenge its evidence

Run python -m examples.adoption_analysis to reconstruct the 400 task pairs above. The fixture creates one immutable record per task ID with both outcomes, all-in cost, first-token time and a forbidden-effect flag. Its latencies are deliberately constant teaching inputs, not a sampled production distribution. The analyzer rejects duplicate IDs, missing pairs, invalid numbers and inconsistent no-token successes. It computes the paired difference from the actual pairing; equal marginal success rates with different pairings can produce different uncertainty.

The output gives a 2.50-point improvement with an approximate 95% interval from -0.96 to +5.96 points, a candidate Wilson lower bound of 89.50%, a 27.03% cost-per-success reduction, and bounded_canary_only. The NIST confidence-interval reference explains the Wilson and exact binomial constructions. The paired normal interval is a separate calculation on task differences, not a Wilson interval or proof of superiority.

The executable adds a conservative screening rule before using the normal approximation for its decision: at least 30 pairs and ten discordant pairs. This is an explicitly heuristic teaching guard, not a calibrated guarantee that the approximation is accurate. Smaller or highly discrete studies need a prespecified appropriate method or more evidence. The program cannot establish task independence, truthful adjudication, or faithful environment snapshots. Grouped tasks need grouped inference; a repeated task with a new identifier is still not independent evidence. The individual intervals also do not supply a joint 95% guarantee for all rollout gates.

Two evidence limits deserve numerical treatment:

  • Zero is an observation, not a risk bound. With zero forbidden effects in 400 independent trials at a fixed event probability, the exact one-sided 95% upper bound is 1 - 0.05**(1/400) ~= 0.00746, about 0.75%. This is far above many rare-event budgets. An adaptive attacker or changed traffic distribution invalidates the fixed-probability assumption; this calculation is not a security certificate.
  • A sample p99 is not a stable tail estimate. The fixture uses the nearest-rank definition: sorted observation number ceil(0.99*n), or 396 of 400. Only about four observations are expected from a true 1% tail in 400 independent draws. The probability of seeing none is 0.99**400 ~= 1.80%; this is a tail-coverage illustration, not a confidence interval for the measured p99. A credible tail estimate needs more representative observations, workload slices and an appropriate uncertainty method.

A no-token timeout is represented by None, charged its full cost, counted as a latency failure and ordered as infinity for the empirical latency quantile. Consequently, one timeout in 400 requests is still a reported failure even though nearest-rank p99 can pass; five such timeouts make it infinite. A product requiring fewer failures needs a separate, prespecified failure-rate gate. Filtering timeouts out of the sample would silently change the acceptance rule.

Worked challenge: use dataclasses.replace on the immutable fixture to set candidate first-token times to 1.65 seconds, introduce one forbidden effect, or increase candidate costs. Inspect the named gate that fails and the resulting do_not_adopt decision. The tests also rearrange pairing while keeping success totals fixed, retain failed-task costs, and reject misleading zero-success cost ratios. No branch of this program authorizes full rollout: even a passing offline comparison must satisfy the canary, slice review and rollback contract above.

Changed-pairing exercise

Keep the baseline at 360 correct tasks and candidate at 370 out of 400. The canonical adoption case has 50 discordant pairs. Construct another valid pairing with 330 both correct, 30 baseline-only, 40 candidate-only, and zero both wrong. The marginal accuracies and 2.5-point difference stay fixed, but there are now 70 discordant pairs and the paired uncertainty increases. Marginal accuracy tables alone cannot recover this uncertainty.

If the candidate also adds a verifier costing 0.4 units per attempt, add that cost before dividing by verified successes. A token-price discount does not establish lower cost per useful task. Record whether verifier cost is paid on all attempts, only parsed responses, or only routed slices.

What this snapshot does not establish

The model map is selective. It does not exhaust every model family, rank proprietary systems under one common harness, or reproduce training recipes whose data and weights are unavailable. The newly cited attention, draft, and diffusion results remain source-reported until run on matched hardware. Robotics, general world models, and scientific-domain foundation models are adjacent fields, not comprehensively surveyed here.

Maintain a source ledger containing the claim, publication/version date, inspection date, evidence type, and local adoption test. A moving model card should be archived or pinned for an actual experiment. When revising the chapter, update the failed or missing evidence as well as the successful result. A new publication date alone does not make an old comparison current.

Reproduce in layers

Use Part I's Evaluating a Change to the System to choose the experiment boundary. For a paper result, first reproduce its narrow configuration, then substitute the intended model, shapes, and request trace. Keep losing shapes in the report: they define where dispatch should retain the baseline. The worked adoption analysis above determines whether the evidence supports a bounded canary.

Design Exercises

  1. Turn one result in this part into a complete result card.
  2. Why is a tuned baseline an ethical requirement as well as a technical one?
  3. Define stop conditions for a production reproduction effort.
  4. How should an organization maintain a dated state-of-the-art chapter?
  5. A cheaper model has lower cost per success but fails the product quality floor. Should it replace the incumbent?
  6. Two model scores use different Terminal-Bench versions, harnesses, resource budgets, and retry policies. How would you compare them?

Worked Solutions

  1. State the paper's exact boundary and maximum result, then add its hardware, shapes, baseline, quality test, and known unsupported cases. Mark every missing field as unknown rather than filling it with an assumption.
  2. Weak baselines exaggerate novelty and can cause unnecessary cost or risk. A tuned baseline gives decision-makers a fair estimate of incremental value and avoids misrepresenting engineering work as research advantage.
  3. Stop when the local bottleneck is absent, quality fails a hard floor, integration cost exceeds plausible value, the baseline closes the gap, or an unsupported production shape has no safe fallback.
  4. Assign an owner and snapshot date, prefer primary sources, preserve old claims with version history, distinguish peer-reviewed from preliminary work, and schedule review when hardware, model architecture, or serving workload changes materially.
  5. No. Hard quality and policy constraints precede cost optimization. A selective route may be useful only if a tested detector and fallback satisfy those constraints after their latency and cost are included.
  6. The scores do not isolate a model improvement. Rerun both on the same held-out task revision, harness, sandbox resources, retry policy, and effort budget; retain every planned trial and compare paired task outcomes with uncertainty. If comparing complete systems instead, disclose all differences and report quality, cost, latency, and policy violations together.

Selected Primary Sources and Version Boundaries

The September 23 additions cite current model cards, FlashAttention-4 and its FP4 follow-up, DFlare, CaDDTree, DiffusionGemma and its serving implementation, live multimodal systems, and Terminal-Bench 4.0 beside the relevant mechanisms. The following earlier sources remain useful foundations, not a list of the latest releases. Version-specific result links identify the experiment being quoted; a newer revision may change hardware, baselines, or conclusions.

From an experiment to a commitment

A result card should now support one of three actions: adopt within a tested boundary, run a specific follow-up, or stop. A new attention kernel might qualify only for long prefills; an embedding migration might remain blocked on a filtered tenant. Part VIII asks who owns those decisions, how dissent and uncertainty are recorded, and what evidence permits a broader rollout.