medical-sft-lora

This model is a fine-tuned version of unsloth/llama-3-8b-bnb-4bit on the FreedomIntelligence/medical-o1-reasoning-SFT dataset, a specialized dataset designed for medical question-answering with chain-of-thought reasoning.

Model description

This model has been supervised fine-tuned using parameter-efficient fine-tuning (PEFT) with LoRA adapters on a medical question-answering dataset. It is intended to offer detailed, clinically reasoned answers to medical queries by following explicit chain-of-thought explanations, improving on the base LLMโ€™s understanding of medical reasoning and diagnosis.

Intended uses & limitations

  • Intended for research and educational purposes involving medical question-answering and reasoning.
  • Useful for generating detailed step-by-step medical explanations and diagnoses.
  • Not intended to replace professional medical advice, diagnosis, or treatment.
  • Users should critically assess outputs and consult qualified healthcare professionals for decision-making.

Training and evaluation data

  • Dataset: FreedomIntelligence/medical-o1-reasoning-SFT (English split).
  • Dataset samples contain medical questions, chain-of-thought detailed reasoning, and final concise answers.
  • The first 500 samples were used for supervised fine-tuning according to assignment requirements.

Training procedure

Fine-tuning was performed on the base model "unsloth/llama-3-8b-bnb-4bit", a 4-bit quantized LLM suitable for Colab GPU environments. The training used Hugging Face Transformers and PEFT libraries with the following steps:

  • Prompt templates were engineered to enforce detailed clinical reasoning and stepwise explanations.
  • Each training example combined a medical question, chain-of-thought reasoning, and final answer into the prompt-response pair.
  • LoRA adapters were applied, targeting the q_proj and v_proj transformer modules.

Training hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 5e-05
  • train_batch_size: 1
  • eval_batch_size: 8
  • seed: 42
  • gradient_accumulation_steps: 8
  • total_train_batch_size: 8
  • optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
  • lr_scheduler_type: linear
  • num_epochs: 3
  • mixed_precision_training: Native AMP (fp16)

Training results

  • Post-fine-tuning evaluation showed a marked improvement over the base model.
  • The fine-tuned version generates more accurate medical reasoning with logical step-by-step explanations aligned with clinical knowledge.
  • Outputs included clearer diagnoses and more relevant responses as compared to the base model.

Framework versions

  • PEFT 0.17.1
  • Transformers 4.55.4
  • Pytorch 2.8.0+cu126
  • Datasets 3.6.0
  • Tokenizers 0.21.4
Downloads last month
8
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for ImaginedTime/medical-sft-lora

Adapter
(317)
this model