Under review at Expert Systems with Applications
July 2026 to Present
A clinician asks a question in plain language, and a Text-to-SQL system returns a query that runs cleanly but selects the wrong patients. A term was mapped to the wrong column, or the wrong time window was assumed. Nothing crashes and nothing looks different, so the error goes unnoticed. Most systems only check the SQL after it is written, so a planning mistake survives all the way to a confident, wrong answer.
HEAL (Healthcare Execution-guided Multi-Agent for Logical queries) splits the task across agents that hand each other readable plans, and checks those plans before any SQL is written.
Decide what is asked (or ask back), resolve vague and time-based words, and choose the join path.
Check the plans against the live schema and against each other. Pass, re-plan once, or refuse.
Only a validated plan reaches SQL synthesis, then an auditor and an execution-guided refiner.
Explain the answer using only the rows that were actually returned.
Evaluated on SynClin-SQL, a benchmark of 500 clinician-style questions over a synthetic patient database. Exact Match, Execution Accuracy and Valid SQL are percentages. The human score is the mean of a four-point correctness rubric. Gains below are over the strongest baseline, chain-of-thought.
| Backbone | Method | Exact Match | Execution Accuracy | Valid SQL | Human Score (1-4) |
|---|---|---|---|---|---|
| GPT-4o-mini | Zero-shot | 9.4 | 48.2 | 75.8 | 2.012 |
| Few-shot | 11.8 | 51.6 | 77.4 | 2.174 | |
| CoT | 13.2 | 54.0 | 79.2 | 2.310 | |
| HEAL | 13.6 | 66.0 | 87.0 | 2.580 | |
| GPT-5 nano | Zero-shot | 12.2 | 52.8 | 78.2 | 2.138 |
| Few-shot | 15.2 | 57.4 | 80.2 | 2.334 | |
| CoT | 17.0 | 59.2 | 82.0 | 2.442 | |
| HEAL | 23.0 | 69.2 | 90.0 | 2.768 | |
| GPT-5 mini | Zero-shot | 14.0 | 56.2 | 81.0 | 2.254 |
| Few-shot | 17.6 | 60.0 | 82.8 | 2.418 | |
| CoT | 19.8 | 62.6 | 84.6 | 2.538 | |
| HEAL | 29.0 | 71.2 | 92.6 | 2.808 |
HEAL improves execution accuracy on all three backbones, and the gain holds across ambiguity, join-path, temporal, and nested questions. Catching errors in the plan, before SQL exists, is what makes the difference. The trade-off is cost: about 8 model calls per query instead of one. Results come from one synthetic dataset, so validation on real clinical records is the next step.