[edit]
Interpretable Dynamic Rule Attention for Medical Coding
Proceedings of the The 39th Canadian Conference on Artificial Intelligence, PMLR 318:1068-1075, 2026.
Abstract
Automatic medical coding maps clinical text to International Classification of Diseases (ICD) codes. While highly accurate, recent neural models operate as black boxes, limiting clinical trust and accountability. We address this by proposing an interpretable, rule-guided attention method for a BioClinicalBERT model fine-tuned on Medical Information Mart for Intensive Care III (MIMIC-III) discharge summaries. Our lightweight approach incorporates domain knowledge via keyword mappings, softly biasing attention toward clinical evidence without restricting the model’s learning capacity. Evaluated on the full ICD-9 task, the model improves micro-F1 (0.330 to 0.384), micro-precision (0.391 to 0.420), and micro-recall (0.285 to 0.353). A McNemar test confirms a statistically significant shift in prediction behaviour (p < 10^-10), while quantitative analysis proves significantly increased attention mass on diagnostic keywords (p < 10^-15). This transparency incurs minimal computational overhead, utilizing linear-time matching without altering the core transformer architecture. Qualitative visualizations further demonstrate that this rule guidance yields clearer, evidence-aligned decision patterns without sacrificing predictive accuracy.