A draft model proposes tokens per sequence and a confidence head predicts, for each draft position, the probability that the target accepts it. Verification stops at the first rejection, so the probability that draft of a sequence is accepted is the product of the confidences up to , and that product is also the marginal value of verifying it. Allocate a global verification budget to the drafts with the highest marginal value.
marginal_values(conf)
conf is (R, D) with entries in [0, 1]. Return the (R, D) array of cumulative products along each row.plan_verification(conf, budget)
R * D drafts by marginal value, descending; break ties by lower sequence index, then lower position. Select the first min(budget, R * D).{"lengths": [...], "expected_accepted": float, "verified": int} where lengths[r] is the number of drafts selected from sequence r, expected_accepted is the sum of the selected marginal values rounded to 4 decimals, and verified is the number selected.fixed_length_plan(conf, m)
m drafts of every sequence. Return the same dict shape.lengths is just a count per row.(-value, r, j) tuples gives the required order in one call.R if you want tokens per step.