Skip to content

Unofficial concept by Hafsa Usmani · Not affiliated with Akasa · Synthetic charts only, no patient data

Evals

The eval is the product.

24 synthetic inpatient stays, each with an answer key written before its chart: codes, principal diagnosis, DRG, and whether a human was required. Every number below is recomputed from recorded runs by the same Python that gates CI. Intervals are 95% case-level bootstrap; at n = 24 they are honest, which means wide.

Prompt version
2026-10-02.4-router-v2
Operating threshold
0.80
Models
Haiku 4.5 (evidence) · Sonnet 5.5 (coder, critic, query)
Recorded
2026-10-02

Agent vs one prompt

The baseline is the same Sonnet model given the whole chart and asked for codes: no tools, no evidence step, no critic, no validators. It routes on its own stated confidence and “needs review” flag. Same answer key, same threshold.

Agent versus baseline at threshold 0.80
At 0.80Agent95% CIBaseline95% CI
Stays coded autonomously46% (11)33% (8)
Escapes (needed a human, got through)01
Held needlessly59
Code precision (autonomous)95.3%91.4%–98.8%92.3%87.5%–98.1%
Code recall (autonomous)94.2%90.4%–97.7%96.8%92.9%–100.0%
CC/MCC precision100%100%–100%100%100%–100%
CC/MCC recall100%100%–100%100%100%–100%
DRG match100%100%–100%100%100%–100%
Principal diagnosis correct82%55%–100%100%100%–100%
Over-coded (DRG above key)0%0%–0%0%0%–0%
Under-coded (DRG below key)0%0%–0%0%0%–0%
Invalid or non-billable codes0.0%0.0%
Cost per stay (all stays)$0.096$0.011
Latency p50 / p9541s / 52s5s / 10s

On the stays each system finalizes on its own, both get the DRG right; these charts are short and the traps are about documentation, not grouping. The difference is in what gets through without a human, how much reaches autonomy at all, and whether each code can be explained with a verbatim quote.

Share of stays coded autonomously
0%25%50%75%100%0.00.20.40.60.81.0confidence threshold
Share of stays coded autonomously
ThresholdAgentBaselineAgent v1
0.00100%100%100%
0.05100%100%100%
0.1096%100%96%
0.1596%100%92%
0.2092%100%88%
0.2588%88%79%
0.3083%75%71%
0.3579%54%63%
0.4079%42%63%
0.4567%42%54%
0.5054%42%42%
0.5554%42%42%
0.6054%42%42%
0.6546%42%38%
0.7046%42%38%
0.7546%33%38%
0.8046%33%33%
0.8542%8%33%
0.9029%0%17%
0.954%0%4%
1.000%0%0%
Escape rate: stays that needed a human but got through
0%25%50%75%100%0.00.20.40.60.81.0confidence threshold
Escape rate: stays that needed a human but got through
ThresholdAgentBaselineAgent v1
0.00100%100%100%
0.05100%100%100%
0.1088%100%88%
0.1588%100%88%
0.2088%100%88%
0.2575%88%75%
0.3063%63%50%
0.3550%25%50%
0.4050%13%50%
0.4525%13%38%
0.500%13%13%
0.550%13%13%
0.600%13%13%
0.650%13%13%
0.700%13%13%
0.750%13%13%
0.800%13%13%
0.850%0%13%
0.900%0%0%
0.950%0%0%
1.000%0%0%

What failed

v1 let the model decide what blocks autonomy.

In v1 every issue carried a blocks_autonomy boolean set by the coder or critic. Error analysis on the first full run found the model was noisy about it in both directions:

  • It over-held clean stays, blocking on a non-specific knee-osteoarthritis code, on a stale copy-forwarded line that newer notes had superseded, and on a “questioned” principal whose alternative grouped to the same DRG.
  • It let the heart-failure stay escape: a creatinine rise no provider named was flagged as a query opportunity, but not as blocking.

v2 splits the job. The model labels each issue’s impact on the claim (principal, severity, none). router.py decides with rules a reviewer can read: block on provider questions that can move the claim, on critic doubts about codes that set the DRG, on a questioned principal only if it regroups, and on any hospital-acquired condition coded POA = N. Because routing is plain code over recorded labels, that last rule was applied to every recorded run with no new model calls.

Same 24 charts, threshold 0.80
v1v2
Coded autonomously33%46%
Held needlessly95
Escapes10
Code precision93.7%95.3%
$ uv run python gate.py --runs agent-v1
✓ code precision (auto)   93.7% >= 92%
✓ DRG match (auto)        100% >= 95%
✓ over-coding rate        0% <= 0%
✗ escape rate             12.5% <= 0%
exit 1

$ uv run python gate.py
✓ … all five checks pass
exit 0

The CI gate re-scores committed runs on every PR, with no API calls: a worse recording, an edited answer key, or a grouper change that moves a DRG fails the build.

Where the remaining errors are

Code-level misses grouped by the trap planted in the chart. Most are secondary-code choices that don’t move the DRG (a status Z-code, a more specific organism), which is why precision is below DRG match.

Error taxonomy by planted trap
TrapExtraMissedDRGStays
conflicting notes1120218
no trap22104050813
ruled out1110207
clinical validation10102
copy forward3000120
negation3000121
symptom integral1200711
consultant specificity11011
combination code11019
excludes111019
lab only20023
late addendum10001

What a stay costs

Average per stay, from recorded token usage at list prices. Validators rejected and re-prompted 10 outputs across the run (mostly paraphrased quotes); none reached the result.

Cost and latency by pipeline stage
StageModelTokens in / outTimeCost
evidencehaiku-4-55.0k / 3.0k18.1s$0.020
codersonnet-5-518.0k / 1.6k13.8s$0.052
criticsonnet-5-56.5k / 0.8k6.3s$0.021
querysonnet-5-50.6k / 0.2k3.9s$0.003
Total per stay$0.096

Queries are drafted only for held stays, so their cost is spread across all stays. Next lever: prompt-cache the chart across the coder and critic calls, which share it as the largest input.

How to read these numbers

  • • Charts are synthetic and short (500–1,000 words; real stays run around 50,000).
  • • Answer keys were written by the author before each chart, not by credentialed coders.
  • • Charts were written by Claude in a separate session; the agent runs on Haiku and Sonnet. Same family, so some circularity is possible.
  • • DRG weights and the CC/MCC list are illustrative; codes are real FY2027 ICD-10-CM.
  • • One recorded run per stay. Run-to-run variance is not yet measured; that’s the next eval.
  • • Re-run on Akasa’s gold set, these numbers would mean something. The harness is the point.