🩺 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
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for ysn-ir/mistral-medical-chat-lora-v2

Adapter
(1248)
this model

Dataset used to train ysn-ir/mistral-medical-chat-lora-v2