KREL: Automatic Medical Coding via Knowledge-Guided Reasoning over Clinical Evidence with LLMs
Organizations: Macquarie University · Beijing Intelligent Decision Medical Technology Co. Ltd. · University of New South Wales · University of Göttingen ·
Abstract
Automatic Medical Coding (AMC), which assigns standardized International Classification of Diseases (ICD) codes to clinical notes, is essential for medical reimbursement, quality reporting, and clinical research. Existing pre-trained language model (PLM)-based methods typically formulate AMC as an extreme multi-label classification problem over a predefined code set, while recent large language model (LLM)-based approaches instead frame it as generation or multi-step reasoning. However, key challenges remain, including the extreme length of clinical notes that hinders effective interpretation, the vast ICD label space, and complex coding rules that are not explicitly captured by LLMs. In this work, we propose Knowledge-Guided Reasoning over Clinical Evidence with LLMs (KREL), a framework that leverages LLMs for clinical text understanding and reasoning while integrating external ICD coding guidelines as structured knowledge. This design enables tight coupling between domain knowledge and LLM reasoning, reducing hallucinations and improving compliance with coding standards. Experiments on benchmark datasets show that KREL consistently outperforms strong PLM-based and state-of-the-art LLM-based baselines.
Figures & tables
| (a) Benchmark-label-space setting | |||||||
|---|---|---|---|---|---|---|---|
| Method category | Model | MDACE (CM + PCS) | ACI-BENCH | ||||
| Precision | Recall | F1 | Precision | Recall | F1 | ||
| PLM | ICD | 0.49 | 0.47 | 0.48 | 0.43 | 0.41 | 0.42 |
| CA | 0.46 | 0.45 | 0.45 | 0.44 | 0.42 | 0.43 | |
| LLM prompting | CoT | 0.30 | 0.31 | 0.30 | 0.35 | 0.50 | 0.41 |
| CoT-SC | 0.39 | 0.43 | 0.41 | 0.36 | 0.59 | 0.44 | |
| Variant | Type | Precision | Recall | F1 |
|---|---|---|---|---|
| KREL (full) | – | 0.48 | 0.53 | 0.51 |
| medSpaCy query | Replace | 0.35 | 0.19 | 0.24 |
| flat retrieval | Replace | 0.46 | 0.50 | 0.48 |
| w/o reranker | Remove | 0.46 | 0.46 | 0.46 |
| w/o rule injection | Remove | 0.47 | 0.50 | 0.49 |
| w/o verifier | Remove | 0.11 | 0.62 | 0.19 |
| Rule | GT (share) | KREL | CoT-SC | CLH |
|---|---|---|---|---|
| Pairwise | 17 (3.14%) | 12 / 70.6% | 5 / 29.4% | 2 / 11.8% |
| Combination | 13 (2.40%) | 8 / 61.5% | 1 / 7.7% | 1 / 7.7% |
| All | 30 (5.55%) | 20 / 66.7% | 6 / 20.0% | 3 / 10.0% |
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
| Dataset | Label-space setting (size) | Code type | Test clinical notes | Test unique GT codes |
|---|---|---|---|---|
| MDACE | Benchmark (350) | ICD-10-CM + PCS | 122 | CM: 312; PCS: 38 |
| ACI-Bench | Benchmark (132) | ICD-10-CM | 120 | 132 |
| MDACE | Full (72750) | ICD-10-CM | 61 | 282 |
| MIMIC-IV-500 | Full (72750) | ICD-10-CM | 500 | 1,812 |
| Statistic | MIMIC-IV | MIMIC-IV-500 |
|---|---|---|
| Clinical notes | 122,288 | 500 |
| Mean GT codes/note | 14.435 | 14.894 |
| Median GT codes/note | 13 | 14 |
| GT assignments | 1,765,181 | 7,447 |
| Unique GT codes | 16,155 | 1,812 |
| Rare GT share | 1.77% | 1.84% |
| Metric | LLM prompting | LLM-agent (CLH) | KREL |
|---|---|---|---|
| Average predicted codes per note | 5.98 | 5.11 | 9.67 |
| False positives | 222 | 187 | 304 |
| False negatives | 398 | 416 | 255 |
| Combination-code recall | 0.077 | 0.077 | 0.615 |
| Sibling-code FP rate | 0.329 | 0.219 | 0.227 |
| Metric | Value |
|---|---|
| True-positive code pairs | 286 |
| Evidence coverage | 100% |
| Mention-anchor coverage | 90.6% |
| Mean semantic cosine | 0.746 |
Automated Medical Coding
Automated medical coding uses clinical records and coding rules to assign standardized diagnosis and procedure codes for billing, care, and research.
See all 23 papers