You need to agree to share your Hugging Face information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

OncoLLM-27B

DOI

Rapport technique / Technical report : OncoLLM: adapting MedGemma 4B and 27B to oncology tasks, Pierre Antoine, Zenodo, 2026, DOI 10.5281/zenodo.23134374 (PDF FR et EN / PDF in French and English). Jeu d'รฉvaluation / Evaluation set : OncoLLM-Quiz-Onco-v1.

Franรงais

OncoLLM-27B est un modรจle de langage mรฉdical, ajustรฉ (fine-tuning) ร  partir de google/medgemma-27b-text-it pour des tรขches d'oncologie en franรงais et en anglais : extraction de biomarqueurs, rรฉponse au traitement, typage TCGA (type, T, N, M), codage CIM-10 et questions ร  choix de type MediQAl. Auteur : Pierre Antoine.

Dรฉpรดt du modรจle complet (poids fusionnรฉs), utilisable directement.

Usage prรฉvu et limites d'usage

  • Modรจle de recherche : il n'est pas un dispositif mรฉdical, n'a fait l'objet d'aucune validation clinique et ne doit pas servir ร  dรฉcider seul d'une prise en charge. Son usage doit respecter la politique d'usage interdit et les conditions HAI-DEF (voir Licence).
  • Seule la partie texte a รฉtรฉ ajustรฉe et รฉvaluรฉe.
  • Il sait rรฉciter le serment d'Hippocrate (version du Conseil national de l'Ordre des mรฉdecins, 2012) et rรฉpondre ร  des questions sur son contenu.

Entraรฎnement

  • Modรจle de base : google/medgemma-27b-text-it. Mรฉthode : QLoRA (base 4 bits, adaptateurs 16 bits), rang 64, alpha 16, taux d'apprentissage 2e-4 dรฉcroissant, 2 รฉpoques, lot effectif de 16, longueur maximale 4 096 tokens, graine 3407, couches de langage uniquement. Fine-tuning rรฉalisรฉ avec Unsloth. 590 pas d'entraรฎnement.
  • Mรฉlange : 4 718 exemples (jeu d'ajustement du Quiz Onco v1, 4 417 exemples, plus 301 exemples d'identitรฉ et de serment, rรฉpรฉtรฉs 3 fois et 2 fois).
  • Modรจle fusionnรฉ en 16 bits (bf16). Fusionnรฉ ร  partir de l'adapter OncoLLM-27B-QLoRA avec lora_alpha 32 (รฉchelle 0,5) dans les poids 16 bits de la base. Cette รฉchelle est reprise du 4B, oรน l'adapter agit sous Unsloth avec une รฉchelle effective environ double de lora_alpha / r ; elle n'a pas รฉtรฉ mesurรฉe sรฉparรฉment pour le 27B. Le modรจle est stockรฉ en bf16. Les rรฉsultats ci-dessous sont ceux de ce modรจle fusionnรฉ, chargรฉ en bf16, alors que les mesures du modรจle de base et de l'adapter ont รฉtรฉ faites avec la base chargรฉe en 4 bits. Sur les 2199 items du Quiz, le fusionnรฉ reproduit les rรฉponses de l'adapter dans 93,8 % des cas (39 perdus, 35 gagnรฉs, p = 0,73). Sa rรฉcitation exacte du texte du serment (0/4) est infรฉrieure ร  celle de l'adapter (4/4).

Donnรฉes

MediQAl (ANR-MALADES/MediQAl) : questions d'examens mรฉdicaux franรงais, tรขche Q5 (choix unique, choix multiples). Licence affichรฉe sur la fiche : cc-by-4.0. Splits utilisรฉs : splits officiels train, validation et test, questions d'oncologie uniquement (lexique v2) ; questions ouvertes (oeq) exclues. PARHAF (HealthDataHub/PARHAF, corpus de comptes rendus cliniques fictifs en franรงais) : tรขche Q4 (codage CIM-10, pool ยซ General ยป uniquement). Licences annoncรฉes dans l'article : CC BY 4.0 et Etalab 2.0. PARHAF-biomarkers-annotated et PARHAF-response_to_treatment-annotated (HealthDataHub) : Q1 (biomarqueurs) pour le premier jeu, Q2 (rรฉponse au traitement) pour le second. Licence affichรฉe sur la fiche HF de chacun des deux jeux : cc-by-4.0. PARCOMED (HealthDataHub/PARCOMED) : utilisรฉ pour sonder la couverture oncologique pendant la conception du Quiz (scripts d'exploration) ; non chargรฉ par les scripts qui construisent le Quiz ni par ceux qui entraรฎnent le modรจle. Licences affichรฉes sur la fiche : cc-by-4.0 et etalab-2.0. TCGA-Reports (Kefeli et Tatonetti, Patterns 5(3), 2024, doi 10.1016/j.patter.2024.100933 ; dรฉpรดt github.com/tatonetti-lab/tcga-path-reports sous licence MIT) : tรขche Q3 (type de cancer, T, N, M). Les rapports proviennent du TCGA via le portail GDC, dont les donnรฉes en accรจs ouvert sont rรฉutilisables avec mention de la source, sans tentative de rรฉidentification des participants (politique du GDC). Serment d'Hippocrate, version CNOM 2012 : texte tirรฉ du site du Conseil national de l'Ordre des mรฉdecins. Quiz Onco v1 : construit par l'auteur ร  partir des sources ci-dessus.

ร‰valuation

Quiz Onco v1, jeu d'รฉvaluation de 9 tรขches publiรฉ sur Hugging Face, sur un sous-ensemble dรฉterministe de 150 รฉlรฉments au plus par tรขche et par division. Prรฉcision, sauf Q3 M (F1 macro, la classe majoritaire pรจse 94 %). Les effectifs de Q2 (19 et 23) sont trop faibles pour conclure.

Tรขche Mรฉtrique Modรจle de base (val / test) OncoLLM-27B (val / test)
Q1 biomarqueurs prรฉcision 0,921 / 0,942 0,931 / 0,967
Q2 rรฉponse au traitement (n=19 / 23) prรฉcision 0,737 / 0,565 0,789 / 0,783
Q3 TCGA type prรฉcision 0,927 / 0,893 0,980 / 0,973
Q3 TCGA T prรฉcision 0,813 / 0,840 0,853 / 0,873
Q3 TCGA N prรฉcision 0,893 / 0,933 0,907 / 0,947
Q3 TCGA M F1 macro 0,598 / 0,634 0,802 / 0,850
Q4 codage CIM-10, code exact prรฉcision 0,140 / 0,118 0,376 / 0,377
Q4 CIM-10, catรฉgorie ร  3 caractรจres prรฉcision 0,430 / 0,482 0,806 / 0,847
Q5 MediQAl choix unique prรฉcision 0,727 / 0,293 0,867 / 0,413
Q5 MediQAl choix multiples prรฉcision 0,336 / 0,180 0,486 / 0,253

Serment et identitรฉ (jeu de test interne) : identitรฉ 13/14 ; texte complet du serment 0/4 ; questions sur le contenu, formulations non vues 16/24.

Limites connues : la division test de Q5 est nettement plus difficile que la division validation, sans explication รฉtablie ร  ce jour ; les intervalles de confiance et les comparaisons appariรฉes figurent dans le rapport technique publiรฉ sur Zenodo (DOI 10.5281/zenodo.23134374).

Utilisation

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM

repo = "Grujowmi/OncoLLM-27B"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, torch_dtype=torch.bfloat16, device_map="auto")
messages = [{"role": "user", "content": "Qui es-tu ?"}]
inputs = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt", return_dict=True).to(model.device)
out = model.generate(**inputs, max_new_tokens=100, do_sample=False)
print(tok.decode(out[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))

Licence

Ce modรจle est un dรฉrivรฉ de MedGemma, fourni selon les Health AI Developer Foundations Terms of Use. En l'utilisant ou en le redistribuant, vous acceptez de respecter les restrictions d'usage de la section 3.2 de ces conditions et la politique d'usage interdit, et vous devez les inclure dans tout accord rรฉgissant l'usage ou la distribution de ce modรจle ou de ses dรฉrivรฉs. Voir aussi le fichier NOTICE. Une autorisation rรฉglementaire de santรฉ peut รชtre requise selon l'usage.

Remerciements : Google (MedGemma), Unsloth, Hugging Face.

English

OncoLLM-27B is a medical language model fine-tuned from google/medgemma-27b-text-it for oncology tasks in French and English: biomarker extraction, treatment response, TCGA typing (type, T, N, M), ICD-10 coding and MediQAl-style multiple-choice questions. Author: Pierre Antoine.

Repository of the full model (merged weights), ready to use.

Intended use and limits

  • Research model: it is not a medical device, has had no clinical validation, and must not be used on its own to decide patient care. Use must comply with the prohibited use policy and the HAI-DEF terms (see License).
  • Only the text part was fine-tuned and evaluated.
  • It can recite the Hippocratic Oath (version of the French Medical Council, 2012) and answer questions about its content.

Training

  • Base model: google/medgemma-27b-text-it. Method: QLoRA (4-bit base, 16-bit adapters), rank 64, alpha 16, learning rate 2e-4 with linear decay, 2 epochs, effective batch size 16, maximum length 4,096 tokens, seed 3407, language layers only. Fine-tuned with Unsloth. 590 training steps.
  • Mixture: 4,718 examples (Quiz Onco v1 fine-tuning split, 4,417 examples, plus 301 identity and oath examples, repeated 3 and 2 times).
  • Merged 16-bit (bf16) model. Merged from the OncoLLM-27B-QLoRA adapter with lora_alpha 32 (scale 0.5) into the 16-bit base weights. This scale is carried over from the 4B, where the adapter acts under Unsloth with an effective scale about twice lora_alpha / r; it was not measured separately for the 27B. The model is stored in bf16. The results below are those of this merged model, loaded in bf16, whereas the measurements of the base model and of the adapter were made with the base loaded in 4-bit. On the 2199 Quiz items, the merged model reproduces the adapter's answers in 93.8% of cases (39 lost, 35 gained, p = 0.73). Its exact recitation of the oath text (0/4) is lower than the adapter's (4/4).

Data

MediQAl (ANR-MALADES/MediQAl): French medical exam questions, task Q5 (single answer, multiple answers). License shown on the dataset page: cc-by-4.0. Splits used: official train, validation and test splits, oncology questions only (lexicon v2); open-ended questions (oeq) excluded. PARHAF (HealthDataHub/PARHAF, corpus of fictional French clinical reports): task Q4 (ICD-10 coding, "General" pool only). Licenses announced in the paper: CC BY 4.0 and Etalab 2.0. PARHAF-biomarkers-annotated and PARHAF-response_to_treatment-annotated (HealthDataHub): Q1 (biomarkers) for the first dataset, Q2 (treatment response) for the second. License shown on the HF page of each of the two datasets: cc-by-4.0. PARCOMED (HealthDataHub/PARCOMED): used to probe oncology coverage while designing the Quiz (exploration scripts); not loaded by the scripts that build the Quiz nor by those that train the model. Licenses shown on the dataset page: cc-by-4.0 and etalab-2.0. TCGA-Reports (Kefeli and Tatonetti, Patterns 5(3), 2024, doi 10.1016/j.patter.2024.100933; repository github.com/tatonetti-lab/tcga-path-reports under the MIT license): task Q3 (cancer type, T, N, M). The reports come from TCGA through the GDC portal, whose open-access data can be reused with attribution of the source and without attempting to re-identify participants (GDC policy). Hippocratic Oath, CNOM 2012 version: text taken from the website of the French National Medical Council (Conseil national de l'Ordre des mรฉdecins). Quiz Onco v1: built by the author from the sources above.

Evaluation

Quiz Onco v1, a 9-task evaluation set published on Hugging Face, on a deterministic subset of at most 150 items per task and split. Accuracy, except Q3 M (macro F1, the majority class is 94%). Q2 sample sizes (19 and 23) are too small to conclude.

Task Metric Base model (val / test) OncoLLM-27B (val / test)
Q1 biomarkers accuracy 0.921 / 0.942 0.931 / 0.967
Q2 treatment response (n=19 / 23) accuracy 0.737 / 0.565 0.789 / 0.783
Q3 TCGA type accuracy 0.927 / 0.893 0.980 / 0.973
Q3 TCGA T accuracy 0.813 / 0.840 0.853 / 0.873
Q3 TCGA N accuracy 0.893 / 0.933 0.907 / 0.947
Q3 TCGA M macro F1 0.598 / 0.634 0.802 / 0.850
Q4 ICD-10 coding, exact code accuracy 0.140 / 0.118 0.376 / 0.377
Q4 ICD-10, 3-character category accuracy 0.430 / 0.482 0.806 / 0.847
Q5 MediQAl single answer accuracy 0.727 / 0.293 0.867 / 0.413
Q5 MediQAl multiple answers accuracy 0.336 / 0.180 0.486 / 0.253

Oath and identity (internal test set): identity 13/14; full oath text 0/4; content questions, unseen phrasings 16/24.

Known limitation: the Q5 test split is much harder than the validation split, with no established explanation yet; confidence intervals and paired comparisons are given in the technical report published on Zenodo (DOI 10.5281/zenodo.23134374).

Usage

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM

repo = "Grujowmi/OncoLLM-27B"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, torch_dtype=torch.bfloat16, device_map="auto")
messages = [{"role": "user", "content": "Qui es-tu ?"}]
inputs = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt", return_dict=True).to(model.device)
out = model.generate(**inputs, max_new_tokens=100, do_sample=False)
print(tok.decode(out[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))

License

This model is a derivative of MedGemma, provided under the Health AI Developer Foundations Terms of Use. By using or redistributing it you agree to comply with the use restrictions in Section 3.2 of those terms and the prohibited use policy, and you must include them in any agreement governing the use or distribution of this model or its derivatives. See also the NOTICE file. Health regulatory authorization may be required depending on the use.

Acknowledgements: Google (MedGemma), Unsloth, Hugging Face.

Citation

@misc{antoine2026oncollm,
  author    = {Antoine, Pierre},
  title     = {OncoLLM: adapting MedGemma 4B and 27B to oncology tasks},
  year      = {2026},
  publisher = {Zenodo},
  doi       = {10.5281/zenodo.23134374},
  url       = {https://zenodo.org/records/23134374}
}
Downloads last month
2
Safetensors
Model size
27B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for Grujowmi/OncoLLM-27B

Finetuned
(20)
this model