Repository navigation
Calibrate CRF and DeBERTa; CRF stays default (DeBERTa: more recall, not fewer invented prerequisites) - #42
Merged
Merged
Conversation
Platt scaling fitted on the selection half cuts held-out ECE from 0.305 to 0.101 (CRF) and 0.548 to 0.059 (DeBERTa). At review thresholds chosen on the selection half for matched precision targets, DeBERTa keeps two to three times as many agreeing conditions (typed F1 clearly higher at 0.30 and 0.35) but is not clearly more precise and has a higher, not clearly different, false-prerequisite rate, so by the pre-set rule the CRF stays the default. Fixes a Platt fit that diverged on DeBERTa confidences (damped Newton steps, overflow-free sigmoid). Adds triggermap threshold, which keeps the predictions a reviewer sees unflagged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
reports/calibration/: calibration and review thresholds forcrf-batches-01-02and the best run-3 DeBERTa.calibrate's internal halves were checked to equalsplits/selection-v1.review-policy-0) and the test split are untouched.Results:
scripts/calibration/compare_thresholds.sh):Code:
fit_plattdiverged on DeBERTa confidences (a ≈ 1.75e5, b ≈ −2.9e11) andCalibratoroverflowed. It now uses damped Newton steps (step halving on the penalised log-loss) and an overflow-free sigmoid. The CRF's fitted parameters are unchanged. A regression test fails without the fix.triggermap threshold PRED --min-confidence T --out OUT: keeps the predictions a reviewer would see unflagged, trims groups and fixes the document status. Tested.Checks
ruff check,ruff format --check,mypy src/,pytest -m "not slow"(243 passed);shellcheckclean; the comparison script ran end to end.