Macalinao Studio · Learn

Inside the model / an interactive field experiment

A proposal is not a promise.

A draft runs ahead. The target checks its prefix. Watch a branch survive, fail, or finish with an extra token.

Draft: “the cat sat down”. If the target first disagrees at token 3, accept “the cat”, replace token 3 with the target choice “rests”, and discard “down”. If all four draft tokens match, this round can also commit one extra target token. The reading below remains available without JavaScript.

Listen to this experiment

Highschool · locally generated Kokoro Heart narration. The transcript follows the audio. Optional guided snapshots show the main example from each paragraph; they do not claim word-level timing.

Read the complete narration transcript

A proposal is not a promise. A draft proposes the four tokens: the, cat, sat, down. The target verifies the consecutive prefix. This scene uses fixed greedy decisions to explain the process. It does not run a language model.

With the first disagreement at token three, the first two proposals survive. The target replaces the third token with rests. The fourth proposal is discarded because it depended on the rejected history. The committed sequence is: the cat rests.

In Workbench, move the first disagreement to token one. No draft token survives. If you choose no disagreement, all four proposals survive, and this illustrative round appends the target’s extra token, today. Predict the accepted draft count, then step through verification.

Real acceleration depends on drafting cost, target verification, accepted prefix lengths, and hardware. Random sampling uses a different acceptance and correction rule; matching a greedy token is not that rule. The college notes explain the distinction.

Verification protects the target’s decision

A cheaper draft can propose several tokens. In this greedy demonstration, accept only the consecutive prefix that matches the target’s greedy choices under that history. At the first disagreement, use the target choice and discard the remaining draft suffix.

The later proposals depended on a history that included the rejected token. They cannot be independently carried into the corrected continuation. If every proposed token matches, the target can supply an additional token for that round.

Greedy illustration versus exact sampling

This scene uses predetermined target decisions to explain prefix validity. It does not run language models, implement parallel verification, or measure acceleration. Real speed depends on draft cost, verification cost, acceptance lengths and hardware.

For stochastic speculative sampling, equality with a greedy target token is not the acceptance test. With target distribution p and draft distribution q, accept a sampled proposal with probability min(1,p(x)/q(x)). At rejection, sample from the normalized positive part of p−q. That correction—not arbitrary replacement—preserves the target sampling distribution under the algorithm’s assumptions.

Source and scope

Fast Inference from Transformers via Speculative Decoding · algorithm 1. The scene’s numbers and outcomes are authored teaching fixtures. No model inference or performance benchmark is being run.

Keep exploring

Dedicated scene narration and its transcript are available above. Existing lesson narration remains available in the connected lesson. Scene controls stay in this tab and do not change your saved lesson or study-coach progress.