How to fine-tune Qwen1.5 (LoRA, QLoRA)

Chat template, Transformers requirement and Tongyi Qianwen license limits to check before fine-tuning Qwen1.5 with LoRA or QLoRA.

This guide covers adapting the Qwen1.5 family. Memory per method and GPU counts appear below, and the training cost calculator estimates runtime. For method background see fine-tuning, LoRA and QLoRA.

Setup

  • Use transformers>=4.37.0, per the Qwen1.5-7B-Chat card, to avoid KeyError: 'qwen2'.
  • No trust_remote_code is needed, according to the card.
  • Format training data with the tokenizer's chat template (apply_chat_template) so it matches serving.
  • The card does not document LoRA target modules, so use your trainer's defaults.
  • Training context beyond 32K is not covered by the card, which states 32K for all sizes.

License

The Chat card lists the tongyi-qianwen license. The LICENSE text for that checkpoint says:

  • Commercial use with more than 100 million monthly active users requires requesting a license from Alibaba Cloud.
  • You may not use the Materials or any output to improve any other large language model (excluding Tongyi Qianwen or derivative works thereof).
  • Recipients must receive a copy of the agreement, modified files must carry notices of changes, and distributed copies must retain the line "Tongyi Qianwen is licensed under the Tongyi Qianwen LICENSE AGREEMENT, Copyright (c) Alibaba Cloud. All Rights Reserved."

Fine-tuned weights are derivatives, so these terms travel with your adapter or merged model. Check the license field on the exact size you adapt, since other sizes may differ.

Memory to fine-tune Qwen1.5, by size

Model state in GB before activations, for a full fine-tune, LoRA and QLoRA, with the cheapest live GPU set that has that much memory. One model per size.

ModelParametersFull fine-tuneLoRAQLoRACompute per 1B tokens
Qwen1.5-0.5B-Chat620M9.2 GBRTX 4070 Super · $0.121/hr1.2 GBRTX 4070 Super · $0.121/hr0.3 GBRTX 4070 Super · $0.121/hr3.7 × 10^18 FLOPs
Qwen1.5-1.8B-Chat1.8B27.4 GBRTX 4080 Super · $0.338/hr3.4 GBRTX 4070 Super · $0.121/hr0.9 GBRTX 4070 Super · $0.121/hr1.1 × 10^19 FLOPs
Qwen1.5-4B4.0B58.9 GBA100 · $1.21/hr7.4 GBRTX 4070 Super · $0.121/hr1.9 GBRTX 4070 Super · $0.121/hr2.4 × 10^19 FLOPs
CodeQwen1.5-7B-Chat7.3B108 GBRTX A5000 × 5 · $0.880/hr13.5 GBRTX A4000 · $0.167/hr3.5 GBRTX 4070 Super · $0.121/hr4.4 × 10^19 FLOPs
Qwen1.5-7B7.7B115 GBRTX A5000 × 5 · $0.880/hr14.4 GBRTX A4000 · $0.167/hr3.7 GBRTX 4070 Super · $0.121/hr4.6 × 10^19 FLOPs
Qwen1.5-14B14.2B211 GBRTX A6000 × 5 · $1.81/hr26.4 GBRTX 4080 Super · $0.338/hr6.8 GBRTX 4070 Super · $0.121/hr8.5 × 10^19 FLOPs
Qwen1.5-MoE-A2.7B14.3B213 GBRTX A6000 × 5 · $1.81/hr26.7 GBRTX 4080 Super · $0.338/hr6.9 GBRTX 4070 Super · $0.121/hr8.6 × 10^19 FLOPs
Qwen1.5-32B-Chat32.5B484 GBRTX PRO 6000 × 6 · $8.25/hr60.6 GBA100 · $1.21/hr15.6 GBRTX A4000 · $0.167/hr2.0 × 10^20 FLOPs
Qwen1.5-72B-Chat72.3B1077 GBNo live fit135 GBRTX A5000 × 6 · $1.06/hr34.7 GBRTX A6000 · $0.363/hr4.3 × 10^20 FLOPs

Full fine-tune counts 16 bytes per parameter (mixed-precision Adam, as counted in the ZeRO paper). LoRA keeps the frozen base in BF16 at 2 bytes per parameter. QLoRA stores the base in 4-bit NormalFloat with double quantization at 4.127 bits per parameter (QLoRA paper). Adapters and activations are not counted: activations depend on your batch size and sequence length, so leave headroom. Compute is the training-cost calculator's 6 × parameters × tokens for a dense model; mixture-of-experts models use fewer. These are estimates from formulas, not measurements of a run.

Estimate a full run

Turn the compute column into time and cost with the training cost calculator. For the methods themselves, read LoRA and QLoRA, and see how fine-tuning works on Aquanode at fine-tuning.

Sources

Updated 2026-10-07.

Related

Submit the job. Everything after that is ours.

Sign up in 60 seconds. Pay for the GPU minutes you actually use.

© 2026 Aquanode. All rights reserved.

All trademarks, logos and brand names are the property of their respective owners.