Skip to content

Record neural run 1; soften span-tag weighting for run 2 - #38

Merged
professor3333 merged 1 commit into
mainfrom
fix/neural-span-weighting
Nov 5, 2026
Merged

professor3333 merged 1 commit into
mainfrom
fix/neural-span-weighting

Conversation

@professor3333

Copy link
Copy Markdown
Owner

Summary

  • Run 1 record (reports/neural/run-1/): the first GPU run, 12 runs on a Kaggle T4.
    • Every run over-predicts spans: 39–47 conditions per document (CRF 1.8), span precision ≈ 0.015.
    • Best typed F1 against the 172 model-drafted dev records is 0.023, against 0.145 for crf-batches-01-02. The paired difference is clear (−0.122 [−0.160, −0.081]).
    • Reports, per-run metadata (per-epoch losses and dev scores) and the archive SHA-256 are committed; the 24 MB of predictions are not.
  • Diagnosis:
    • Balanced (inverse-frequency) span-tag weights make a missed B about 65× as costly as a wrong one.
    • With about 31 optimizer steps per epoch, most runs were still improving at epoch 6.
  • Changes for run 2:
    • TrainConfig.bio_weighting takes inverse (run 1), sqrt (new default) or none.
    • The DistilBERT and DeBERTa grids try sqrt and none × 2 learning rates × 3 seeds (24 runs), with up to 15 epochs and patience 3.
    • The grids are renamed distilbert-2 / deberta-2, so resumed runs never reuse run-1 bundles.
    • run_neural.sh reads run names from the configs and predicts and packs only the current grids. score_neural.sh groups runs by grid and clears older predictions.
    • Docs and the model card are updated.
  • Tests: weighting modes, the new grid sizes. The real run-1 archive was scored with the updated scoring script.

The test split is not touched.

Checks

  • ruff check, ruff format --check, mypy src/, pytest -m "not slow" (238 passed); shellcheck clean.
  • One earlier local full-suite run reported 1 failure that did not reproduce in four further runs, and the failing test was not captured. CI is the check here.

Run 1 (12 runs on a T4) over-predicted spans: 39-47 conditions per
document and at most 0.023 typed F1 against the model-drafted dev
records (CRF 0.145). Balanced span-tag weights made a missed B ~65x as
costly as a wrong one, and runs were still improving at epoch 6.

TrainConfig.bio_weighting (inverse / sqrt / none, default sqrt); the
grids try sqrt and none, up to 15 epochs with patience 3, under new
names (distilbert-2, deberta-2). The GPU script predicts and packs only
the current grids; the scoring script groups runs by grid.
@professor3333
professor3333 merged commit 95c3d47 into main Nov 5, 2026
2 checks passed
@professor3333
professor3333 deleted the fix/neural-span-weighting branch November 5, 2026 16:36
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