Downloads · 30 days
5
9% of all-time downloads
SanatanSinghVishen/sift-1b-dpo
sift-1b-dpo is a text generation model from SanatanSinghVishen. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as mit.
Sift-1B-DPO is the flagship 1.5B Small Language Model (SLM) adapter trained via Direct Preference Optimization (DPO) on top of the SFT checkpoint. It achieves 100% Tool Selection Accuracy and 95.2% overall benchmark s…
Downloads · 30 days
5
9% of all-time downloads
All-time downloads
55
Public
Repo size
159 MB
Likes
0
Public
Click a slice to open those files.
.safetensors73.9 MB · 87%
From the Hugging Face model README
Sift-1B-DPO is the flagship 1.5B Small Language Model (SLM) adapter trained via Direct Preference Optimization (DPO) on top of the SFT checkpoint. It achieves 100% Tool Selection Accuracy and 95.2% overall benchmark score, gently steering the model away from parameter hallucinations, schema mismatches, and markdown formatting fluff.
unsloth/Qwen2.5-1.5B-Instruct-bnb-4bit (trained via SanatanSinghVishen/sift-1b-sft)checkpoint-750en)SanatanSinghVishen/sift-1b-ggufWhile Supervised Fine-Tuning (SFT) teaches the model how to generate JSON, models often output unnecessary prose, hallucinated key-value pairs, or slightly invalid data types.
Sift-1B-DPO represents Stage 2 in the Sift-1B pipeline:
json ... ), conversational intros ("Here is your JSON:"), missing required arguments, or wrong tool choices.Through DPO alignment with $\beta = 0.1$, Sift-1B-DPO delivers deterministic, instant local tool calling.
Across comprehensive evaluation tests (50 multi-domain benchmark queries), DPO Checkpoint-750 emerged as the golden checkpoint:
| Model / Checkpoint | Tool Selection Acc. | Parameter Extraction | Strict JSON Validity | Overall Score | Avg Latency (TTFT) |
|---|---|---|---|---|---|
| Qwen2.5-1.5B Base | 78.4% | 62.1% | 81.0% | 73.8% | ~2,100 ms |
| Sift-1B-SFT | 96.0% | 84.0% | 97.5% | 92.5% | ~1,850 ms |
| Sift-1B-DPO (ckpt-250) | 98.0% | 84.0% | 98.0% | 93.3% | ~1,790 ms |
| Sift-1B-DPO (ckpt-500) | 98.0% | 86.0% | 100.0% | 94.7% | ~1,740 ms |
| 🏆 Sift-1B-DPO (ckpt-750 - Golden) | 100.0% | 88.0% | 100.0% | 95.2% | 1,714 ms |
| Sift-1B-DPO (ckpt-1000) | 98.0% | 86.0% | 98.0% | 94.0% | ~1,760 ms |
| Sift-1B-DPO (ckpt-1250) | 96.0% | 84.0% | 96.0% | 92.0% | ~1,820 ms |
Run Sift-1B-DPO using Hugging Face transformers and peft:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model_name = "unsloth/Qwen2.5-1.5B-Instruct-bnb-4bit"
adapter_name = "SanatanSinghVishen/sift-1b-dpo"
# 1. Load Tokenizer & Base Model
tokenizer = AutoTokenizer.from_pretrained(base_model_name, trust_remote_code=True)
base_model = AutoModelForCausalLM.from_pretrained(
base_model_name,
torch_dtype=torch.bfloat16,
device_map="auto"
)
# 2. Load Golden DPO Adapter
model = PeftModel.from_pretrained(base_model, adapter_name)
model.eval()
# 3. Formulate Input Query
messages = [
{
"role": "system",
"content": "You are a function calling agent. Output only valid JSON tool calls."
},
{
"role": "user",
"content": "Book a ride to JFK airport arriving by 5:00 PM."
}
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
# 4. Generate Clean JSON Response
with torch.no_grad():
outputs = model.generate(**inputs, max_new_tokens=128, temperature=0.1)
response = tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True)
print(response)