OpenVetQA-gemma3-4b-v1

QLoRA adapter (r=16) for unsloth/gemma-3-4b-it, trained on OpenVetQA-sft-v1. This is a demonstration artifact: the point is that the dataset improves the model, not that the model is clinically reliable.

Dataset · Qwen version · Trust report

Results

Eval tier Base Tuned Δ
dev2 (157 items) 64.97% 75.80% +10.83
VetQA-Silver (146 items) 69.18% 77.40% +8.22

Base vs tuned accuracy on dev2 and VetQA-Silver

VetQA-Silver items come from documents carved out by sha256(source_doc_uid) % 20 == 0 before any generation or training ran. The gain on that tier is generalization, not memorization.

Training

  • Base: gemma-3-4b-it, 4-bit NF4 quantization, bf16 compute
  • LoRA: r=16, alpha=32, dropout 0.05, all attention and MLP projections (32.8M trainable parameters, 0.76%)
  • Data: OpenVetQA-sft-v1 train split (2,494 chat rows)
  • 3 epochs, 234 steps, lr 2e-4 cosine with 3% warmup, effective batch 32, seed 42
  • One A100-SXM4-40GB, about 18 minutes
  • Final loss 1.039, token accuracy 74.7%

Training evolution over 234 steps — loss falls, token accuracy climbs (gemma-3-4b vs Qwen3-4B)

Usage

import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
from transformers import BitsAndBytesConfig

base = "unsloth/gemma-3-4b-it"
bnb = BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_quant_type="nf4",
                         bnb_4bit_compute_dtype=torch.bfloat16)
tok = AutoTokenizer.from_pretrained(base)
model = AutoModelForCausalLM.from_pretrained(base, quantization_config=bnb,
                                             dtype=torch.bfloat16,
                                             device_map={"": 0})
model = PeftModel.from_pretrained(model, "Douxgen/OpenVetQA-gemma3-4b-v1")

prompt = ("Q: A 7-year-old Labrador presents with acute vomiting and melena. "
          "Which diagnostic step is most appropriate first?\n"
          "A. Endoscopy\nB. Abdominal ultrasound\n"
          "C. Coagulation profile\nD. Plasma transfusion\n\nA:")
ids = tok(prompt, return_tensors="pt").to(model.device)
out = model.generate(**ids, max_new_tokens=8, do_sample=False,
                     pad_token_id=tok.eos_token_id)
print(tok.decode(out[0][ids["input_ids"].shape[1]:],
                 skip_special_tokens=True))

Limitations

  • 4B demonstration model. It will still hallucinate on edge cases and is not suitable for clinical use, dosing, or triage.
  • Dataset items are grounding-verified against their sources, not veterinarian-validated.
  • Sources are 2015+ publications. Verify doses against current labels.

License

Adapter: CC BY-NC 4.0. Base model: subject to Gemma's own terms. Data sources: CC-BY PMC open-access, per-item license embedded.

Citation

@model{openvetqa_gemma3_4b_v1,
  title  = {OpenVetQA-gemma3-4b-it-v1: veterinary QLoRA adapter},
  year   = {2026},
  url    = {https://huggingface.co/Douxgen/OpenVetQA-gemma3-4b-v1}
}
Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Douxgen/OpenVetQA-gemma3-4b-v1

Adapter
(31)
this model

Dataset used to train Douxgen/OpenVetQA-gemma3-4b-v1

Evaluation results

  • 157-item dev2 on OpenVetQA-sft-v1 dev2
    self-reported
    75.800
  • 146-item VetQA-Silver on OpenVetQA VetQA-Silver (holdout)
    self-reported
    77.400