> For the complete documentation index, see [llms.txt](https://unsloth.ai/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://unsloth.ai/docs/jp/moderu/qwen3.5/fine-tune.md).

# Qwen3.5 ファインチューニングガイド

これでファインチューニングできるようになりました [Qwen3.5](/docs/jp/moderu/qwen3.5.md) モデルファミリー（0.8B、2B、4B、9B、27B、35B‑A3B、122B‑A10B）を [**Unsloth**](https://github.com/unslothai/unsloth)。対応範囲には [ビジョン](/docs/jp/moderu/qwen3.5/fine-tune.md#vision-fine-tuning)、テキスト、そして [RL](#reinforcement-learning-rl) ファインチューニングが含まれます。 **Qwen3.5‑35B‑A3B** - bf16 LoRA は **74GB の VRAM で動作します。**

* Unsloth により Qwen3.5 の学習は **1.5倍高速になり** 、 **50% 少ない VRAM** で済みます。FA2 の構成と比べて。
* Qwen3.5 bf16 LoRA の VRAM 使用量: **0.8B**: 3GB • **2B**: 5GB • **4B**: 10GB • **9B**: 22GB • **27B**: 56GB
* ファインチューニング **0.8B**, **2B** と **4B** 私たちの **無料の** **Google Colab ノートブックを使った bf16 LoRA**:

| [Qwen3.5-**0.8B**](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Qwen3_5_\(0_8B\)_Vision.ipynb) | [Qwen3.5-**2B**](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Qwen3_5_\(2B\)_Vision.ipynb) | [Qwen3.5-**4B**](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Qwen3_5_\(4B\)_Vision.ipynb) | [Qwen3.5-4B **GRPO**](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Qwen3_5_\(4B\)_Vision_GRPO.ipynb) |
| --------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |

* もし **推論能力を維持したい** なら、推論スタイルの例と直接回答を混ぜることができます（推論を最低75%に保ってください）。それ以外なら完全に出力できます。
* **フルファインチューニング（FFT）** も同様に使えます。4倍多くの VRAM を使用する点に注意してください。
* Qwen3.5 は 201言語をサポートしているため、多言語ファインチューニングに強力です。
* ファインチューニング後は、 [GGUF](#saving-export-your-fine-tuned-model) （llama.cpp/Ollama など用）または [vLLM](#saving-export-your-fine-tuned-model)
* [強化学習](/docs/jp/meru/reinforcement-learning-rl-guide.md) （RL）向けに Qwen3.5 を [VLM RL](/docs/jp/meru/reinforcement-learning-rl-guide/vision-reinforcement-learning-vlm-rl.md) も Unsloth の推論経由で利用できます。
* 私たちは **A100** 向けの Colab ノートブックを [Qwen3.5‑27B](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Qwen_3_5_27B_A100\(80GB\).ipynb) と [Qwen3.5‑35B‑A3B](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Qwen3_5_MoE.ipynb).

古いバージョンを使っている場合（またはローカルでファインチューニングする場合）は、まず更新してください:

{% columns %}
{% column width="50%" %}
Unsloth Studio:

{% code expandable="true" %}

```bash
unsloth studio update
```

{% endcode %}
{% endcolumn %}

{% column width="50%" %}
Unsloth コードベース版:

```bash
pip install --upgrade --force-reinstall --no-cache-dir unsloth unsloth_zoo
```

{% endcolumn %}
{% endcolumns %}

{% hint style="warning" %}
**必ず `transformers v5` を Qwen3.5 で使用してください。古いバージョンは動作しません。Unsloth は現在、Colab 環境を除き、デフォルトで transformers v5 を自動的に使います。**

学習が **通常より遅い**ように見える場合、それは Qwen3.5 がカスタムの Mamba Triton カーネルを使っているためです。これらのカーネルのコンパイルには通常より時間がかかることがあり、特に T4 GPU では顕著です。

Qwen3.5 モデルでは、MoE か dense かにかかわらず、量子化差が通常より大きいため、QLoRA（4-bit）学習は推奨されません。
{% endhint %}

### MoE ファインチューニング（35B、122B）

次のような MoE モデルの場合、 **Qwen3.5‑35B‑A3B / 122B‑A10B / 397B‑A17B**:

* 私たちの [Qwen3.5‑35B‑A3B（A100）](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Qwen3_5_MoE.ipynb) ファインチューニング用ノートブックを使えます
* 最近の約12倍高速な [MoE 学習アップデート](/docs/jp/ji-ben/faster-moe.md) をサポートし、VRAM を35%以上削減し、コンテキスト長を約6倍延長します
* **bf16 の構成（例: LoRA またはフルファインチューニング）を使うのが最適です** （MoE QLoRA 4-bit は BitsandBytes の制限により推奨されません）。
* Unsloth の MoE カーネルはデフォルトで有効で、バックエンドを切り替えられます。 `UNSLOTH_MOE_BACKEND`.
* の安定性のため、ルーター層のファインチューニングはデフォルトで無効です。
* Qwen3.5‑122B‑A10B - bf16 LoRA は 256GB の VRAM で動作します。マルチ GPU を使う場合は、     `device_map = "balanced"` を追加するか、 [マルチ GPU ガイド](/docs/jp/ji-ben/multi-gpu-training-with-unsloth.md).

### クイックスタート

#### 🦥 Unsloth Studioガイド

Qwen3.5は次で実行およびファインチューニングできます [Unsloth Studio](/docs/jp/shii/studio.md)で実行およびファインチューニングできます。これはローカルAI向けの新しいオープンソースのWeb UIです。Unsloth Studio を使えば、モデルをローカルで **MacOS、Windows**、Linux、および次の機能：

{% columns %}
{% column %}

* [LLMの学習](/docs/jp/shii/studio.md#no-code-training) VRAMを70%削減しつつ2倍高速
* 検索、ダウンロード、 [GGUFの実行](/docs/jp/shii/studio.md#run-models-locally) およびsafetensorモデル
* [**自己修復** ツール呼び出し](/docs/jp/shii/studio.md#execute-code--heal-tool-calling) + **ウェブ検索**
* [**コード実行**](/docs/jp/shii/studio.md#run-models-locally) （Python、Bash）
* [自動推論](https://unsloth.ai/docs/desktop#feature-deep-dive) パラメータ調整（temp、top-pなど）
* llama.cpp経由の高速CPU＋GPU推論
  {% endcolumn %}

{% column %}

<div data-with-frame="true"><figure><img src="/files/1dca1ac20e7781d7f38fc9e9fdd60ccb9731850d" alt=""><figcaption></figcaption></figure></div>
{% endcolumn %}
{% endcolumns %}

{% stepper %}
{% step %}

#### Unslothをインストール

ターミナルで実行：

**MacOS、Linux、WSL：**

```bash
curl -fsSL https://unsloth.ai/install.sh | sh
```

**Windows PowerShell：**

```bash
irm https://unsloth.ai/install.ps1 | iex
```

{% hint style="success" %}
**インストールはすぐ完了し、約1～2分かかります。**
{% endhint %}
{% endstep %}

{% step %}

#### Unslothを起動

**MacOS、Linux、WSL、およびWindows：**

```bash
unsloth studio -H 0.0.0.0 -p 8888
```

**次に開く `http://localhost:8888` をブラウザーで。**
{% endstep %}

{% step %}

#### Qwen3.5 を学習する

初回起動時には、アカウントを保護し、後で再度サインインするためのパスワードを作成する必要があります。その後、モデル、データセット、基本設定を選ぶための簡単な初期設定ウィザードが表示されます。いつでもスキップできます。

検索バーで Qwen3.5 を検索し、希望のモデルとデータセットを選択します。次に、ハイパーパラメータとコンテキスト長を必要に応じて調整します。

<div data-with-frame="true"><figure><img src="/files/597b19d205ceefd0dc260d8162c186a95bdf56f3" alt="" width="563"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

#### 学習の進捗を監視する

学習開始をクリックすると、モデルの学習進捗を監視・確認できるようになります。学習損失は着実に減少しているはずです。\
完了すると、モデルは自動的に保存されます。

<div data-with-frame="true"><figure><img src="/files/37b7daa61649aaf6fc97baa8c981a09e3c2c44f6" alt="" width="563"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

#### ファインチューニングしたモデルをエクスポートする

完了後、Unsloth Studio ではモデルを GGUF、safetensor などの形式にエクスポートできます。

<div data-with-frame="true"><figure><img src="/files/34d6eafe6b5092d1809cda0ad06e9837102b1c47" alt="" width="563"><figcaption></figcaption></figure></div>
{% endstep %}
{% endstepper %}

#### Unsloth Core（コードベース）ガイド:

以下は最小限の SFT レシピです（「テキストのみ」のファインチューニングで動作します）。こちらもご覧ください。 [ビジョンのファインチューニング](/docs/jp/ji-ben/vision-fine-tuning.md) セクション。

{% hint style="info" %}
Qwen3.5 は「Vision Encoder を備えた因果言語モデル」（統合 VLM）なので、通常のビジョン依存関係（`torchvision`, `pillow`）が必要ならインストールし、Transformers を最新に保ってください。Qwen3.5 には最新の Transformers を使ってください。

**もし** [**GRPO**](/docs/jp/meru/reinforcement-learning-rl-guide.md)**を行いたいなら、fast vLLM 推論を無効にして代わりに Unsloth 推論を使えば、Unsloth で動作します。私たちの** [**Vision RL**](/docs/jp/meru/reinforcement-learning-rl-guide/vision-reinforcement-learning-vlm-rl.md) **ノートブックの例に従ってください。**
{% endhint %}

{% code expandable="true" %}

```python
from unsloth import FastLanguageModel
import torch
from datasets import load_dataset
from trl import SFTTrainer, SFTConfig

max_seq_length = 2048  # まずは小さく始め、動作したら拡大する

# サンプルデータセット（あなたのものに置き換えてください）。"text" 列が必要です。
url = "https://huggingface.co/datasets/laion/OIG/resolve/main/unified_chip2.jsonl"
dataset = load_dataset("json", data_files={"train": url}, split="train")

model, tokenizer = FastLanguageModel.from_pretrained(
    model_name = "Qwen/Qwen3.5-27B",
    max_seq_length = max_seq_length,
    load_in_4bit = False,     # MoE QLoRA は推奨されません。dense 27B は問題ありません
    load_in_16bit = True,     # bf16/16-bit LoRA
    full_finetuning = False,
)

model = FastLanguageModel.get_peft_model(
    model,
    r = 16,
    target_modules = [
        "q_proj", "k_proj", "v_proj", "o_proj",
        "gate_proj", "up_proj", "down_proj",
    ],
    lora_alpha = 16,
    lora_dropout = 0,
    bias = "none",
    # "unsloth" チェックポイントは、非常に長いコンテキストと低い VRAM 用に設計されています
    use_gradient_checkpointing = "unsloth",
    random_state = 3407,
    max_seq_length = max_seq_length,
)

trainer = SFTTrainer(
    model = model,
    train_dataset = dataset,
    tokenizer = tokenizer,
    args = SFTConfig(
        max_seq_length = max_seq_length,
        per_device_train_batch_size = 1,
        gradient_accumulation_steps = 4,
        warmup_steps = 10,
        max_steps = 100,
        logging_steps = 1,
        output_dir = "outputs_qwen35",
        optim = "adamw_8bit",
        seed = 3407,
        dataset_num_proc = 1,
    ),
)

trainer.train()
```

{% endcode %}

{% hint style="info" %}
OOM になる場合:

* 下げる `per_device_train_batch_size` を **1** と/または減らす `max_seq_length`.&#x20;
* を維持 `use_`[`gradient_checkpointing`](/docs/jp/burogu/500k-context-length-fine-tuning.md#unsloth-gradient-checkpointing-enhancements)`="unsloth"` をオンにしてください（VRAM 使用量を減らし、コンテキスト長を延長するよう設計されています）。
  {% endhint %}

**MoE 向けのローダー例（bf16 LoRA）:**

```python
import os
import torch
from unsloth import FastModel

model, tokenizer = FastModel.from_pretrained(
    model_name = "unsloth/Qwen3.5-35B-A3B",
    max_seq_length = 2048,
    load_in_4bit = False,     # MoE QLoRA は推奨されません。dense 27B は問題ありません
    load_in_16bit = True,     # bf16/16-bit LoRA
    full_finetuning = False,
)
```

読み込んだら、LoRA アダプターを追加し、上の SFT 例と同様に学習できます。

### ビジョンのファインチューニング

Unsloth は [ビジョンのファインチューニング](/docs/jp/ji-ben/vision-fine-tuning.md) をマルチモーダル Qwen3.5 モデルでサポートしています。下の Qwen3.5 ノートブックを使い、各モデル名を目的の Qwen3.5 モデルに変更してください。

| [Qwen3.5-**0.8B**](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Qwen3_5_\(0_8B\)_Vision.ipynb) | [Qwen3.5-**2B**](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Qwen3_5_\(2B\)_Vision.ipynb) | [Qwen3.5-**4B**](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Qwen3_5_\(4B\)_Vision.ipynb) | Qwen3.5-**9B** |
| --------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | -------------- |

* [Qwen3-VL GRPO/GSPO RL ノートブック](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Qwen3_VL_\(8B\)-Vision-GRPO.ipynb) （モデル名を Qwen3.5-4B などに変更）

**ビジョンを無効化 / テキストのみのファインチューニング:**

ビジョンモデルをファインチューニングするために、どの部分を学習するかを選べるようになりました。ビジョン層だけ、言語層だけ、あるいはアテンション / MLP 層だけをファインチューニングできます。デフォルトではすべて有効にしています！

{% code expandable="true" %}

```python
model = FastVisionModel.get_peft_model(
    model,
    finetune_vision_layers     = True, # ビジョン層を学習しない場合は False
    finetune_language_layers   = True, # 言語層を学習しない場合は False
    finetune_attention_modules = True, # アテンション層を学習しない場合は False
    finetune_mlp_modules       = True, # MLP 層を学習しない場合は False

    r = 16,                           # 大きいほど精度は高くなりますが、過学習する可能性があります
    lora_alpha = 16,                  # 少なくとも alpha == r を推奨
    lora_dropout = 0,
    bias = "none",
    random_state = 3407,
    use_rslora = False,               # rank stabilized LoRA に対応しています
    loftq_config = None,               # LoftQ も対応しています
    target_modules = "all-linear",    # これもオプションです！必要ならリストを指定できます
    modules_to_save=[
        "lm_head",
        "embed_tokens",
    ],
)
```

{% endcode %}

複数画像で Qwen3.5 をファインチューニングまたは学習するには、 私たちの [**複数画像ビジョンガイド**](/docs/jp/ji-ben/vision-fine-tuning.md#multi-image-training)**.**

### 強化学習（RL）

これで Qwen3.5 を RL、GSPO、GRPO などで [私たちの無料ノートブックを使って](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Qwen3_5_\(4B\)_Vision_GRPO.ipynb):

{% embed url="<https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Qwen3_5_(4B)_Vision_GRPO.ipynb>" %}

vLLM ではサポートされていなくても、 `fast_inference=False` を設定することで Unsloth で Qwen3.5 RL を実行できます。

```python
from unsloth import FastLanguageModel

model, tokenizer = FastLanguageModel.from_pretrained(
    model_name="unsloth/Qwen3.5-4B",
    fast_inference=False,
)
```

### ファインチューニングしたモデルの保存 / エクスポート

特定の推論 / デプロイ手順はこちらで確認できます [Unsloth Studio](/docs/jp/shii/studio/export.md), [llama.cpp](/docs/jp/ji-ben/inference-and-deployment/saving-to-gguf.md), [vLLM](/docs/jp/ji-ben/inference-and-deployment/vllm-guide.md), [llama-server](/docs/jp/ji-ben/inference-and-deployment/llama-server-and-openai-endpoint.md), [Ollama](/docs/jp/ji-ben/inference-and-deployment/saving-to-ollama.md).

#### GGUF に保存

Unsloth は直接 GGUF に保存することをサポートしています:

```python
model.save_pretrained_gguf("directory", tokenizer, quantization_method = "q4_k_m")
model.save_pretrained_gguf("directory", tokenizer, quantization_method = "q8_0")
model.save_pretrained_gguf("directory", tokenizer, quantization_method = "f16")
```

または GGUF を Hugging Face にプッシュ:

```python
model.push_to_hub_gguf("hf_username/directory", tokenizer, quantization_method = "q4_k_m")
model.push_to_hub_gguf("hf_username/directory", tokenizer, quantization_method = "q8_0")
```

エクスポートしたモデルが別の実行環境でうまく動作しない場合、Unsloth は最も一般的な原因を示します: **推論時のチャットテンプレート / EOS トークンの誤り** （学習時と同じチャットテンプレートを使う必要があります）。

#### vLLM に保存

{% hint style="warning" %}
vLLM のバージョン `0.16.0` は Qwen3.5 をサポートしていません。 `0.170` まで待つか、Nightly リリースを試してください。
{% endhint %}

vLLM 用に 16-bit で保存するには、次を使ってください:

{% code overflow="wrap" %}

```python
model.save_pretrained_merged("finetuned_model", tokenizer, save_method = "merged_16bit")
## または Hugging Face にアップロードするには:
model.push_to_hub_merged("hf/model", tokenizer, save_method = "merged_16bit", token = "")
```

{% endcode %}

LoRA アダプターだけを保存するには、次のいずれかを使ってください:

```python
model.save_pretrained("finetuned_lora")
tokenizer.save_pretrained("finetuned_lora")
```

または組み込み関数を使います:

{% code overflow="wrap" %}

```python
model.save_pretrained_merged("finetuned_model", tokenizer, save_method = "lora")
## または Hugging Face にアップロードするには
model.push_to_hub_merged("hf/model", tokenizer, save_method = "lora", token = "")
```

{% endcode %}

詳細は推論ガイドをご覧ください:

{% columns %}
{% column width="50%" %}
{% content-ref url="/pages/d5ae43f1915ceda3d304ad7c413cb4efbe3d1a3f" %}
[推論とデプロイ](/docs/jp/ji-ben/inference-and-deployment.md)
{% endcontent-ref %}

{% content-ref url="/pages/9bfa988baa17c249340a58c332b8584f20d2537c" %}
[GGUF & llama.cpp](/docs/jp/ji-ben/inference-and-deployment/saving-to-gguf.md)
{% endcontent-ref %}
{% endcolumn %}

{% column width="50%" %}
{% content-ref url="/pages/a58a8ab897451539e1493312c6a640b4d5ee40b7" %}
[Model Export](/docs/jp/shii/studio/export.md)
{% endcontent-ref %}

{% content-ref url="/pages/0fde417d83989a8108b1d466ec2b53c46e9f4279" %}
[vLLM](/docs/jp/ji-ben/inference-and-deployment/vllm-guide.md)
{% endcontent-ref %}
{% endcolumn %}
{% endcolumns %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://unsloth.ai/docs/jp/moderu/qwen3.5/fine-tune.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
