Downloads · 30 days
8
17% of all-time downloads
mikaelkanzaki/tech3-v3
tech3-v3 is a text generation model from mikaelkanzaki. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
tech3-v3 is an experimental LoRA adapter created for an academic study of supervised fine-tuning and retrieval-augmented generation (RAG) using medical question-answer data.
Downloads · 30 days
8
17% of all-time downloads
All-time downloads
47
Public
Repo size
77.6 MB
Likes
0
Public
Click a slice to open those files.
.safetensors66.1 MB · 85%
From the Hugging Face model README
tech3-v3 is an experimental LoRA adapter created for an academic study of supervised fine-tuning and retrieval-augmented generation (RAG) using medical question-answer data.
Evaluation status: REJECTED for clinical or production use.
This artifact is intentionally published to document the experiment, including its unsuccessful validation outcome. It must not be used for diagnosis, treatment, medication decisions, emergencies, or other medical guidance.
unsloth/Qwen3-4B-Instruct-2507-unsloth-bnb-4bit4212a031d961c99427d27034327f1dc4fb6ffd2aThis adapter is shared for:
It is not intended for clinical deployment or unsupervised end-user use. Any research use should preserve the warnings and independently validate the outputs.
The source is MedQuAD, a medical question-answer collection created from NIH websites and published under CC BY 4.0. Please cite the original dataset authors:
Asma Ben Abacha and Dina Demner-Fushman. "A Question-Entailment Approach to Question Answering." BMC Bioinformatics, 2019.
The project produced document-aware train, validation, and test splits. The candidate-v3 smoke run selected records deterministically and balanced them across nine answer-bearing MedQuAD source groups:
The system instruction used during SFT was:
You are a medical information assistant. Answer only the question asked with concise educational information grounded in reliable medical sources. If reliable information is unavailable, say that it is unknown instead of inventing details. Do not prescribe medication, diagnose a patient, or replace a qualified healthcare professional.
| Setting | Value |
|---|---|
| Method | Supervised fine-tuning with LoRA |
| LoRA rank / alpha | 16 / 16 |
| LoRA dropout | 0.0 |
| Target modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Maximum sequence length | 2,048 tokens |
| Precision | 4-bit base loading with BF16 support |
| Optimizer | AdamW 8-bit |
| Learning rate | 0.0002 |
| Effective batch size | 8 through gradient accumulation |
| Steps | 50 |
| Seed | 3407 |
| Training loss | 1.4417 |
| Validation loss | 1.3688 |
The run used one NVIDIA GeForce RTX 5060 Ti with approximately 16 GiB VRAM. Training runtime was about 513 seconds. Carbon emissions were not measured.
The base model and adapter were compared on the same 20 validation questions. Generation used temperature 0.7, top-p 0.8, top-k 20, repetition penalty 1.1, and deterministic per-record seeds.
| Metric | Base | Fine-tuned |
|---|---|---|
| Empty answers | 0 | 0 |
| Mean reference token F1 | 0.2741 | 0.3066 |
| Mean latency in seconds | 14.2588 | 13.7565 |
| Per-record token-F1 wins | 7 | 13 |
Token overlap was treated only as an auxiliary metric. It did not predict the human preference outcome.
The review was non-blinded, non-clinical, AI-assisted, and limited to 20 validation examples. Scores ranged from 0 to 2.
| Criterion | Base | Fine-tuned |
|---|---|---|
| Mean correctness | 1.25 | 1.05 |
| Mean completeness | 1.50 | 1.60 |
| Mean safety | 1.30 | 1.05 |
| Preferred answers | 10 | 7 |
There were three ties, eight safety regressions, and one severe safety regression. The project quality gate rejected this candidate because the fine-tuned model was not preferred more often and showed a severe safety regression.
import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base_id = "Qwen/Qwen3-4B-Instruct-2507"
adapter_id = "mikaelkanzaki/tech3-v3"
base_revision = "f5d253c7173262c9fbfd68aee1eda21bdc375fb5"
tokenizer = AutoTokenizer.from_pretrained(adapter_id)
base_model = AutoModelForCausalLM.from_pretrained(
base_id,
revision=base_revision,
torch_dtype="auto",
device_map="auto",
)
model = PeftModel.from_pretrained(base_model, adapter_id)
model.eval()
messages = [
{
"role": "system",
"content": (
"You are a medical information assistant. Answer only the question "
"asked with concise educational information grounded in reliable medical "
"sources. If reliable information is unavailable, say that it is unknown "
"instead of inventing details. Do not prescribe medication, diagnose a "
"patient, or replace a qualified healthcare professional."
),
},
{"role": "user", "content": "What is heart failure?"},
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
with torch.inference_mode():
output = model.generate(
**inputs,
max_new_tokens=256,
do_sample=True,
temperature=0.7,
top_p=0.8,
top_k=20,
repetition_penalty=1.1,
)
answer = tokenizer.decode(
output[0][inputs["input_ids"].shape[-1]:],
skip_special_tokens=True,
)
print(answer)
Outputs can be factually wrong even when they sound confident. Do not present them as medical advice.
The Hub repository includes the training and model manifests plus the summarized validation decision. The complete project pipeline and tests are maintained in the tech-fine-tuning repository.