Demonstration 1 of 1
Small reference, large model and reference-then-upgrade under a runtime cap
At what deadline does a stronger model stop being the better pipeline, and what does a retained feasible reference recover?
The large forest is about 0.05 more accurate on queries it finishes, but it costs about 25 times the work of the small one. Once the deadline falls below its total, queries it never reaches are answered by the majority class. At 40% that loss swamps the gain on the rest; at 80% the two roughly cancel, and which side wins depends on the size of the model's advantage (it lost here and came out slightly ahead under another seed). The reference-then-upgrade pipeline pays a small overhead to answer everything first, so no query is left unanswered, and it spends leftover work where the two models disagree most. It scored at least as well as the reference at every deadline here.
Scroll sideways for the whole equation
W is the work a pipeline needs, L the work to load the model, c_i the work to answer query i and D the deadline in the same units. A pipeline is feasible when W is at most D.
Predict first. At a deadline of 80% of the large model's end-to-end work, the large model answers about three quarters of the queries in file order. Which pipeline scores best on all 1,000 queries?
Choose an example
Scroll sideways for the whole figure
Constructed example: seeded synthetic tasks and two random forests, with work counted from the fitted trees by the chapter activity.
Calculated values
- Small reference accuracy
- 0.729
- Large model, file order
- 0.708
- Reference then upgrade
- 0.773
- Large model with no deadline
- 0.775
- Queries answered by the large model
- 76% in file order, 71% upgraded
With a deadline of 80% of the large model's work, the large model in file order answers 76% of the queries and scores 0.708 overall, against 0.729 for the small reference: 0.729 - 0.708 = 0.021 lower. Given unlimited time it would score 0.775, 0.775 - 0.729 = 0.046 above the reference. Reference-then-upgrade scores 0.773 and upgrades 71% of queries to the large model, recovering 95% of that gain. The large model needs 25 times the small model's work.
Worked steps
- Large model against reference: 0.708 - 0.729 = -0.021.
- Gain with no deadline: 0.775 - 0.729 = 0.046.
- Reference-then-upgrade against reference: 0.773 - 0.729 = 0.044.
- Deadline in work units: 1489 thousand, against 1861 thousand needed by the large model.
Use the idea
Estimate load and per-query work on a representative slice, scale to the real test size, keep a pipeline that finishes under the cap, and upgrade queries with the leftover budget only after measuring the upgrade rule.
Where the conclusion applies
Constructed data and counted work rather than timed work: node visits stand in for seconds on one fixed machine, and the 5 units per node for loading is an assumed constant, so the deadlines are shares of one pipeline's cost and not a statement about any real GPU or CPU. Measure your own pipeline on your own hardware. Unanswered queries here get the majority class, which is kinder than a real timeout that can invalidate a submission. Ordering upgrades by the small model's uncertainty is one routing rule, and the chapter asks for each route to be assessed on its own.
Check your understanding: At 80%, reference-then-upgrade answers only 71% of the queries with the large model yet scores 0.773. How does it recover almost all of the large model's gain?
Chapter 62 source: section "Quality Includes Completed Work".