Downloads · 30 days
14
4% of all-time downloads
sparx3/Qwen3.5-0.8B-SFT-DPO
Qwen3.5-0.8B-SFT-DPO is a text generation model from sparx3. Use it when you need the model to write or continue text. It is set up for transformers.
This is a fine-tuned version of Qwen/Qwen3.5-0.8B-Base. It was trained using a complete Supervised Fine-Tuning (SFT) and Direct Preference Optimization (DPO) pipeline using LoRA adapters. The model is capable of instr…
Downloads · 30 days
14
4% of all-time downloads
All-time downloads
330
Public
Parameters
752M
1.5 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.5 GB · 99%
From the Hugging Face model README
This is a fine-tuned version of Qwen/Qwen3.5-0.8B-Base. It was trained using a complete Supervised Fine-Tuning (SFT) and Direct Preference Optimization (DPO) pipeline using LoRA adapters. The model is capable of instruction-following and conversational interactions utilizing the ChatML prompt format.
This model was developed as part of Assignment 04 for the "NLP with Deep Learning" course at the Institute of Business Administration. The objective was to transform a raw base model (Qwen3.5-0.8B-Base) into a human-aligned, instruction-following assistant.
The model was trained in two stages:
alpaca-cleaned to learn the ChatML conversation format.ultrafeedback_binarized to align the model with human preferences, encouraging more thorough and structured responses.Qwen/Qwen3.5-0.8B-BaseThe model is intended to be used for general instruction-following tasks, including writing Python/JavaScript code, answering science and history questions, and creative writing. It must be prompted using the ChatML format (<|im_start|>user...\n<|im_start|>assistant...).
Because this is a highly compact (0.8 billion parameter) model fine-tuned on a limited dataset subset, it is not suitable for high-stakes, real-world deployment.
Based on comprehensive evaluation, the model exhibits the following known limitations:
Use the code below to get started with the model. Note that the apply_chat_template function automatically handles the required ChatML formatting.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "sparx3/Qwen3.5-0.8B-SFT-DPO"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto")
prompt = "Write a Python function that takes a list of integers and returns the sum of all even numbers in the list. Include an example usage."
messages = [
{"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
yahma/alpaca-cleaned (instruction-response pairs).trl-lib/ultrafeedback_binarized (chosen/rejected pairs).The model was trained using Parameter-Efficient Fine-Tuning (PEFT) with LoRA. The SFT weights were merged into the base model prior to initiating the DPO stage.
Best SFT Configuration (Trial 4):
q_proj, v_projBest DPO Configuration (Trial 3):
q_proj, v_projThe model was evaluated against a custom, fixed test set of 10 highly diverse prompts generated by DeepSeek-v4-flash, spanning coding, science, math, history, and creative writing.
Metrics:
distilbert-base-uncased).The pipeline demonstrated monotonic improvement across stages, confirming that preference optimization successfully added semantic quality beyond instruction tuning.
| Stage | BLEU | BERTScore | Validation Loss |
|---|---|---|---|
| Base Model | 0.1226 | 0.8025 | N/A |
| Best SFT (Trial 4) | 0.1256 | 0.8144 | 1.3790 |
| Best DPO (Trial 3) | 0.1337 | 0.8230 | 0.6601 |
Reward Accuracy: The best DPO model achieved a 60% reward accuracy during evaluation with a reward margin of 0.086, confirming genuine preference learning.
Training was conducted efficiently using serverless cloud infrastructure on Modal.com.
APA: Javed, M., Raza, Q., & Khan, R. (2024). Instruction Tuning and Preference Fine-Tuning of Qwen3.5-0.8B-Base. Institute of Business Administration.