Model Details
- Base model: HuggingFaceTB/SmolLM2-360M-Instruct
- Adapter type: LoRA (rank 16, alpha 32, target modules: q_proj, v_proj, dropout 0.05)
- Trainable parameters: ~1.64M (0.45% of 363M total)
- Training data: starmpcc/Asclepius-Synthetic-Clinical-Notes (summarization-focused subset, 6,816 examples)
- Training framework: Hugging Face TRL (SFTTrainer) + PEFT
Intended Use
Given a clinical note and a question (e.g. "Summarize this note"), the model generates a relevant answer grounded in that note. Intended as a demonstration of small model fine-tuning for clinical NLP tasks, not as a production or clinical tool.
This model was trained and evaluated using a custom prompt structure, not the tokenizer's default chat template. For best results, format input exactly as follows:
### Clinical Note:
{note text}
### Question:
{question text}
### Answer:
How to Use
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model = AutoModelForCausalLM.from_pretrained("HuggingFaceTB/SmolLM2-360M-Instruct")
tokenizer = AutoTokenizer.from_pretrained("HuggingFaceTB/SmolLM2-360M-Instruct")
model = PeftModel.from_pretrained(base_model, "YOUR_USERNAME/YOUR_MODEL_NAME")
prompt = (
"### Clinical Note:\n"
"Patient presents with chest pain and shortness of breath, history of hypertension.\n\n"
"### Question:\nSummarize this note.\n\n### Answer:\n"
)
inputs = tokenizer(prompt, return_tensors="pt")
out = model.generate(**inputs, max_new_tokens=100, do_sample=False, repetition_penalty=1.2)
print(tokenizer.decode(out[0], skip_special_tokens=True))
Training Configuration
Table with columns: Parameter, Value| Parameter | Value |
|---|
| Rank (r) | 16 |
| Alpha | 32 |
| Target modules | q_proj, v_proj |
| Dropout | 0.05 |
| Learning rate | 1e-4 |
| Epochs | 2 (partial run) |
| Batch size | 4 (gradient accumulation 4) |
Evaluation
Average perplexity on ground-truth clinical answers: base model 8.30, fine tuned model 5.84. Note that the evaluation set overlapped with the training data rather than being a strictly held-out split, so this reflects familiarity with the training distribution as much as generalization. See the project report for full details and qualitative comparisons.
Limitations
- Trained on synthetic, not real, clinical data (real MIMIC-III/MIMIC-CXR access requires credentialing)
- Small model scale (360M parameters), limited reasoning ability
- No clinical expert validation of outputs
- Output length not tightly controlled by the model
- Evaluation set was not a strictly held out split
Citation
- Base model: HuggingFaceTB, SmolLM2
- Dataset: starmpcc, Asclepius Synthetic Clinical Notes
- Method: Hu et al., "LoRA: Low Rank Adaptation of Large Language Models," 2021