ICDAGENT
Model weights for ICDAGENT: Empowering Agentic Large Language Models for Explainable Medical Coding (ACL 2026).
Inference and evaluation code: github.com/ericyinyzy/ICDAGENT
ICDAGENT assigns ICD codes to a clinical note and explains every assignment. A
coding agent R_code extracts codes together with preliminary rationales, and a
critical agent R_crit audits each rationale with chain-of-thought reasoning,
keeping the codes it can ground in the note and rejecting the rest. The codes
rejected for an admission go back to R_code as a candidate set to reconsider,
so a valid code lost to a weak rationale can still be recovered.
Contents
| Subdirectory | Agent | Size | What it is |
|---|---|---|---|
base/huatuogpt-o1-8b |
R_code |
16 GB | shared base, mirror of HuatuoGPT-o1-8B |
rcode-icd9-lora |
R_code |
0.9 GB | LoRA adapter (r=32, alpha=64), ICD-9 |
rcode-icd10-lora |
R_code |
1.2 GB | LoRA adapter (r=32, alpha=64), ICD-10 |
rcrit-icd9 |
R_crit |
8.3 GB | fully fine-tuned Qwen3-4B, ICD-9 |
rcrit-icd10 |
R_crit |
8.3 GB | fully fine-tuned Qwen3-4B, ICD-10 |
Both R_code adapters share the same base and are attached at run time rather
than merged, which is how the reported results were produced. R_crit is fully
fine-tuned, so it is loaded directly with no adapter. The base is included so
that one download is enough to run the pipeline.
Usage
git clone https://github.com/ericyinyzy/ICDAGENT
cd ICDAGENT
pip install -r requirements.txt
python scripts/download_weights.py # all five, ~35 GB
python scripts/download_weights.py --benchmark mimic4-icd9 # just what ICD-9 needs
python scripts/selfcheck.py --benchmark mimic4-icd9 # verify the install
bash scripts/run_all.sh your_notes.json mimic4-icd9 runs/icd9
Inference needs two A100-80GB GPUs. cachetools must stay at 5.5.2: vLLM 0.8.x
reaches into internals that later versions removed, and LoRA loading otherwise
fails with 'LoRALRUCache' object has no attribute '_LRUCache__update'.
Results
| Benchmark | P-macro | P-micro | R-macro | R-micro | F1-macro | F1-micro |
|---|---|---|---|---|---|---|
| MIMIC-III-ICD-9 | 29.62 | 59.35 | 25.58 | 46.87 | 27.45 | 52.37 |
| MIMIC-IV-ICD-9 | 31.92 | 60.19 | 28.90 | 49.15 | 30.34 | 54.11 |
| MIMIC-IV-ICD-10 | 26.03 | 54.73 | 22.73 | 40.77 | 24.27 | 46.73 |
Both agents decode with sampling rather than greedily, so a rerun lands near these numbers rather than exactly on them.
Data
MIMIC-III and MIMIC-IV are governed by the PhysioNet data use agreement, so no note text or gold label file is distributed. The code repository ships the 1,000 evaluated admission identifiers per benchmark, the label spaces and the official ICD code descriptions, which is enough to rebuild the evaluation inputs from your own credentialed copy.
Citation
@inproceedings{yin-etal-2026-icdagent,
title = "{ICDAGENT}: Empowering Agentic Large Language Models for Explainable Medical Coding",
author = "Yin, Ziyi and Cao, Yuanpu and Wang, Ting and Chen, Jinghui and Ma, Fenglong",
booktitle = "Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)",
year = "2026"
}
License
Apache-2.0. R_code's base is HuatuoGPT-o1-8B (Apache-2.0) and R_crit derives
from Qwen3-4B (Apache-2.0). Use of MIMIC-III and MIMIC-IV remains subject to the
PhysioNet data use agreement.