Skip to content

Measure yes/no answers on the probability that they are right - #5

Merged
rlaope merged 4 commits into
mainfrom
fix/noul-calibration-scale
Sep 26, 2026
Merged

rlaope merged 4 commits into
mainfrom
fix/noul-calibration-scale

Conversation

@rlaope

@rlaope rlaope commented Sep 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • Bug: noul (yes/no) records store confidence as |p − 0.5| × 2, and every calibration measure read that stored value as the probability of being right. A perfectly calibrated yes/no question reported ECE ≈ 0.21–0.22 and "underconfidence". In the demo, the error reached the verdict as "Band 0.03-0.44", a range where no probability of being right can fall.
  • Fix: DecisionRecord.stated_probability returns 0.5 + confidence/2 for noul. Calibration, the threshold sweep, the labeling queue and recalibration all read it. Stored records are unchanged.
  • Compatibility: noul thresholds and recalibration maps move to the same probability scale. A stored noul line of 0.83 is about 0.92 now. Baseline snapshots go to schema_version 3, and version-2 files are refused with a message to re-save them.
  • Docs: README, llms.txt and CHANGELOG are requoted from fresh runs. The pandas paragraph's figures could not be reproduced by any current run and were replaced.

Test plan

  • Synthetic tests written first; they fail on main and pass here: calibrated yes/no gives ECE near zero, inflated yes/no is flagged as overconfident, and yes/no is measured on the same scale as choice.
  • Sweep and queue scale tests fail when either module is reverted to the stored distance.
  • Independent verifier pass: all figures reproduce, and no stray readers of the old scale remain.
  • uv run pytest, ruff, mypy clean.

A noul record stores its confidence as the distance from a coin flip, |p - 0.5| * 2, and every
calibration measure read that value as the probability of being right, which is max(p, 1 - p). A
perfectly calibrated yes/no question reported ECE 0.23 and "underconfidence", and the pooled ECE
carried the error into the verdict.

DecisionRecord.stated_probability returns 0.5 + confidence / 2 for noul and confidence otherwise,
and calibration_point, the threshold sweep, the labeling queue and recalibration read it. Stored
records are unchanged.

The synthetic tests came first and failed before the change: a calibrated yes/no question reports
ECE near zero, an inflated one is flagged overconfident, and a yes/no answer is measured on the same
scale as a choice answer. The schema test asserted the old, wrong calibration point (0.8 for
P(yes) = 0.9); it now asserts 0.9.

Compatibility: noul thresholds move to the same scale, so a stored noul line of 0.83 corresponds to
about 0.92.

Signed-off-by: rlaope <[email protected]>
The verdict, the plan output and the pooled ECE move with the fix. The pandas comparison quoted
figures no current run reproduced; it now quotes the intent question, 0.091 against 0.107 under
equal-width bins, reproducible with --bins-equal-width. The noul scale and its threshold
compatibility note are in the README, llms.txt and the CHANGELOG.

Signed-off-by: rlaope <[email protected]>
…the queue

A version-2 baseline holds noul figures on the old scale and showed a false ECE improvement of
about 0.19 on identical data, so snapshots move to schema_version 3 and a version-2 file is refused
with the reason and the command that re-saves it. Two tests pin the probability scale in the threshold
sweep and the labeling queue; both fail when either module reads the stored distance instead.

Signed-off-by: rlaope <[email protected]>
…s figures

A bare confidence for a noul row is read as the distance from a coin flip, so the README and
llms.txt point to a probabilities field instead. The CHANGELOG no longer mixes two demo
configurations in one sentence, and the pandas paragraph names its two ECE figures in the order of
its clauses.

Signed-off-by: rlaope <[email protected]>
@rlaope
rlaope merged commit 1912ef0 into main Sep 26, 2026
5 checks passed
@rlaope
rlaope deleted the fix/noul-calibration-scale branch September 26, 2026 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant