A Lean 4 checker audits AI-written cancer care plans against 1,861 guideline rules. On 428 synthetic cases it blocked every high-risk release and recovered every mandatory duty, but nothing was tested on real records.
Going deeper
Picture a pharmacist checking a prescription against a thick rulebook. A smart new assistant writes the prescriptions fast, but sometimes hands out a drug before a needed test is back, or forgets a scan the rules say every patient must have.
This paper turns the rulebook into a strict checker. Its key habit: a blank on the form means 'not known yet', never 'no'. So a drug waiting on a missing test is held, and the checker reads the whole rulebook for each patient, so forgotten scans are flagged too. The assistant gets back a short list of what to keep, add and drop, and tries again.
On made-up patient files, the assistant with this checker handed out no risky drugs and did every required task. An ordinary checker that read blanks as 'no' did worse on required tasks than no checker at all. But no real patient file, and no specialist review, has been through it yet.
The abstract, word for word, with the six densest phrases unpacked.
Formal medical verification encodes clinical guidelines into mathematical logic to audit care plans, yet traditional tools stalled under heavy coding burdens, manual record extraction, and opaque outputs. Conversely, multimodal and large language models (MLLMs and LLMs) excel at clinical text processing but still release contraindicated therapies under missing tests1 and omit mandatory clinical duties. We investigate whether formal medical verification can be revived alongside MLLMs as their interactive safety world model2. Focusing on oncology, we introduce MedLean, a two-stage Lean 4 framework comprising an offline compiler and Z3 full-space auditor (MedLean-Compiler) over four NCCN and CSCO guidelines (1,861 executable rules) and an online verification kernel proved across 23 machine-checked theorems3 (MedLean-Verifier). Static auditing uncovers 362 binary negative-default leaks4 alongside genuine published-guideline contradictions. Across 428 multi-cancer cases5 with DeepSeek-V4.1-Flash and GPT-6.2-Astra, MedLean drives high-risk releases to 0% and lifts whole-plan certification to 98.4% and 100%. Binary rule engines actively degrade mandatory-duty completion below unverified LLMs, and safety-first models achieve full base certification partly through conservative omission6 unless paired with consultation-target accountability.
Two lines of work lead here: formal checking of guidelines, and pairing language models with proof checkers.
Read four parts of it, in this order.
Skip Appendix B unless you want worked cases.
If the gains are smaller than they look, these places show why.
MedLean represents a modest architectural first step rather than a deployed clinical decision support system, and six clear boundaries define its current scope. First, all 428 online benchmark cases are synthetic structured vignettes using canonicalized fact keys and standardized action IDs rather than raw free-text electronic health records; while MLLM-assisted clinical extraction and plain-language explanation motivate the broader two-way paradigm, upstream extraction errors from noisy clinical notes are not evaluated inside the Lean kernel and remain a separate source of risk. Second, free-text public exam and vignette benchmarks (where clinical details are omitted or legacy answer keys diverge from 2026 guidelines) fall outside this structured-input verification scope and cannot be inferred to improve from synthetic guideline-compliance gains alone. Third, compliance with encoded guidelines does not equate to real-patient clinical efficacy, and our rule library and synthetic trajectories have not yet undergone independent blinded review by board-certified oncologists. Fourth, our evaluation validates the exact {0,1} RLVF reward environment and test-time closed-loop correction (capped at two turns), whereas end-to-end reinforcement learning weight updates using MedLean rewards remain future work. Fifth, 143 of 1,029 source records remain partial or pending because those records hinge on patient-specific anatomy, preferences, sequential toxicity histories, or hospital-specific SOPs that cannot be reduced to universal guideline rules without local institutional encoding. Sixth, all compiled rules currently span four lung and gastric oncology guidelines; generalizing the compiler to multi-specialty multimorbidity with temporal longitudinal state transitions will require richer time-indexed formal semantics.
Duty completion and reward-hacking stress tests. (a) On GPT-6.2-Astra, Plain Rule trails Direct LLM by 22.8, 35.7, and 43.8 percentage points across the three v4 cohorts. n counts cases with mandatory duties. (b) Pass rates for 50 adverse plans and 50 matched controls (v3). In the empty-plan audit, 108/300 (36%) pass the base gate and 0/227 (0%) pass the consultation gate.
Nothing on this page was recomputed. Every claim points to the paper so you can check it.
More latest news
Read all