Cancer registries abstract structured data from the pathology reports they receive. Two of the central data items are ICD-O codes: the topography code, which records where a cancer arose, and the morphology code, which records its histological type and behaviour. MedTex-LLM assigns both with small language models that run entirely within the registry, so that reports never leave its infrastructure.
Why ICD-O coding is hard to automate
A large, long-tailed label space
Privacy and budget limit the options
Pathology reports contain identifiable patient information, so registries generally cannot send them to cloud services. Registries also run on limited operational budgets, and per-report charges for cloud APIs or large hosted models can be prohibitive at the volumes they process. An automated coding system must therefore run affordably on hardware the registry already operates.
Expert systems are costly to maintain
Many registries already rely on rule-based systems refined over years of use. These perform well on the report formats they were built for, but each new laboratory template or change in coding practice requires new rules, and accuracy varies across reporting styles.
Extract, retrieve, rerank, recode
The model never has to recall a code from memory. It writes a phrase, a retriever turns the phrase into candidate codes, and the model only has to choose among ten. Click a stage to see it on a real example.
One report, stage by stage
Synthetic reports written for this page, run through the paper's configuration on a laptop.
Loading the walkthrough…
Better than prompting alone, and better than the deployed system
Show every system and field as a table
Steadier across laboratories
Accuracy on the same reports, grouped by cancer stream (the five most common in Queensland) and by source laboratory (the five largest, pseudonymised). Rule-based systems are tuned to the report templates they were built for; the LLM pipelines vary less across laboratories than the deployed system.
Show as a table
Runs offline on a laptop
Timed on a single laptop with no network connection to any model service.
What these results do and do not show
- A single registry. The gold codes, assigned by registry coders, have since been updated to ICD-O-3.2 and so reflect current coding practice. Report templates and coding conventions nonetheless differ between registries.
- Test data only. The reports served solely as a test set; no component was trained or fine-tuned on them. Two design decisions were nonetheless informed by this corpus: the registry recode rules, and leaving out morphology-group masking, which reduced accuracy when tested on it.
- Two of many data items. Topography and morphology are central to a cancer notification, but registries abstract many further items, such as grade, laterality, basis of diagnosis and stage.
BibTeX
@inproceedings{medtexllm2026,
title = {Efficient {ICD-O} Coding for Cancer Registries with
Small, Locally Deployable {LLMs}},
author = {Liu, Jinghui and Nguyen, Anthony},
booktitle = {GenAI4Health Workshop at NeurIPS 2026},
year = {2026},
url = {https://openreview.net/forum?id=pd7PD93fEi}
}