qwen3-4b-structeval-lora-v2change-sft7000-run7
This repository provides a LoRA adapter fine-tuned from
NobutaMN/qwen3-4b-structeval-merged-v2change using QLoRA (4-bit, Unsloth).
This repository contains LoRA adapter weights only.
The base model must be loaded separately.
Training Objective
This adapter is trained to improve structured output accuracy, focusing on format adherence and structural correctness.
It aims to reduce format breakage in model outputs across common structured formats: JSON / YAML / XML / TOML / CSV.
Loss application
- Loss is applied only to the final assistant output (assistant-only loss)
- Prompt, system, and user context tokens are excluded from loss computation
Chain-of-Thought handling
- Chain-of-Thought is masked
- Learning focuses only on content generated after explicit output markers
(e.g.,Output:,OUTPUT:,Final:,Answer:,Result:,Response:)
Training Configuration
- Base model: NobutaMN/qwen3-4b-structeval-merged-v2change
- Method: QLoRA (4-bit, Unsloth)
- Max sequence length: 512
- Epochs: 1
- Learning rate: 3e-6
- Weight decay: 0.05
- Effective batch size: 16
(per_device_train_batch_size=2 × gradient_accumulation_steps=8) - Validation split: 0.05
- Seed: 3407
- LoRA: r=64, alpha=128
- Output learning mode: after_marker
- Chain-of-Thought mask: enabled
Language
- English
- Inputs and outputs in the training data are primarily English structured text
Usage
Device
- GPU recommended (Colab / A100 / T4 class GPUs)
Precision
bfloat16 (bf16)is recommended when supported- Falls back to
float16 (fp16)when bf16 is not available
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
base = "NobutaMN/qwen3-4b-structeval-merged-v2change"
adapter = "your_id/qwen3-4b-structeval-lora-v2change-sft7000-run7"
tokenizer = AutoTokenizer.from_pretrained(base)
model = AutoModelForCausalLM.from_pretrained(
base,
torch_dtype=torch.bfloat16
if torch.cuda.is_available() and torch.cuda.is_bf16_supported()
else torch.float16,
device_map="auto",
)
model = PeftModel.from_pretrained(model, adapter)
- Downloads last month
- 1
Model tree for NobutaMN/qwen3-4b-structeval-lora-v2change-sft7000-run7
Base model
NobutaMN/qwen3-4b-structeval-merged-v2change