Files
axolotl/examples/qwen3/README.md
NanoCode012 4ac78aa562 fix: update qwen3 jinja tokenization off a few tokens (#3295)
* fix: update qwen3 jinja tokenization off a few tokens

* fix: add note on tokenization issue

* fix: pop last index for mistral tokenizer
2025-12-09 14:31:03 +07:00

1.7 KiB

Finetune Qwen3 with Axolotl

Qwen3 are a family of open source models trained by Alibaba.

This guide shows how to fine-tune it with Axolotl with multi-turn conversations and proper masking.

Getting started

  1. Install Axolotl following the installation guide.

  2. Install Cut Cross Entropy to reduce training VRAM usage.

  3. Run the finetuning example:

    axolotl train examples/qwen3/32b-qlora.yaml
    

Let us know how it goes. Happy finetuning! 🚀

Chat template masking a few tokens off

If you notice that the chat_template masking for assistant prompts are off by a few tokens, please ensure that you are adding the below to the yaml.

chat_template: qwen3

TIPS

  • For inference, please check the official model card as it depends on your reasoning mode.
  • You can run a full finetuning by removing the adapter: qlora and load_in_4bit: true from the config.
  • Read more on how to load your own dataset at docs.
  • The dataset format follows the OpenAI Messages format as seen here.

Optimization Guides

Please check the Optimizations doc.