Downloads · 30 days
0
tmiyamoto/qwen3-4b-20260208_0424-exp14-clean-v2
qwen3-4b-20260208_0424-exp14-clean-v2 is a machine learning model from tmiyamoto. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
このリポジトリは、Qwen/Qwen3-4B-Instruct-2507 をベースモデルとし、QLoRA (4-bit) を用いてファインチューニングされた LoRA アダプターを提供します。
Downloads · 30 days
0
Access
Public
Updated Feb 8, 2026
Repo size
276 MB
Likes
0
Public
Click a slice to open those files.
.safetensors264 MB · 94%
From the Hugging Face model README
このリポジトリは、Qwen/Qwen3-4B-Instruct-2507 をベースモデルとし、QLoRA (4-bit) を用いてファインチューニングされた LoRA アダプターを提供します。
【重要】本リポジトリには LoRA アダプターの重みのみが含まれています。ベースモデルは別途ロードする必要があります。
このアダプターは、構造化出力(JSON / YAML / XML / TOML / CSV)の精度向上を目的としてトレーニングされています。
学習時、損失(Loss)は最終的なアシスタントの出力にのみ適用され、中間的な推論プロセス(Chain-of-Thought)はマスクされています(Output: マーカー以降のみ学習)。
| パラメータ | 値 |
|---|---|
| ベースモデル | Qwen/Qwen3-4B-Instruct-2507 |
| 手法 | QLoRA (4-bit) |
| 最大シーケンス長 | 1024 |
| エポック数 | 1 |
| 学習率 | 2e-6 |
| LoRA r | 32 |
| LoRA α | 64 |
| LoRA dropout | 0 |
| LoRA ターゲット | q_proj,k_proj,v_proj,o_proj,gate_proj,up_proj,down_proj |
| バッチサイズ | 2 per device × 8 gradient accumulation = 16 effective |
| Warmup ratio | 0.1 |
| Weight decay | 0.05 |
| Label smoothing | 0.1 |
| NEFTune noise alpha | 5.0 |
| Max grad norm | 0.5 |
| LR scheduler | linear |
以下のデータセットを使用しています:
このデータセットは u-10bei/structured_data_with_cot_dataset_512_v5 からルールベースで抽出・加工したものです。LLMによるデータ生成は一切行っていません。
加工内容:
Output: マーカー以降の構造化出力のみを抽出from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model_id = "Qwen/Qwen3-4B-Instruct-2507"
lora_repo_id = "tmiyamoto/qwen3-4b-20260208_0424-exp14-clean-v2"
tokenizer = AutoTokenizer.from_pretrained(base_model_id, trust_remote_code=True)
base_model = AutoModelForCausalLM.from_pretrained(
base_model_id, torch_dtype="auto", device_map="auto", trust_remote_code=True
)
model = PeftModel.from_pretrained(base_model, lora_repo_id)
messages = [
{"role": "user", "content": "次のテキストからJSON形式で情報を抽出してください: ..."}
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
利用者は、データセットの帰属表記(クレジット)に関する要件、およびベースモデルの元の利用規約の両方を遵守する必要があります。