CoolFace
Modelpublic

Legeng/Llama-3.1-8B-PubMedQA-QLoRA

sourceHugging Facellama3.1updated 3mo agoView on Hugging Face
2likes8downloads
Model Card

Llama-3.1-8B-PubMedQA-QLoRA

QLoRA adapter for Llama-3.1-8B-Instruct, fine-tuned on PubMedQA for yes / no / maybe biomedical question answering (run5).

Built with Llama. Use of the base model is governed by the Llama 3.1 Community License.

Model details

  • —Base model: unsloth/Meta-Llama-3.1-8B-Instruct-bnb-4bit
  • —Method: QLoRA (4-bit base), LoRA r=16, alpha=32, dropout=0.0
  • —Target modules: q,k,v,o,gate,up,down projections
  • —Task: PubMedQA classification (yes / no / maybe)
  • —Trained with: Unsloth + PEFT 0.18.1

Evaluation (run5)

modelaccmacro_f1weighted_f1maybe_recalleceyn_cross
Run 3 TEST calibrated (ref)0.77400.61600.76200.16400.1090-
run5 VAL raw0.70000.56320.72780.20000.05412
run5 VAL calibrated0.64000.54440.70560.20000.05410
run5 TEST raw0.72200.62140.74490.38180.065027
run5 TEST calibrated0.64800.59360.70180.58180.065015

Reliability diagrams, confusion matrices, and calibration sweeps are included in the metrics_run5_m150/ folder of this repo.

Usage

python
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer

base = "unsloth/Meta-Llama-3.1-8B-Instruct-bnb-4bit"
model = AutoModelForCausalLM.from_pretrained(base, device_map="auto")
model = PeftModel.from_pretrained(model, "Legeng/Llama-3.1-8B-PubMedQA-QLoRA")
tok = AutoTokenizer.from_pretrained("Legeng/Llama-3.1-8B-PubMedQA-QLoRA")

Framework versions

  • —PEFT 0.18.1