base_model: "unsloth/Qwen3-4B-Instruct-2507"
dataset: "daichira/structured-hard-sft-4k"
language: "en"
license: "Apache-2.0"
library_name: "peft"
pipeline_tag: "text-generation"
tags: ["qlora","lora","peft","unsloth","structured-output","structeval-t","json","yaml","xml","toml","csv"]
qwen3-4b-structevalt-lora-hard4k
This repository provides a LoRA adapter fine-tuned from unsloth/Qwen3-4B-Instruct-2507 using QLoRA (4-bit, Unsloth).
✅ Adapter-only repository: this repo contains LoRA adapter weights (and tokenizer files if uploaded).
You must load the base model separately.
Goal
Improve structured output reliability for StructEval-T style tasks, especially on harder conversion/extraction cases across JSON/XML/YAML/TOML.
During training, loss is applied only to the final assistant output, masking intermediate reasoning (CoT) using output markers (e.g., Output:, Final:).
Training Configuration
- Base model:
unsloth/Qwen3-4B-Instruct-2507
- Dataset:
daichira/structured-hard-sft-4k (CC-BY-4.0)
- Method: QLoRA (4-bit) + PEFT LoRA
- Max sequence length: 512
- Epochs: 1
- Max steps: 200
- Learning rate: 1e-5
- Warmup ratio: 0.1
- Weight decay: 0.05
- Batch size (per device): train 2 / eval 2
- Gradient accumulation: 8 (effective batch = 16)
- LoRA: r=64, alpha=128, dropout=0.0
- LoRA target modules: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
- Seed: 3407
- Output learn mode:
after_marker
- Output markers:
Output:, OUTPUT:, Final:, Answer:, Result:, Response:
Run info (for reproducibility)
- RUN_ID:
20260205_111047__p1_hard4k__base=Qwen3-4B-Instruct-2507__ds=structured-hard-sft-4k__lr=1e-5__len=512__steps=200__r=64
Usage
1from transformers import AutoModelForCausalLM, AutoTokenizer
2from peft import PeftModel
3import torch
4
5base_id = "unsloth/Qwen3-4B-Instruct-2507"
6adapter_id = "sabia0080/qwen3-4b-structevalt-lora-hard4k"
7
8tokenizer = AutoTokenizer.from_pretrained(base_id)
9model = AutoModelForCausalLM.from_pretrained(
10 base_id,
11 torch_dtype=torch.float16,
12 device_map="auto",
13)
14
15model = PeftModel.from_pretrained(model, adapter_id)
16model.eval()
License & Terms
- Dataset license: CC-BY-4.0 (
daichira/structured-hard-sft-4k)
- Base model terms: comply with the base model’s original terms of use.
- Repo license (
Apache-2.0) applies to this adapter repository contents (adapter files / model card), and does not override dataset/base-model terms.