Results
All runs use the same base model and test set, greedy decoding, and thinking mode off.
Table with columns: Run, Training data, Accuracy, Macro-F1, Calibration error, Invalid labels| Run | Training data | Accuracy | Macro-F1 | Calibration error | Invalid labels |
|---|
| Base, label list in the prompt | none | 72.1% | 0.707 | 0.155 | 1.6% |
| LoRA, 1,001 examples | 10% of the train split | 87.7% | 0.883 | 0.029 | 1.9% |
| LoRA, 9,772 examples (this adapter) | train split minus validation | 94.5% | 0.946 | 0.025 | 0.4% |
- Calibration error is expected calibration error over 10 equal-width bins. Confidence is the product of the probabilities of the generated label tokens.
- Invalid labels are answers outside the 77 labels. The base model mostly paraphrases a real label, for example
get_virtual_card for getting_virtual_card. The 1,001-example adapter mostly invents a plausible one.
- Restricting decoding to the 77 labels with a prefix trie removes invalid answers. It changes accuracy by +0.1 points for this adapter, +0.7 for the 1,001-example adapter and nothing for the base model.
- This adapter classified 44 messages per second (batch 32, Unsloth, A100 40GB).
Use
The adapter was trained with the system prompt below and thinking mode off. Use both.
Load the base with AutoModelForImageTextToText, which is Qwen3.5's own architecture. AutoModelForCausalLM loads a text-only class whose layers are named differently: peft then warns about missing adapter keys and the adapter has no effect.
import torchfrom peft import PeftModelfrom transformers import AutoModelForImageTextToText, AutoTokenizer base = "Qwen/Qwen3.5-9B"tok = AutoTokenizer.from_pretrained(base)model = AutoModelForImageTextToText.from_pretrained(base, dtype=torch.bfloat16, device_map="auto")model = PeftModel.from_pretrained(model, "NovusEdge/Qwen3.5-9B-banking77-LoRA") SYSTEM = "Classify the bank customer's message. Reply with the intent label only." def classify(text): messages = [{"role": "system", "content": SYSTEM}, {"role": "user", "content": text}] prompt = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, enable_thinking=False) ids = tok(prompt, return_tensors="pt", add_special_tokens=False).to(model.device) out = model.generate(**ids, max_new_tokens=24, do_sample=False) return tok.decode(out[0, ids["input_ids"].shape[1]:], skip_special_tokens=True) print(classify("I still haven't received my new card, when will it arrive?")) # card_arrival
Training
Table with columns: Setting, Value| Setting | Value |
|---|
| Base model | Qwen/Qwen3.5-9B, bf16, no quantisation |
| Adapted modules | MLP gate/up/down_proj in all 32 layers; q/k/v/o_proj in the 8 full-attention layers. The Gated DeltaNet layers are not adapted. |
| LoRA | rank 16, alpha 16, dropout 0; 29.1M trainable parameters (0.31%) |
| Data | 9,772 rows from the BANKING77 train split; 231 held out for validation |
| Loss | supervised fine-tuning, on the label tokens only |
| Schedule | 3 epochs, learning rate 2e-4, cosine, 5% warmup, batch 16, seed 3407 |
| Hardware | 1× A100 40GB (spot), 662 s wall time, 27.8 GB peak memory |
| Software | Unsloth 2026.11.13, transformers 5.17.0, peft 0.22.0, torch 2.14.1 |
Every training label is a BANKING77 human label. No model-generated labels were used.
Limits
- It always answers with one of the 77 BANKING77 intents. There is no "other" class, so a message outside that set still gets a banking label.
- English only, one domain. All results above are on BANKING77's own test set; accuracy and calibration on other traffic are unmeasured.
Data and licence
The adapter is released under Apache-2.0, the base model's licence.
BANKING77 is by PolyAI and licensed CC-BY-4.0: Casanueva, Temčinas, Gerz, Henderson and Vulić, "Efficient Intent Detection with Dual Sentence Encoders", NLP4ConvAI 2020 (arXiv:2003.04807).