π©Ί Mistral-Medical-Chat-LoRA v2
A medical conversation assistant LoRA fine-tuned to provide safe, calm, and structured responses to patient health questions, while avoiding diagnosis, prescriptions, and high-risk medical claims.
This version focuses on patient-style interactions, improving upon general medical Q&A by handling conversational cues, clarifying questions, and safety-oriented guidance.
It responds to medical questions with:
- Calm, structured explanations
- Encouragement for professional evaluation
- High-level guidance on general health
- Clarifying questions to better understand the patient
- Avoids guessing diagnoses or giving medications
π§ Base Model
- Base:
mistralai/Mistral-7B-Instruct-v0.2 - Finetuning: LoRA (QLoRA low-rank adapter)
- Framework: Unsloth + TRL + PEFT
This model does not perform diagnosis and does not provide medication dosing.
β Intended Use
| Use Case | Allowed | Notes |
|---|---|---|
| General health questions | β | Calm, structured guidance |
| Explaining symptoms conceptually | β | High-level guidance, no diagnosis |
| First-aid general instructions | β | Only general safety advice |
| Patient support conversation | β | Reassuring and clarifying |
| Medical education support | β | Suitable for study / learning |
| Diagnosing medical conditions | β | Must avoid guessing |
| Prescribing medications | β | High-risk β blocked behavior |
| Emergency care instructions | β | Always refer to real professionals |
βοΈ Safety Behavior
The model is trained to:
- Avoid firm diagnoses
- Encourage professional evaluation when appropriate
- Ask clarifying questions
- Not provide medication dosages
- Avoid urgent-care decision instructions
This aligns the model with safe conversational medical use.
π Training Details
Dataset Used
| Dataset | Size | Purpose |
|---|---|---|
mahfoos/Patient-Doctor-Conversation (filtered) |
~3k examples | Base conversational patterns |
| Custom Gold Conversations | ~80 examples | Style & safe tone fine-tuning |
Data Preparation
- Removed incomplete doctor responses
- Reformatted dataset into promptβresponse style
- Emphasized safe communication guidelines
Training Configuration
- Method: LoRA Finetuning
- Rank: 16
- Precision: 4-bit QLoRA
- Batching: Gradient accumulation enabled for low-VRAM training
π§ͺ Example Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base = "mistralai/Mistral-7B-Instruct-v0.2"
adapter = "ysn-ir/mistral-medical-chat-lora-v2"
tokenizer = AutoTokenizer.from_pretrained(base)
model = AutoModelForCausalLM.from_pretrained(base, device_map="auto")
model = PeftModel.from_pretrained(model, adapter)
prompt = "Patient: I have chest tightness and shortness of breath.\nDoctor:"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=200)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
π Limitations
- Not a medical professional
- Does not know patient history
- Risk of hallucination is mitigated, not removed
- Should never be used for emergency treatment
If the user reports:
- Severe pain
- Difficulty breathing
- Loss of consciousness
- Chest pain
β The model must advise immediate medical attention.
π€ Author
Hugging Face: https://huggingface.co/ysn-ir Maintained by: ysn-ir
π§Ύ License
Released under Apache-2.0. Permitted for:
- Research
- Personal use
- Commercial use
Not permitted for clinical decision-making.
β¨ Summary
This v2 model:
- Focuses on patient-style conversation with safe guidance
- Provides structured, calm responses for health-related queries
- Reinforces professional referral behavior
v1 builds on this with education-focused Q&A rather than patient conversation.
Use responsibly.
- Downloads last month
- 2
Model tree for ysn-ir/mistral-medical-chat-lora-v2
Base model
mistralai/Mistral-7B-Instruct-v0.2