Views
No views yet
google/medgemma-4b-it for generating patient-friendly health reports that communicate diabetic retinopathy screening results using probabilistic framing and health-literate language.| Parameter | Value |
|---|---|
| Base model | google/medgemma-4b-it |
| PEFT method | LoRA |
| Rank | 16 |
| Alpha | 32 |
| Dropout | 0.1 |
| Target modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Trainable params | 0.76% of base model |
| Training data | 43 participants from AI-READI dataset |
| Training targets | GPT-5.2 generated reports with probabilistic framing |
| Hardware | Apple Silicon M4 (MPS backend), float32 |
| Epochs | ~55 steps with gradient accumulation=4 |
| Criterion | Fine-tuned (this) | Base MedGemma | Improvement |
|---|---|---|---|
| Probability communication | 4.3 | 3.3 | +1.0 |
| Actionability | 3.7 | 2.6 | +1.1 |
| Clinical accuracy | 3.0 | 3.0 | 0 |
| Readability | 4.1 | 4.1 | 0 |
| Completeness | 5.0 | 4.9 | +0.1 |
| Overall quality | 3.4 | 3.1 | +0.3 |
| Overall mean | 3.9/5 | 3.5/5 | +0.4 |
1from transformers import AutoModelForCausalLM, AutoProcessor
2from peft import PeftModel
3
4base_model = AutoModelForCausalLM.from_pretrained("google/medgemma-4b-it")
5model = PeftModel.from_pretrained(base_model, "drdavidl/medgemma-stage2-report")
6processor = AutoProcessor.from_pretrained("google/medgemma-4b-it")
7
8prompt = """You are a health communication specialist...
9SCREENING RESULTS:
10- Probability of diabetic retinopathy: 42.0% (about 4 out of 10)
11...
12"""
13
14messages = [{"role": "user", "content": prompt}]
15inputs = processor.apply_chat_template(messages, add_generation_prompt=True,
16 tokenize=True, return_tensors="pt")
17outputs = model.generate(**inputs, max_new_tokens=2048, temperature=0.3)
18report = processor.decode(outputs[0], skip_special_tokens=True)