{
  "schema_version": 1,
  "title": "Speculative Decoding: Draft and Verification",
  "review_type": "AI-assisted source-support audit; not independent expert verification",
  "sources": [
    {
      "id": "S1",
      "key": "speculative-context",
      "title": "Accelerate StarCoder with 🤗 Optimum Intel on Xeon: Q8/Q4 and Speculative Decoding",
      "author": "Intel / Hugging Face authors. (2024).",
      "url": "https://huggingface.co/blog/intel-starcoder-quantization",
      "requested_url": "https://huggingface.co/blog/intel-starcoder-quantization",
      "accessed_at": "2026-11-13T22:38:57.027Z",
      "source_type": "primary",
      "version": null,
      "published_at": "2024-01-30T00:00:00.000Z",
      "source_date_note": "Intel / Hugging Face authors. (2024).",
      "retrieved_body_sha256": "1a73e39bd9f26d3a415033ef6e32a07112d213bfdab86d7a50f1d05a4f91136f",
      "library": {
        "id": "c475c54b6d53b2d013c77bba1e480f33",
        "revision": "a95abf005502e6800d2c6c8ab60d9cf8",
        "published_at": "2024-01-30T00:00:00.000Z",
        "captured_at": "2026-11-06T19:43:30.625Z",
        "exact_quote_in_saved_original": true,
        "passage_matches": [
          {
            "evidence_id": "S1-E1",
            "exact_match": true
          }
        ]
      },
      "evidence": [
        {
          "id": "S1-E1",
          "location": "Step 4: Assisted Generation",
          "quote": "AG uses a small, fast draft model to greedily generate K candidate tokens.",
          "normalized_text_offset": 8345
        }
      ],
      "limitations": "Saved public original and current article read. Hardware-specific speed figures are excluded.",
      "checks": [
        "publisher URL and final redirect inspected",
        "actual relevant primary passage read",
        "exact excerpt matched",
        "scope and available version/date inspected"
      ]
    },
    {
      "id": "S2",
      "key": "speculative-docs",
      "title": "Generation strategies · Hugging Face",
      "author": "Hugging Face maintainers. (Main documentation; accessed 2026).",
      "url": "https://huggingface.co/docs/transformers/main/en/generation_strategies",
      "requested_url": "https://huggingface.co/docs/transformers/main/en/generation_strategies",
      "accessed_at": "2026-11-13T22:38:57.894Z",
      "source_type": "primary",
      "version": null,
      "published_at": null,
      "source_date_note": "Hugging Face maintainers. (Main documentation; accessed 2026).",
      "retrieved_body_sha256": "51a05a4425d40aaaa17f3d06dd397f7d12439953ba0efb63cefbf9a1f0c11603",
      "library": null,
      "evidence": [
        {
          "id": "S2-E1",
          "location": "Greedy search",
          "quote": "It selects the next most likely token at each step.",
          "normalized_text_offset": 2186
        }
      ],
      "limitations": "Greedy decoding definition; not a claim that all generation uses this policy.",
      "checks": [
        "publisher URL and final redirect inspected",
        "actual relevant primary passage read",
        "exact excerpt matched",
        "scope and available version/date inspected"
      ]
    },
    {
      "id": "S3",
      "key": "speculative-paper",
      "title": "Fast Inference from Transformers via Speculative Decoding",
      "author": "Leviathan, Y., Kalman, M., & Matias, Y. (2023).",
      "url": "https://proceedings.mlr.press/v202/leviathan23a.html",
      "requested_url": "https://proceedings.mlr.press/v202/leviathan23a.html",
      "accessed_at": "2026-11-13T22:38:57.029Z",
      "source_type": "primary",
      "version": "v202",
      "published_at": null,
      "source_date_note": "Leviathan, Y., Kalman, M., & Matias, Y. (2023).",
      "retrieved_body_sha256": "9b2d5cf4c7ad7e6010659509de3452487d413d8452b2922c54db6540c23f53de",
      "library": null,
      "evidence": [
        {
          "id": "S3-E1",
          "location": "PMLR abstract; ICML 2023, vol. 202, pp. 19274–19286",
          "quote": "without changing the distribution",
          "normalized_text_offset": 945
        }
      ],
      "limitations": "The paper’s abstract describes the full method. It is not used as detailed algorithm evidence for this simplified toy.",
      "checks": [
        "publisher URL and final redirect inspected",
        "actual relevant primary passage read",
        "exact excerpt matched",
        "scope and available version/date inspected"
      ]
    }
  ],
  "claims": [
    {
      "id": "C01",
      "notebook_locations": [
        "workflow"
      ],
      "claim": "Draft candidates — K proposed tokens — A draft proposes a sequence following the committed prefix. — The toy supplies tokens by hand; it does not run a draft model.; Check with target — Conditional positions — Compare greedy target choices while the preceding draft prefix still agrees. — A target check at a later position conditions on earlier draft tokens.; Keep matching prefix — First mismatch boundary — Accept the contiguous agreeing prefix and use the target choice at the first mismatch. — Later draft tokens are discarded even if a displayed token happens to match.; Continue generation — New committed prefix — Resume from the corrected prefix for the next round. — This toy omits the extra target token that some algorithms emit when every candidate is accepted.",
      "source_ids": [
        "S1",
        "S2",
        "S3"
      ],
      "evidence_ids": [
        "S1-E1",
        "S2-E1",
        "S3-E1"
      ],
      "verdict": "editorial_diagram_with_source_supported_roles",
      "reason": "Diagram is a teaching workflow, not an exhaustive protocol or measured system. Each role and arrow is bounded in nearby text."
    },
    {
      "id": "C02",
      "notebook_locations": [
        "experiment"
      ],
      "claim": "The fixed greedy target continuation is A B C D E F. Choose a proposed draft length and the position of its first mismatch (X). Tokens after that position are shown but are not eligible for acceptance in this round. If the chosen mismatch is beyond K, the entire proposal agrees. On a mismatch, commit only the matching prefix and one target correction. The display compares a known greedy target sequence; no speed, model call count or stochastic distribution is measured. K=4, mismatch at 3: Accept A B; correct with C: Draft token X and the remaining proposal are discarded. K=4, mismatch at 1: Accept no draft tokens; correct with A: Agreement must be contiguous from the start. K=4, no mismatch: Accept A B C D: This toy stops at K and omits the possible bonus target token.",
      "source_ids": [],
      "evidence_ids": [],
      "verdict": "original_synthetic_experiment",
      "reason": "Original fixed inputs and outputs; Python assertions and independent browser arithmetic checked in verification artifacts."
    },
    {
      "id": "C03",
      "notebook_locations": [
        "workflow"
      ],
      "claim": "Autoregressive generation produces a continuation one token after another. Greedy decoding chooses the most likely next token at each step. Assisted generation introduces a draft model that proposes several candidate tokens, then a target model checks the proposal. The saved Intel article describes that greedy proposal-and-check arrangement.",
      "source_ids": [
        "S1",
        "S2"
      ],
      "evidence_ids": [
        "S1-E1",
        "S2-E1"
      ],
      "verdict": "source_supported_with_stated_scope",
      "reason": "Read against the stated source sections and notebook assumptions; see separate source audit. "
    },
    {
      "id": "C04",
      "notebook_locations": [
        "workflow"
      ],
      "claim": "The original speculative decoding paper also describes preserving the target distribution under its full method. That result does not follow from accepting tokens merely because their text matches in a toy display. Stochastic acceptance and correction rules are outside this notebook; the example isolates the simpler greedy prefix boundary.",
      "source_ids": [
        "S3"
      ],
      "evidence_ids": [
        "S3-E1"
      ],
      "verdict": "source_supported_with_stated_scope",
      "reason": "Read against the stated source sections and notebook assumptions; see separate source audit. "
    },
    {
      "id": "C05",
      "notebook_locations": [
        "interpretation"
      ],
      "claim": "After the first mismatch, subsequent draft tokens were proposed under a prefix that will not be committed. Their apparent agreement with a prewritten target string is not a reason to accept them. The shaded discard area marks that conditional dependency in this greedy illustration.",
      "source_ids": [],
      "evidence_ids": [],
      "verdict": "original_example_or_reasoned_limitation",
      "reason": "Read against the stated source sections and notebook assumptions; see separate source audit. "
    },
    {
      "id": "C06",
      "notebook_locations": [
        "interpretation"
      ],
      "claim": "The draft needs to be inexpensive enough, and its useful accepted work large enough, to offset extra operations in an actual implementation. This notebook does not estimate that balance. In particular, “four tokens proposed” is not a fourfold speed result.",
      "source_ids": [
        "S1"
      ],
      "evidence_ids": [
        "S1-E1"
      ],
      "verdict": "source_supported_with_stated_scope",
      "reason": "Read against the stated source sections and notebook assumptions; see separate source audit. "
    },
    {
      "id": "C07",
      "notebook_locations": [
        "interpretation"
      ],
      "claim": "Editorial experiment plan: record target and draft versions, tokenizer compatibility, decoding settings, acceptance statistics, latency and hardware. Compare output behavior under the actual algorithm. The paper’s reported results belong to its stated experiments, not to this synthetic animation.",
      "source_ids": [
        "S1",
        "S3"
      ],
      "evidence_ids": [
        "S1-E1",
        "S3-E1"
      ],
      "verdict": "source_supported_with_stated_scope",
      "reason": "Read against the stated source sections and notebook assumptions; see separate source audit. "
    },
    {
      "id": "C08",
      "notebook_locations": [
        "reproduce"
      ],
      "claim": "The original standard-library Python example passed its assertions and 21 input fixtures. Its browser implementation is separately compared against those results.",
      "source_ids": [],
      "evidence_ids": [],
      "verdict": "tested_original_example",
      "reason": "No publisher code executed; no model, external network call or privileged action in the examples."
    },
    {
      "id": "C09",
      "notebook_locations": [
        "self-check"
      ],
      "claim": "K=4 and first mismatch at 3: how many draft tokens are accepted? Correct answer: 2. Only positions before the first mismatch are accepted from the draft.",
      "source_ids": [],
      "evidence_ids": [],
      "verdict": "original_example_or_reasoned_limitation",
      "reason": "Answer rechecked against the declared fixture and cited source scope."
    },
    {
      "id": "C10",
      "notebook_locations": [
        "self-check"
      ],
      "claim": "Why are later draft tokens discarded after a mismatch? Correct answer: Their prefix is no longer the committed prefix. They were proposed conditioned on the draft prefix that included the mismatch.",
      "source_ids": [],
      "evidence_ids": [],
      "verdict": "original_example_or_reasoned_limitation",
      "reason": "Answer rechecked against the declared fixture and cited source scope."
    },
    {
      "id": "C11",
      "notebook_locations": [
        "self-check"
      ],
      "claim": "Does this toy implement distribution-preserving stochastic sampling? Correct answer: No. It is explicitly a greedy token-agreement illustration.",
      "source_ids": [
        "S3"
      ],
      "evidence_ids": [
        "S3-E1"
      ],
      "verdict": "source_supported_and_worked_example",
      "reason": "Answer rechecked against the declared fixture and cited source scope."
    },
    {
      "id": "C12",
      "notebook_locations": [
        "self-check"
      ],
      "claim": "What speedup has this notebook measured? Correct answer: None. It runs no target or draft model and measures no inference latency.",
      "source_ids": [],
      "evidence_ids": [],
      "verdict": "original_example_or_reasoned_limitation",
      "reason": "Answer rechecked against the declared fixture and cited source scope."
    }
  ],
  "original_experiment": {
    "scope": "A greedy token-agreement illustration. It does not implement the general stochastic speculative sampling algorithm or measure acceleration.",
    "assumptions": "If the chosen mismatch is beyond K, the entire proposal agrees. On a mismatch, commit only the matching prefix and one target correction. The display compares a known greedy target sequence; no speed, model call count or stochastic distribution is measured.",
    "results_file": "verification/python-results.json"
  },
  "library_gap": null,
  "excluded_evidence": [
    "Abstract-only evidence is not used for general stochastic algorithm details. The toy makes no stochastic correctness or speed claim."
  ],
  "limitations": [
    "No real model or GPU measured.",
    "Sources and version/date labels checked as recorded; this does not prove absence of errors."
  ],
  "separate_audit_file": "verification/source-audit.json",
  "publication": {
    "state": "published",
    "approved_on": "2026-11-14",
    "published_on": "2026-11-14",
    "source_checks_on": "2026-11-13"
  }
}
