Skip to content

eval: sub-0.1% perplexity deltas are sequence artifacts — two deterministic harnesses disagree 5.7x on identical inputs #429

Open

Description

@jamesburton

Found while independently reproducing PR #413's calibration curve. Not a defect in that PR — a measurement-methodology limit that affects how any perplexity threshold in this repo should be derived.

The finding

Two perplexity harnesses, each byte-reproducible in isolation, disagree on identical inputs:

Measurement Harness A Harness B
16 cuts vs 1 cut 0.0540% 0.0094%

Same corpus (byte-diffed identical), same options, same layer partition. A 5.7x disagreement between two deterministic pipelines.

Determinism was verified, not assumed: repeating clean / 5% / 0.5% / both rounding configs at widely separated schedule positions gave spread = 0.000E+000 on every point, and a full 15-point curve reproduced byte-identically in a second fresh process.

The disagreement scales with the number of layer-window boundaries:

Configuration Relative disagreement
1 window 3.8e-6
8-layer windows 1.6e-4
1-layer windows 6.4e-4 (0.064%)

Mechanism unproven. Allocation history and cuBLAS algorithm selection are the leading hypothesis — stated as a hypothesis, not a conclusion.

Why it matters beyond one PR

A sub-0.1% NLL delta measured on this hardware is not a constant — it is a property of the run sequence. Any threshold derived at that scale is measuring the harness, not the model.

That directly touches how this project derives its bounds:

A second finding from the same curve

The perturbation response plateaus and is non-monotonic below ~2%: an element-wise 0.5% boundary perturbation moved the figure more (0.1375%) than a 1.0% one (0.1311%) — corroborated independently by the other harness's 1% -> 0.123%. Below roughly 2%, the effect is dominated by which tokens flip, not by perturbation magnitude.

So "dose-response" framing is misleading in that regime, and a tolerance set there cannot be reasoned about linearly.

Ask

  • Establish and document a floor of meaningfulness for perplexity/NLL deltas on this hardware — below which a difference must be reported as indistinguishable rather than as a value.
  • Require any published sensitivity or tolerance figure below that floor to be given as a range with the measurement conditions, not a scalar.
  • Re-derive the test(coverage): no end-to-end cross-backend gate for quantization kernels — how #254 reached dev green #256 cosine bound from a clean distribution, treating this alongside the seed-pinning contamination already recorded.
  • Investigate the mechanism (allocation history vs cuBLAS algorithm selection) far enough to know whether it can be pinned — e.g. by fixing the cuBLAS workspace or algorithm — or must simply be bounded.
  • Note in docs/ that below ~2% boundary error the response is token-flip dominated and non-monotonic.

Evidence

Measured first-hand on the local RTX 3060 at e5d3b553; full calibration curve run twice, byte-identical each time. Related: #395, #413, #256, #417.

Activity

  1. added
    bugSomething isn't working
    testingTest infrastructure and coverage
    on Aug 15, 2026
  2. jamesburton commented on Aug 15, 2026

    @jamesburton
    OwnerAuthor

    A concrete, testable mechanism

    The author of PR #413 offered a specific hypothesis for the harness disagreement, volunteered rather than asked for:

    My cycling driver allocates a fresh float[] per corpus window per pass, so allocation history differs between a 1-window and a 16-window run in a way that would plausibly reach cuBLAS heuristics.

    That is consistent with both independent observations:

    • The disagreement scales with boundary count — 3.8e-6 at 1 window, 1.6e-4 at 8-layer windows, 6.4e-4 at 1-layer windows. More windows means more distinct allocation sequences.
    • Each harness is individually byte-deterministic. A fixed allocation sequence gives a fixed cuBLAS algorithm selection gives a fixed answer; a different fixed sequence gives a different fixed answer. Determinism and disagreement coexist, which is otherwise the puzzling part.

    Neither party has tested it. Recording it because it converts this issue from "unexplained variance" into something falsifiable.

    Suggested experiment, cheapest first

    1. Pool or pre-allocate the per-window buffers so allocation history is identical regardless of window count, then re-run the 16-cuts-vs-1 comparison. If the 5.7x gap collapses, the mechanism is confirmed and the fix is in reach.
    2. If it does not collapse, pin the cuBLAS workspace (cublasSetWorkspace) and/or force a fixed algorithm, and repeat.
    3. Only if both fail is this genuinely unexplained and must simply be bounded rather than eliminated.

    Why it is worth the effort

    If the mechanism is allocation-driven, it is fixable rather than merely documentable — and a deterministic harness that agrees with itself across window counts is worth considerably more than a documented floor of meaningfulness. Every cross-backend and cross-configuration comparison in the repo inherits this, including the #256 gate's cosine bound.

    If it is not fixable, the floor stands and every sub-0.1% figure must be reported as a range with its measurement conditions — which is what PR #413 now does in docs/GPU.md as an interim measure.

    Related: #413, #395, #256.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtestingTest infrastructure and coverage

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions