ICD coding of death certificates with generative language models
Isabel Coutinho,
Gonçalo M Correia,
Bruno Martins,
Afonso Moreira and
André Peralta-Santos
PLOS Digital Health, 2026, vol. 5, issue 2, 1-17
Abstract:
Although large language models can achieve remarkable results in most text generation tasks, these models have been less used in text classification problems, of which ICD coding of clinical documents is one example. In this work, we propose different strategies to adapt a LLaMA generative language model to the ICD coding task. In one such strategy, we only use a language modeling objective for training, followed by constrained decoding at inference time, rather than fine-tuning the model for discriminative classification. We specifically use free-text descriptions in Portuguese death certificates to train a relatively small LLaMA model for assigning ICD codes to the underlying cause of death, and we compare it against a BERT encoder model, which is typically used to address text classification tasks. Experiments show that generative language models can achieve strong results in ICD coding of death certificates, with a classification accuracy that is at least in line with the results obtained using encoder models. We thus demonstrate that language generation can be a suitable approach for ICD coding, allowing for multiple related tasks, such as coding the underlying or the multiple causes contributing for a death, to be performed with a single unified model.Author summary: The ICD coding system corresponds to a standardized way of classifying health conditions and external causes of injury or disease. Assigning these codes to causes of death is a critical task in public health, in order to monitor a population’s health and to conduct mortality and morbidity studies. However, manually coding death certificates is time-consuming and error-prone. Our work explores whether modern language models can help automate the ICD coding task effectively. We specifically frame ICD coding as a language generation problem, where human coders can interact with the model with a simple language prompt, allowing for different tasks to be performed with a single unified model, such as coding the underlying cause or multiple causes of death. We achieved strong experimental results, showing that this solution has indeed the potential to be applied in a real-life public health surveillance scenario, either in a setting where it is only necessary to obtain approximate mortality statistics, or in a setting where human coders can refine the automatically generated results, but considerably alleviating the burden to public health professionals.
Date: 2026
References: Add references at CitEc
Citations:
Downloads: (external link)
https://journals.plos.org/digitalhealth/article?id=10.1371/journal.pdig.0001245 (text/html)
https://journals.plos.org/digitalhealth/article/fi ... 01245&type=printable (application/pdf)
Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.
Export reference: BibTeX
RIS (EndNote, ProCite, RefMan)
HTML/Text
Persistent link: https://EconPapers.repec.org/RePEc:plo:pdig00:0001245
DOI: 10.1371/journal.pdig.0001245
Access Statistics for this article
More articles in PLOS Digital Health from Public Library of Science
Bibliographic data for series maintained by digitalhealth ().