TL;DR
KREL (Knowledge-Guided Reasoning over Clinical Evidence) is a novel framework that transforms Automatic Medical Coding (AMC) from a direct generation task into a structured retrieval-and-verification pipeline. By coupling Large Language Models (LLMs) with an external ICD knowledge graph, KREL successfully scales medical coding to the full 70K+ ICD-10-CM taxonomy while strictly adhering to complex official coding guidelines.
What Problem Does This Paper Address?
Automatic Medical Coding (AMC) is the process of assigning standardized International Classification of Diseases (ICD) codes to unstructured clinical notes—a critical task for hospital billing, healthcare statistics, and clinical research.
Historically, this has been treated as an extreme multi-label classification problem using Pre-trained Language Models (PLMs). However, PLMs are typically constrained to small, predefined subsets of codes (usually 50–100 labels) and cannot scale to the full ICD taxonomy, which contains over 70,000 codes.
While recent LLM-based approaches try to solve this via direct code generation or multi-step reasoning, they run into three major roadblocks:
- Extreme Length: Clinical notes are long and messy, making it hard for LLMs to map clinical concepts accurately to exact codes.
- The "Cold Start" Code Problem: LLMs frequently miss rare or low-frequency codes hidden within the massive label space.
- Complex Coding Rules: ICD coding is governed by strict, interdependent rules (e.g., "code first the underlying disease") that LLMs do not inherently know, leading to non-compliant outputs.
Methods
KREL solves these challenges by breaking the coding process down into three distinct, knowledge-guided stages:
- Query Extractor: Instead of feeding a massive, raw clinical note directly to a code generator, an LLM processes the note to extract and rewrite code-relevant diagnoses, symptoms, and conditions into clean, structured clinical queries paired with localized text evidence.
- Knowledge-Guided Candidate Selector: This module queries an offline-constructed ICD Knowledge Graph that encodes official ICD-10-CM tabular lists, hierarchical relationships, and coding guidelines.
- To navigate the 70K+ code space efficiently, KREL introduces a Hierarchy-Aware Beam Search (HBS) algorithm that progressively descends the ICD taxonomy tree based on embedding similarities.
- A cross-encoder LLM then reranks these candidates, and the system injects explicit textual "rule hints" (like
codeFirstoruseAdditionalCode) based on the relationships found in the knowledge graph. - Evidence-Grounded Code Verifier: Finally, the full clinical note, the extracted queries, the candidate codes, and the rule hints are fed to an LLM verifier. The LLM acts as an auditor, reviewing the evidence to assign final verdicts (
SUPPORTED,POSSIBLE, orNOT SUPPORTED) to each code.
Datasets
The authors evaluated KREL across two distinct label-space settings using three benchmark datasets:
- MDACE & ACI-BENCH: Used for the benchmark-label-space setting, where predictions are restricted to the smaller, predefined label inventories provided by the dataset authors.
- MDACE (CM only) & MIMIC-IV-Subset: Used for the full-label-space setting, forcing the models to navigate and select from the complete ICD-10-CM taxonomy of 72,750 terminal diagnosis codes.
Key Insights and Ideas
- Prune Late, Not Early: Traditional greedy search algorithms prune parent codes early in the taxonomy tree, which often permanently discards the correct fine-grained child codes. KREL’s HBS algorithm defers code pruning to the leaf nodes, preserving branch diversity and significantly boosting recall.
- LLMs are Better Auditors Than Search Engines: LLMs struggle to memorize and retrieve from a 70,000-item code list accurately. KREL shifts the heavy lifting of retrieval to a specialized knowledge graph and embedding model, freeing up the LLM to do what it does best: reason, verify, and cross-reference text evidence against a small, curated list of candidates.
- Structured Queries Beat Raw NER: Replacing the LLM query extractor with a standard clinical Named Entity Recognition (NER) tool (like medSpaCy) caused a catastrophic drop in performance (recall plummeted from 0.53 to 0.19). This proves that LLM-driven query reformulation is vital for capturing clinical context and achieving adequate candidate coverage.
Key Results
KREL demonstrated substantial performance gains, particularly in the challenging full-label-space setting:
- Full Taxonomy Performance: On the full-space MDACE dataset, KREL achieved an F1-score of 0.51, vastly outperforming the best LLM prompting baseline (CoT-SC at 0.32) and workflow baseline (CLH at 0.29).
- Massive Recall Boost: KREL's pipeline successfully unearthed rare codes, boosting recall on full-space MDACE to 0.53 (compared to 0.26 for CoT-SC).
- Rule Compliance: In combination-code recall (codes that require multiple conditions to be met jointly), KREL achieved a score of 0.615, while baseline LLM methods sat at a dismal 0.077.
Limitations and Future Work
Despite its success, the authors note a few limitations:
- Retrieval Bottlenecks: Because the verification stage only evaluates retrieved candidates, any code missed during the initial HBS phase cannot be recovered (unless caught by explicit combination-code checks).
- Computational Overhead: Relying on LLMs for multiple stages (extraction, reranking, and verification) introduces significant API costs, latency, and reproducibility challenges, which could complicate real-time deployment in hospitals.
- Real-World Validation: The framework was tested on offline, public datasets. Future work will need to evaluate KREL against the messy, diverse documentation styles of live hospital environments and incorporate direct feedback from professional medical coders.
Summary updated