Instructions to use Centkun/qwen3-4b-instruct-2507-lora-homework_v11 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Centkun/qwen3-4b-instruct-2507-lora-homework_v11 with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/qwen3-4b-instruct-2507-unsloth-bnb-4bit") model = PeftModel.from_pretrained(base_model, "Centkun/qwen3-4b-instruct-2507-lora-homework_v11") - Notebooks
- Google Colab
- Kaggle
Centkun/qwen3-4b-instruct-2507-lora-homework_v11
This repository provides a LoRA adapter fine-tuned from Qwen/Qwen3-4B-Instruct-2507 using QLoRA (4-bit, Unsloth).
This repository contains LoRA adapter weights only. The base model must be loaded separately.
Training Objective
##jp ##また書き直す ##学習率(SFT_LR)を 5e-04 に上げた理由、検証損失(Validation Loss)の最適化と学習効率の向上を目的として標準コードの初期設定(1e-06)では学習が非常に緩やかと考えました。 ##1e-04付近まで学習率を上げることで検証損失が低下し、モデルが正解をより正確に学習できると仮説立てて試しに実行しています。 ##LoRAの alpha=r=64 とした理由:重み更新のスケーリング安定化と計算リソースの節約 ##α=r の設定: LoRAの設計基準(元の論文)において、「α(スケーリング係数)をランク r と同じ値に固定する」ことは、学習時の重み更新の振れ幅を安定させるための標準的な手法と解釈している。 ##これにより、ランクを変更してもハイパーパラメータの再調整が容易になると考えている。が今回はαをrの2倍にした。 ##r=64 の選択: 構造化データ出力のような特定のタスク適応には、ランク r は2, 4, 8といった小さな値で十分な性能を発揮すると解釈。 ##今回は初期値64にすることで、モデルの表現力を維持しつつ、メモリ使用量を抑え、学習をより軽量化・高速化する意図がある。
This adapter is trained to improve structured output accuracy (JSON / YAML / XML / TOML / CSV).
Loss is applied only to the final assistant output, while intermediate reasoning (Chain-of-Thought) is masked.
Training Configuration
- Base model: Qwen/Qwen3-4B-Instruct-2507
- Method: QLoRA (4-bit)
- Max sequence length: 1024
- Epochs: 1
- Learning rate: 5e-04
- LoRA: r=64, alpha=128
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
base = "Qwen/Qwen3-4B-Instruct-2507"
adapter = "Centkun/qwen3-4b-instruct-2507-lora-homework_v11"
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_v2
Dataset License: MIT License. This dataset is used and distributed under the terms of the MIT License. Compliance: Users must comply with the MIT license (including copyright notice) and the base model's original terms of use.
- Downloads last month
- 1
Model tree for Centkun/qwen3-4b-instruct-2507-lora-homework_v11
Base model
Qwen/Qwen3-4B-Instruct-2507