Skip to content

ML4H 2026 rebuttal: reviewer-requested controls (visit-end override, random-code control) - #287

Merged
amrit110 merged 5 commits into
mainfrom
rebuttal/reviewer-controls
Oct 9, 2026
Merged

amrit110 merged 5 commits into
mainfrom
rebuttal/reviewer-controls

Conversation

@amrit110

@amrit110 amrit110 commented Oct 9, 2026

Copy link
Copy Markdown
Member

Summary

Merges the two branches that answer Reviewer 3P7y's requests, plus the plan's WP9 results.

  • rebuttal/visit-end-override (b57deb4): --override-positions visit_end on the label-override test. The override is applied only at the last position of each visit (where the concept loss is pooled); every other position is left as under none. Each result carries a visit_end_positions block (top-1 and loss at the eligible visit-end positions, n_positions, n_subjects, paired subject-clustered bootstrap truth-minus-none / truth-minus-flip / flip-minus-none). Tests in tests/odyssey/inference/test_interventions_visit_end.py.
  • rebuttal/random-code-control (5bd3096): python -m odyssey.inference.concept_edit_attribution cohort CLI with --code-selection {attributed,random}, --random-seed, --candidate-pool {mappable,all}, --top-k, --index-frac; parse_edit_attribution_logs.py reads selection / random_seed; make_edit_attribution_table.py --with-random renders the random-code rows (Table 9 unchanged without the flag).
  • docs/ml4h2026_rebuttal_plan.md: WP9 description (from the random-code branch) and a WP9 results section.

Results (banked under research_journal/figure_data, not committed)

  • Visit-end override, band 0.15: MIMIC-IV (14,848 positions) truth minus none -0.15 top-1 points (-0.25 to -0.04), loss +0.018 nats, separated and worse; truth minus flip ties. eICU-CRD (3,279 positions) truth minus none -0.18 points (interval crosses zero), loss +0.044 nats worse; truth minus flip ties. No lever at the supervised positions either.
  • Random-code control: sign agreement near-saturated on MIMIC-IV (96 to 100% for both arms on AKI and death); eICU-CRD separates by 10 to 20 points at one or two codes; the ranking's gain is concept shift (1.3 to 2x) and hazard magnitude (1.5 to 7x).

Test plan

  • ruff format --check, ruff check: clean
  • mypy on the touched modules: clean
  • pytest on interventions, edit-attribution, counterfactual and the two script tests: 111 passed, 4 skipped
  • CI

🤖 Generated with Claude Code

amrit110 and others added 4 commits October 9, 2026 08:02
The concept head is supervised only at visit ends, yet the override was
applied at every position with the running label (Appendix E names this
as a possible reason the true value does not help). The new option
applies truth/flip/random and the calibrated modes only at each visit's
last position (chunk.visit_end, the flag the concept loss pools on) and
leaves every other position as under none. Each mode gains a
visit_end_positions block: top-1 and loss over only the visit-end
positions with an observed label inside the band and a next-token
target, n_positions and n_subjects, and on the left-hand mode the
paired subject-clustered bootstrap differences (truth minus none, truth
minus flip, flip minus none) in top-1 and loss. The default (all) is
unchanged byte for byte; --hazard-heads combines with it (the landmark
rows are not visit ends, documented). WP1 of the rebuttal plan gains the
VM command.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A reviewer asks for a random-code control to show the concept ranking
helps. Table 9's numbers came from an uncommitted scratch harness
(cohort_worsen.py); only its stdout logs were banked. This adds the
cohort driver to the package, `python -m
odyssey.inference.concept_edit_attribution`, reproducing that log
format so scripts/parse_edit_attribution_logs.py reads both, and gives
it the control arm.

- `--code-selection {attributed,random}` (default attributed) and
  `--random-seed`: the random arm draws min(top_k, pool) codes per
  subject uniformly from the same candidate pool the occlusion loop
  ranks, seeded per subject from (seed, subject_id), then builds the
  identical worsen edits (worsen_edits_for_codes, split out of
  worsen_edits_from_attribution with no behaviour change).
- `--candidate-pool {mappable,all}`: the default pool is the distinct
  window codes that resolve to a panel signal with a worsen edit, the
  only codes either arm can act on; `all` ranks every window code and
  drops unmappable picks the way the attributed arm always did.
- `--index-frac` on _index_times_by_subject for the banked headers'
  index_frac field.
- Parser tags runs with `selection` (attributed when absent) and
  `random_seed`; make_edit_attribution_table gains `--with-random`
  (Codes column, random row under its attributed row), default output
  byte-identical on the banked JSON; the CI table labels random blocks.
- Tests: pool filtering, seeded draw, same-count/same-subject
  guarantee, parser round trip, table flag. docs/ml4h2026_rebuttal_plan
  WP9 carries the VM command lines for both arms on MIMIC-IV and eICU.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.39210% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.24%. Comparing base (2aef465) to head (890e070).

Files with missing lines Patch % Lines
odyssey/inference/concept_edit_attribution.py 99.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #287      +/-   ##
==========================================
+ Coverage   90.98%   91.24%   +0.26%     
==========================================
  Files          71       71              
  Lines       11263    11577     +314     
==========================================
+ Hits        10248    10564     +316     
+ Misses       1015     1013       -2     
Files with missing lines Coverage Δ
odyssey/inference/counterfactual.py 83.81% <100.00%> (+0.41%) ⬆️
odyssey/inference/interventions.py 95.92% <100.00%> (+1.71%) ⬆️
odyssey/inference/concept_edit_attribution.py 99.29% <99.00%> (+0.40%) ⬆️

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov/patch was at 79% against the 91% project target: the new
concept_edit_attribution CLI (_main) and the run-dir driver's visit-end
branch had no tests. Adds a CLI test with load_run, the concept pins and
the shard loader stubbed, the cohort_worsen edge paths (unknown concept,
max_subjects, empty pool, an unedited random draw under pool=all,
index_frac in the header), and an evaluate_interventions test with a
two-admission fixture that attaches the visit-end blocks, plus the
override-positions guard and the empty-table case.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@amrit110
amrit110 merged commit ccd20a9 into main Oct 9, 2026
9 checks passed
@amrit110
amrit110 deleted the rebuttal/reviewer-controls branch October 9, 2026 18: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