Downloads · 30 days
0
GawinGowin/qwen3-4b-struct-output
qwen3-4b-struct-output is a text generation model from GawinGowin. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
This model is a full-merged version of Qwen/Qwen3-4B-Instruct-2507 fine-tuned for structured output tasks (JSON / YAML / XML / TOML / CSV) via a two-stage pipeline: SFT (QLoRA) → DPO.
Downloads · 30 days
0
Access
Public
Updated Mar 2, 2026
Repo size
77.6 MB
Likes
0
Public
Click a slice to open those files.
.safetensors66.1 MB · 82%
From the Hugging Face model README
This model is a full-merged version of Qwen/Qwen3-4B-Instruct-2507 fine-tuned for structured output tasks (JSON / YAML / XML / TOML / CSV) via a two-stage pipeline: SFT (QLoRA) → DPO.
Qwen/Qwen3-4B-Instruct-2507 (base)
|
v
SFT via QLoRA (4-bit, Unsloth)
- Dataset: v2 + structured-hard-sft-4k + structured-5k-mix-sft (concatenated)
- Adapter saved as LoRA weights
|
v
Merge LoRA adapter into full 16-bit weights
|
v
DPO (Direct Preference Optimization)
- Dataset: u-10bei/dpo-dataset-qwen-cot
|
v
GawinGowin/qwen3-4b-struct-output (this model)
| Parameter | Value |
|---|---|
| Base model | Qwen/Qwen3-4B-Instruct-2507 |
| Method | QLoRA (4-bit) + Unsloth |
| Datasets | u-10bei/structured_data_with_cot_dataset_512_v2, daichira/structured-hard-sft-4k, daichira/structured-5k-mix-sft |
| Max sequence length | 1024 |
| Epochs | 2 |
| Learning rate | 5e-6 |
| LoRA r / alpha | 64 / 128 |
| CoT Masking | Enabled (loss applied after Output: marker only) |
| Parameter | Value |
|---|---|
| Method | DPO (TRL) + Unsloth |
| Dataset | u-10bei/dpo-dataset-qwen-cot |
| Epochs | 1 |
| Learning rate | 1e-7 |
| Beta | 0.1 |
| LoRA r / alpha | 8 / 16 (merged) |
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "GawinGowin/qwen3-4b-struct-output"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id, torch_dtype=torch.float16, device_map="auto",
)