Answers are grounded in this paper and cite their sources.
Accurate coding of tumor diagnoses, with the German Modification of the International Classification of Diseases, 10th Revision (ICD-10-GM), and the International Classification of Diseases for Oncology, Third Edition (ICD-O-3), is essential for structured cancer documentation. Large language models (LLMs) offer opportunities for automating such tasks, but locally deployable, open-weight models often lack sufficient domain-specific coding expertise. This study investigates whether instruction-based fine-tuning on public classification resources improves the coding accuracy of open-weight LLMs for German tumor diagnosis texts. Eight models from the Qwen, Llama, and Mistral families (7–70 billion parameters) were fine-tuned on over 500,000 question-answer pairs based on the ICD-10-GM, ICD-O-3, and German procedure classification. The evaluation uses coded diagnoses from the local tumor documentation system as test data. ICD-10-GM accuracy rose from 1.4 to 24 to 41–58%, and partial (three-character codes only) accuracy from 31 to 74 to 73–83%. The accuracy of ICD-O-3 topography coding also improved but started and remained considerably lower. Malformed code outputs dropped to nearly 0% for almost all models. Tumor-diagnosis recognition reached 99%. A data quality analysis showed that incomplete diagnosis descriptions limited achievable test performance. Accuracy correlated positively with model size, but gaps between small and large models narrowed after fine-tuning. The reasoning mode in Qwen3 generally yielded lower performance than fine-tuning and was over 100 times slower. Our findings highlight the potential of leveraging public catalogues to build instruction datasets that improve LLMs in medical documentation tasks. To support reproducibility and further research, we publicly release the complete training dataset and the best-performing fine-tuned model checkpoints.
No takes yet. Share an insight, caveat, or question.
Lenz et al. (2026) studied this question.
Synapse has enriched 5 closely related papers on similar clinical questions. Consider them for comparative context: