Downloads · 30 days
0
ShAIkespear/Phi-2_DPO_M3_Base_Alt
Phi-2_DPO_M3_Base_Alt is a machine learning model from ShAIkespear. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as mit.
A LoRA-finetuned and Direct Preference Optimization (DPO)–aligned variant of microsoft/phi-2, specialized for multiple-choice question answering (MCQA) with an emphasis on STEM and general knowledge domains. This mode…
Downloads · 30 days
0
Access
Public
Updated Nov 1, 2025
Repo size
52.4 MB
Likes
0
Public
Click a slice to open those files.
.safetensors52.4 MB · 94%
From the Hugging Face model README
A LoRA-finetuned and Direct Preference Optimization (DPO)–aligned variant of microsoft/phi-2, specialized for multiple-choice question answering (MCQA) with an emphasis on STEM and general knowledge domains. This model represents the alternative base configuration of the final M3 (balanced-then-DPO) training pipeline from the ShAIkespear project. It preserves full precision for highest fidelity and further fine-tuning, without 8-bit quantization.
Maintain the structured prompt format:
### Question ...
### Explanation ...
### Answer:
Keep human supervision in any educational or grading use.
Prefer this full-precision model for fine-tuning or evaluation; use quantized versions for deployment.
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "ShAIkespear/Phi-2_DPO_M3_Base_Alt"
tok = AutoTokenizer.from_pretrained(model_id, use_fast=True)
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto")
prompt = "### Question: Which element has the chemical symbol 'O'?\n### Explanation: The symbol 'O' represents this essential gas.\n### Answer:"
inputs = tok(prompt, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=15)
print(tok.decode(out[0], skip_special_tokens=True))