Qendrim Beka

Speculative Decoding

Recorded replay


        

    Proposed
    Accepted
    Rejected
    Next draft

    Output,

    Each decoder sampled its own text, so the three outputs differ.

    • Accepted
    • Thrown out
    • Large model only

    Details

    A small model drafts a few tokens. One pass of the large model checks them together, keeps them up to the first rejection and writes the next token itself. A controller picks how long the next draft should be.

    The engine is exact, which means it has the same output distribution as the large model alone. The controller was the part under test, and it lost that test.

    Results

    Fastest decoder
    2.27x the large model aloneMeasured on held-out receipts with a 95% CI of 2.05 to 2.55, across 2,754 timed requests. This came from a fixed length with a distilled draft, which is larger than the draft in the replay, and the controller played no part in it.
    Controller, preregistered test
    Failed, 0.92x a tuned fixed lengthAdaptive had to beat fixed length 12 on held-out receipts, and it came in below it with a 95% CI of 0.866 to 0.968.
    When the workload shifted
    2.37x the same fixed lengthAdaptive against fixed length 12 on general text, with a 95% CI of 2.07 to 2.64. It was still slower than no speculation, at 0.87x of the large model alone.
    Distilled draft
    1.31x the stock draftMeasured against the stock draft's best fixed length with a 95% CI of 1.23 to 1.39. This comparison was exploratory and sat outside the frozen plan.
    Hugging Face assisted generation
    Within 3 percentThe two matched this closely at equal settings.
    Batched against single requests
    324 of 324 requests matchBatch results reproduced single requests token for token.
    Sampler
    p from 0.08 to 0.61These came from 1,500 draws per arm on real weights at short drafts, where a draft-only control failed. Every random path through the real engine was also enumerated.

    Limits

    • Exact means the same output distribution. Each run's text differs, and task accuracy did not change. The replay does not show that any two outputs match.
    • The controller limits the damage from wrong tuning, and a short fixed length on the stock draft avoided the same problem without it.
    • A seed bug in my harness made requests dependent, so I discarded a 2.8 hour final run and reran the frozen plan. The discarded run put the primary ratio at 1.04x, so the size of the loss is not settled.
    • The batching is static and ran on one laptop, so these numbers say nothing about production serving.
    • The replay shows saved timings and text from single requests. The recordings are the ones whose draft length changed most, so their rates can differ from the results above, which cover the whole run.

    Method

    The plan was frozen before the test split ran. The report has every comparison and how it was run.