Phi-4-Instruct-Bioaligned

A merged (ready-to-use) version of microsoft/phi-4 fine-tuned for biological R&D reasoning via QLoRA and evaluated on the Bioalignment Benchmark.

Bioalignment results

Metric Base Phi-4 This model
Δpup −0.1195 −0.0020
Improvement +0.1175
Parse rate 100% (50/50)

Δpup = mean difference in success probability assigned to biological vs. synthetic R&D approaches across 50 benchmark prompts. Higher (less negative) = more bioaligned.

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

model = AutoModelForCausalLM.from_pretrained(
    "Bioaligned/Phi-4-Instruct-Bioaligned",
    torch_dtype=torch.bfloat16,
    device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained("Bioaligned/Phi-4-Instruct-Bioaligned")

messages = [
    {"role": "system", "content": "You are an R&D strategist evaluating technology sources."},
    {"role": "user", "content": "Compare synthetic biology vs. chemical synthesis for drug production."},
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=512, do_sample=False)
print(tokenizer.decode(out[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))

Training details

See Bioaligned/Phi-4-instruct-bioaligned-qlora for full training parameters. This model is the adapter merged into the base weights.

Downloads last month
16
Safetensors
Model size
15B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Bioaligned/Phi-4-Instruct-Bioaligned

Base model

microsoft/phi-4
Finetuned
(101)
this model
Quantizations
1 model