CoolFace
Modelpublic

ryo-llm/qwen3-4b-structured-output-lora-202602081454

sourceHugging Faceapache-2.0updated 8mo agoView on Hugging Face
0likes12downloads
Model Card

qwen3-4b-structured-output-lora-202602081454

This repository provides a LoRA adapter fine-tuned from Qwen/Qwen3-4B-Instruct-2507 using QLoRA (4-bit, Unsloth) to improve structured output accuracy (JSON / YAML / XML / TOML / CSV).

This repository contains LoRA adapter weights only. Load the base model separately, then apply this adapter.

Training Objective

Improve strict, machine-readable structured outputs (no extra prose).

Data Normalization

To reduce preface/explanation text learned from the synthetic dataset, the training samples were normalized:

  • —Extracted only the substring after Output: in the final assistant message.
  • —Removed Markdown code fences (``json/`yaml/`xml/`toml/``csv).
  • —Dropped trailing "Notes:" sections if present.

Training Configuration

  • —Base model: Qwen/Qwen3-4B-Instruct-2507
  • —Method: QLoRA (4-bit), Unsloth
  • —Max sequence length: 1024
  • —Epochs: 3
  • —Learning rate: 1e-05
  • —LoRA: r=16, alpha=32

Usage

python
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch

base = "Qwen/Qwen3-4B-Instruct-2507"
adapter = "ryo-llm/qwen3-4b-structured-output-lora-202602081454"

tokenizer = AutoTokenizer.from_pretrained(base)
model = AutoModelForCausalLM.from_pretrained(
    base,
    torch_dtype=torch.float16,
    device_map="auto",
)
model = PeftModel.from_pretrained(model, adapter)

## Sources & Terms (IMPORTANT)

Training data: u-10bei/structured_data_with_cot_dataset_512_v5

Dataset License: MIT License (see the dataset card).
Compliance: Users must comply with the dataset license terms and the base model's original terms of use.