> 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ファインチューニングガイド

Unslothを使ってQwen3.5 LLMをファインチューニングする方法を学びましょう。

これでファインチューニングできます [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倍高速になります** かつ **VRAM使用量が50%少なくなります** FA2構成より少なくなります。
* Qwen3.5 bf16 LoRAのVRAM使用量： **0.8B**：3GB・ **2B**：5GB・ **4B**：10GB・ **9B**：22GB・ **27B**：56GB
* ファインチューニング **0.8B**, **2B** そして **4B** 当社の **無料の** **Google Colab ノートブック**:

| [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）** 同様に動作します。ただし、VRAMを4倍使用します。
* 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 の更新
```

{% 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は現在、デフォルトで自動的にtransformers v5を使用します（Colab環境を除く）。**

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

量子化差分が通常より大きいため、MoEかDenseかに関わらず、Qwen3.5モデルで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-chu/faster-moe.md) VRAMを35%以上削減し、コンテキストを約6倍長くできます
* **bf16構成（例：LoRAまたはフルファインチューニング）を使うのが最善です** （BitsandBytesの制約により、MoE QLoRA 4-bitは推奨されません）。
* UnslothのMoEカーネルはデフォルトで有効になっており、異なるバックエンドを使用できます。次で切り替えられます： `UNSLOTH_MOE_BACKEND`.
* 安定性のため、ルーター層のファインチューニングはデフォルトで無効です。
* Qwen3.5‑122B‑A10B - bf16 LoRAは256GBのVRAMで動作します。マルチGPUを使う場合は、次を追加してください：     `device_map = "balanced"` または次に従ってください： [マルチGPUガイド](/docs/jp/ji-chu/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) + **web search**
* [**コード実行**](/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="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F6HTkhiz3DUtrtcqASpTy%2Fobserve%20skinny.png?alt=media&amp;token=1981fe89-eccf-4c3d-ba92-d76f3123b05f" 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="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FKljuGLmIAlo7s8J4LLOc%2FScreenshot%202026-04-02%20at%202.08.54%E2%80%AFAM.png?alt=media&amp;token=8cb779f7-fbd3-49e5-95e7-cc615558d854" alt="" width="563"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

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

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

<div data-with-frame="true"><figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fhm21EMxnAiLJBgP3Tvtq%2FScreenshot%202026-04-02%20at%202.13.21%E2%80%AFAM.png?alt=media&amp;token=babaecda-2b28-47d8-818b-4a74f4595325" alt="" width="563"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

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

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

<div data-with-frame="true"><figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FZvedfVVAmectHAEHHlGg%2FScreenshot%202026-04-02%20at%202.14.40%E2%80%AFAM.png?alt=media&amp;token=4ddefe19-657b-4861-86da-cbfd983f75ba" alt="" width="563"><figcaption></figcaption></figure></div>
{% endstep %}
{% endstepper %}

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

以下は最小限のSFTレシピです（「テキストのみ」のファインチューニングに対応）。こちらもご覧ください： [Vision ファインチューニング](/docs/jp/ji-chu/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 例と同様に学習します。

### Visionファインチューニング

Unslothは [Vision ファインチューニング](/docs/jp/ji-chu/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などに変更）

**Vision / テキストのみのファインチューニングを無効化：**

Visionモデルをファインチューニングするために、どの部分をファインチューニングするか選択できるようになりました。Vision層のみ、言語層のみ、あるいはAttention / MLP層のみをファインチューニングできます！デフォルトではすべて有効になっています！

{% code expandable="true" %}

```python
model = FastVisionModel.get_peft_model(
    model,
    finetune_vision_layers     = True, # Vision層をファインチューニングしない場合はFalse
    finetune_language_layers   = True, # 言語層をファインチューニングしない場合はFalse
    finetune_attention_modules = True, # Attention層をファインチューニングしない場合は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安定化LoRAをサポートしています
    loftq_config = None,               # LoftQにも対応しています
    target_modules = "all-linear",    # いまは任意です！必要ならリストを指定できます
    modules_to_save=[
        "lm_head",
        "embed_tokens",
    ],
)
```

{% endcode %}

Qwen3.5を複数画像でファインチューニングまたは学習するには、 以下をご覧ください： [**複数画像Visionガイド**](/docs/jp/ji-chu/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ではサポートされていなくても、設定することでUnslothでQwen3.5 RLを実行できます： `fast_inference=False` モデルの読み込み時に：

```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-chu/inference-and-deployment/saving-to-gguf.md), [vLLM](/docs/jp/ji-chu/inference-and-deployment/vllm-guide.md), [llama-server](/docs/jp/ji-chu/inference-and-deployment/llama-server-and-openai-endpoint.md), [Ollama](/docs/jp/ji-chu/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ビットで保存するには、次を使用します：

{% code overflow="wrap" %}

```python
model.save_pretrained_merged("finetuned_model", tokenizer, save_method = "merged_16bit")
## または HuggingFace にアップロードするには：
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")
## または HuggingFace にアップロードするには
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-chu/inference-and-deployment.md)
{% endcontent-ref %}

{% content-ref url="/pages/9bfa988baa17c249340a58c332b8584f20d2537c" %}
[GGUF & llama.cpp](/docs/jp/ji-chu/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-chu/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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
