SOAP_SFT_V1 is a fine-tuned version of Gemma 3 4B Instruct, trained to generate structured clinical SOAP notes (Subjective, Objective, Assessment, Plan) from doctor–patient dialogues.
Trained 2x faster with Unsloth and Hugging Face's TRL library on an H100 GPU.
Model Details
Property
Value
Developed by
Edifon
Base model
unsloth/gemma-3-4b-it-unsloth-bnb-4bit
Model type
Causal Language Model (fine-tuned)
Language
English
License
Apache 2.0
Fine-tuning method
Supervised Fine-Tuning (SFT) with LoRA
Training hardware
Google Colab H100
Intended Use
This model is designed to assist healthcare professionals and clinical NLP researchers by automatically converting clinical consultation transcripts into structured SOAP notes.
SOAP format:
S (Subjective): Patient-reported symptoms, history, and complaints
O (Objective): Observable/measurable clinical findings and planned investigations
A (Assessment): Differential diagnosis and clinical reasoning
P (Plan): Treatment plan, referrals, and follow-up instructions
⚠️ Disclaimer: This model is intended as a research and assistive tool only. It is not a substitute for professional medical judgment or a licensed clinician's evaluation.
Training used train_on_responses_only — only model responses were used in the loss computation, not the user instructions.
How to Use
With transformers (Standard)
python
1from transformers import AutoProcessor, AutoModelForImageTextToText
23processor = AutoProcessor.from_pretrained("Edifon/SOAP_SFT_V1")4model = AutoModelForImageTextToText.from_pretrained("Edifon/SOAP_SFT_V1", device_map="auto")56messages =[7{8"role":"system",9"content":[{"type":"text","text":(10"You are an expert medical professor assisting in the creation of medically accurate SOAP summaries. "11"Please ensure the response follows the structured format: S:, O:, A:, P: without using markdown or special formatting."12)}],13},14{15"role":"user",16"content":[{"type":"text","text":"""Create a medical SOAP summary of this dialogue.
1718### Dialogue:
19Doctor: Hello, what brings you in today?
20Patient: I've been having severe headaches for the past few weeks...
21[rest of dialogue]
22"""}],23},24]2526inputs = processor.apply_chat_template(27 messages,28 add_generation_prompt=True,29 tokenize=True,30 return_dict=True,31 return_tensors="pt",32).to(model.device)3334from transformers import TextStreamer
35_ = model.generate(36**inputs,37 max_new_tokens=2048,38 streamer=TextStreamer(processor, skip_prompt=True),39)
Patient reports photopsia in the left eye for ten days, including flashes of light and a dark spot on the nasal side. Had influenza-like symptoms two weeks prior. No history of eye disease.
Model output:
S: Patient reports experiencing photopsia in the left eye for ten days, describing flashes of light
and a dark spot on the nasal side. History of influenza-like symptoms two weeks prior.
No prior eye disease, operations, or treatments.
O: Patient presented with photopsia and a dark spot in the left eye. Comprehensive eye examination
planned (visual acuity, slit-lamp, fundus examination).
A: Differential includes post-infectious transient optic neuropathy or acute ocular involvement
secondary to influenza. Absence of prior eye disease supports opportunistic onset.
P: Order comprehensive eye examination. Schedule follow-up to review results and determine
treatment or referral plan. Encourage prompt completion of planned examination.
Training Curve
Metric
Value
Initial loss (step 100)
0.941
Final loss (step 5200)
0.482
Total reduction
~48.8%
The model converged stably over 5 epochs / 5,205 steps. Loss dropped sharply in the first ~300 steps as the model learned the SOAP output format, then decayed gradually through step ~2,000, before plateauing in the 0.48–0.52 range for the final two epochs with no significant overfitting observed.
Training Loss Curve
Limitations
Trained exclusively on English-language dialogues
Performance may degrade on highly specialized subspecialty consultations underrepresented in the training data
Should not be used for clinical decision-making without expert oversight
Outputs may occasionally include disclaimers or formatting inconsistencies
Citation
If you use this model in your research, please cite the base model and dataset:
bibtex
1@misc{soap_sft_v1,
2 author = {Edifon},
3 title = {SOAP\_SFT\_V1: Medical SOAP Note Generator},
4 year = {2025},
5 publisher = {Hugging Face},
6 url = {https://huggingface.co/Edifon/SOAP_SFT_V1}
7}