Dedicated Endpoints

Run this model inference on single tenant GPU with unmatched speed and reliability at scale.

Learn more
Container

Run this model inference with full control and performance in your environment.

Learn more

Get help setting up a custom Dedicated Endpoints.

Talk with our engineer to get a quote for reserved GPU instances with discounts.

README

License: mit

Bioalignment results

MetricBase Phi-4This adapter
Δpup−0.1195−0.0020
Improvement+0.1175
Parse rate100% (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.

Training details

ParameterValue
Base modelmicrosoft/phi-4
MethodQLoRA (4-bit NF4, double quantization)
LoRA rank / alpha32 / 32
LoRA dropout0.05
Target modulesall-linear
Learning rate2e-4 (cosine decay)
Effective batch size16 (batch 2 × grad accum 8)
Epochs2
Total optimizer steps770
Warmup steps38 (5%)
Max grad norm0.3
Sequence length2048
OptimizerPagedAdamW8bit
Compute dtypebfloat16
Training examples6160 (3984 CPT abstracts + 2176 instruction)
Validation examples664
Best val loss1.5943 (step 700)
HardwareNVIDIA A40 48GB

All CPT (continues pretraining) examples were converted to Phi-4 instruction chat format to prevent format drift — the key fix vs. earlier Qwen3-14B training.

Usage

python

from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
base = AutoModelForCausalLM.from_pretrained(
"microsoft/phi-4", torch_dtype=torch.bfloat16, device_map="auto"
)
model = PeftModel.from_pretrained(base, "Bioaligned/Phi-4-instruct-bioaligned-qlora")
model = model.merge_and_unload()
tokenizer = AutoTokenizer.from_pretrained("microsoft/phi-4")

For the ready-to-use merged model see Bioaligned/Phi-4-Instruct-Bioaligned.

Model provider

Bioaligned

Model tree

Base

microsoft/phi-4

Adapter

this model

Modalities

Input

Text

Output

Text

Pricing

Dedicated Endpoints

View details

Supported Functionality

Model APIs

Dedicated Endpoints

Container

More information

Explore FriendliAI today