ICD coding of death certificates with generative language models

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.

Authors

Institutions

Publication Details

Journal
PLOS Digital Health
Published
2026-02-24
DOI
https://doi.org/10.1371/journal.pdig.0001245
Primary Topic
Machine Learning in Healthcare
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

ICD coding of death certificates with generative language models

Isabel Coutinho, André Peralta‐Santos, Bruno Martins, Afonso Moreira et al.
PLOS Digital Health
Machine Learning in Healthcare
article

ICD coding of death certificates with generative language models

Isabel Coutinho, André Peralta‐Santos, Bruno Martins, Afonso Moreira, Gonçalo M. Correia
article en

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.

PLOS Digital HealthVol. 5(2)
Instituto de Engenharia de Sistemas e Computadores Investigação e Desenvolvimento (PT), University of Lisbon (PT), Direção Geral do Território (PT)
Reduced inequalities
Openalex Percentile: Top 48%
Machine Learning in Healthcare
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.