qwen2.5-0.5b-banking77-10intent-lora
This is a small, real fine-tuning run from Boole Inference (Boole AI, Inc.). We built it as a worked example of our fine-tuning workflow. It is a demonstration artifact, not a production model.
Qwen/Qwen2.5-0.5B-Instruct was LoRA-fine-tuned to classify banking customer-support messages into 10 intents from BANKING77. The model answers with exactly one label.
This repo contains:
- the merged model weights (fp32) at the repo root
- the LoRA adapter in
adapter/ - training and eval scripts in
scripts/ - raw eval outputs, with every prediction, in
eval/
Results (held-out test split, same prompt and decoding for both models)
| Model | Exact-match accuracy (n=400) | Output is a valid label |
|---|---|---|
| Qwen2.5-0.5B-Instruct (base, zero-shot) | 60.75% (243/400) | 82.75% |
| This model (LoRA, merged) | 97.75% (391/400) | 100% |
Correct answers per intent (out of 40 each):
| Intent | Base | Fine-tuned |
|---|---|---|
| card_arrival | 25 | 36 |
| lost_or_stolen_card | 38 | 39 |
| exchange_rate | 38 | 40 |
| top_up_failed | 35 | 38 |
| cash_withdrawal_charge | 17 | 40 |
| change_pin | 39 | 40 |
| declined_transfer | 6 | 40 |
| refund_not_showing_up | 29 | 38 |
| passcode_forgotten | 6 | 40 |
| terminate_account | 10 | 40 |
Data
- Source: BANKING77 (Casanueva et al., 2020), taken from the original CSVs in PolyAI-LDN/task-specific-datasets. License: CC BY 4.0.
- Subset: 10 of the 77 intents (listed above). The source label
Refund_not_showing_upwas lowercased. - Train: 600 examples (60 per intent, sampled from the official train split with seed 0).
- Test: all 400 official test examples for these 10 intents (40 per intent). The model never saw them during training.
Training config
- LoRA with r=16, alpha=32 and dropout 0.05, on q/k/v/o/gate/up/down projections. That is 8.8M trainable params (1.75%).
- AdamW at lr 2e-4 with linear decay to 0; 2 epochs; effective batch 8 (micro-batch 2); 150 optimizer steps; fp32; gradient checkpointing.
- Loss covers only the assistant label tokens. The system prompt lists the 10 allowed labels.
- Hardware: CPU only, 8-core Intel Xeon VM with 15 GB RAM and no GPU.
- Training time: 1,212 s (about 20 min).
- Eval time: 67 s for the base model and 53 s for the fine-tuned model, over 400 examples. That is greedy decoding with max 12 new tokens and batch 16.
Eval method
scripts/eval.py runs both models through the same chat-templated prompt with greedy decoding. A prediction counts as correct only if the stripped output exactly matches the gold label string. You can reproduce the numbers with:
python scripts/eval.py Qwen/Qwen2.5-0.5B-Instruct eval_base.json
python scripts/train.py
python scripts/eval.py out/merged eval_finetuned.json
(The scripts expect train.csv and test.csv from the PolyAI repo in the working directory.)
Limitations
- The task is narrow: only 10 intents, single-turn English, and short messages from one public benchmark. It says nothing about the other 67 intents or about real customer traffic.
- The base model was scored zero-shot, with the label list in the prompt. A stronger prompt or a few examples in the prompt could narrow the gap.
- Everything comes from a single run with one seed and no hyperparameter search. Training loss was already near zero by step 10, so the task is easy for this model once it has seen the label format.
- Use this as a demonstration only. It is not suitable for making decisions about real customers.