AI
Fine-tuned Open-Source LLMs Dramatically Boost ICD Coding Accuracy for German Cancer Diagnoses
Researchers show that instruction-tuning smaller language models on public medical datasets can more than double their ability to correctly code German tumor diagnoses, while maintaining privacy.
Automatically coding tumor diagnoses using medical classification systems is crucial for cancer registries in Germany, but smaller open-source language models have struggled to achieve reliable accuracy in this task. A new study demonstrates that targeted instruction-tuning on publicly available medical data can substantially bridge this gap.
The Challenge with Smaller Models#
Privacy-conscious healthcare systems often prefer smaller, open-weight language models that can run locally rather than relying on proprietary cloud services. However, these models have performed poorly at translating German cancer diagnoses into standardized ICD-10-GM and ICD-O-3 codes—the classification systems used for structured cancer documentation in Germany. Before fine-tuning, leading open-source models achieved ICD-10 accuracy ranging from just 1.4% to 24%.
Training Data and Approach#
The research team created over 500,000 question-answer pairs derived from three public German medical catalogues: ICD-10-GM, ICD-O-3, and OPS (the German procedural classification). They then fine-tuned eight open-weight models spanning the Qwen, Llama, and Mistral families, with parameter counts ranging from 7 billion to 70 billion.
Substantial Performance Gains#
The instruction-tuning approach yielded dramatic improvements. ICD-10-GM exact-match accuracy jumped to 41–58% (from baseline lows of 1.4–24%), while partial accuracy—matching just the three-character code—reached 73–83% (compared to 31–74% beforehand). The models also eliminated malformed code outputs entirely, and tumor-diagnosis recognition reached 99%.
ICD-O-3 topography coding, a more challenging task, improved but remained lower at 22–40% exact accuracy and 56–67% partial accuracy after fine-tuning. Model size correlated positively with performance, though the gap between smaller and larger models narrowed substantially post-fine-tuning.
Quality Ceilings and Implications#
A systematic data quality review estimated that exact ICD-10 coding performance could theoretically reach 60–79%, meaning the fine-tuned models are approaching realistic upper bounds. The researchers also compared fine-tuning against Qwen3's reasoning mode, which delivered lower accuracy and ran over 100 times slower.
By demonstrating that public medical catalogues can fuel effective instruction datasets, the work suggests a scalable pathway for deploying open-source models in clinical documentation workflows while protecting patient privacy and maintaining cost control.

