Banking77 intent classifier · Qwen3-0.6B · 4-bit file for CPUs (GGUF)
Reads a message a customer sent to an online bank and says what they want. Made with Mikan, an open-source project that teaches a small model one narrow job from a large model, then checks fairly that it does the job about as well.
What it does
It reads one short message and picks what the customer is asking about from a fixed list of 77 request types, such as a card that has not arrived, a wrong exchange rate or a pending cash withdrawal. A support system can use the answer to send the message to the right team or the right help article.
| Message | Answer |
|---|---|
| I still have not received my new card, I ordered over a week ago. | card_arrival |
| The rate applied to my foreign purchase was incorrect | card_payment_wrong_exchange_rate |
| Why does my account have a pending cash withdrawal? | pending_cash_withdrawal |
On a test it had never seen, it picks the right request type for about 85 of every 100 messages.
Why it exists
Large AI models can already do this well, but they are expensive to run, slow, and usually mean sending your users' text to someone else's server. This model is about 50 times smaller than the large model it learned from, so it is cheap enough to run on your own hardware, and the test below shows it is about as accurate. This version is a single 397 MB file and answers in about 0.5 seconds on an ordinary 2-core CPU, with no GPU.
How it was made
- A large model, Qwen3-30B-A3B (an open model with 30 billion parameters), answered 8,222 example customer messages. Its answers became the lessons, so no one had to label the examples by hand.
- The small model,
Qwen/Qwen3-0.6B, studied those answers until it gave the same ones. Only a small add-on was trained (LoRA), not the whole model, so this fits on one free GPU. - Its numbers were stored with 4 bits instead of 16, shrinking it from 1.19 GB to 397 MB, at a cost of 0.7 points of accuracy.
- A fair test, with the rule fixed in advance. Before any training, we wrote down a pass rule: the small model passes if, with 95% confidence, it is at most 2 points less accurate than the large model. Both were then tested once on 3,080 customer messages with answers checked by people, which neither had seen. Result: 84.9% against the large model's 85.6%, so it passed.
Which version to pick
All versions below do the same job. The score is the accuracy on the same 3,080-item test (the large model: 85.6%).
| Version | Base model | What it is | Pick it if | Score |
|---|---|---|---|---|
mikan-research/banking77-qwen3-0.6b-gguf (this model) | Qwen3-0.6B | Single 4-bit file (397 MB) for llama.cpp on a CPU | you want to run it on a laptop or any computer without a GPU | 84.9% |
mikan-research/banking77-qwen3-0.6b-w4a16 | Qwen3-0.6B | 4-bit model (850 MB) for vLLM on a GPU | you answer many requests from a GPU server | 85.0% |
mikan-research/banking77-qwen3-0.6b-lora | Qwen3-0.6B | Add-on (LoRA adapter, 40 MB) for the open Qwen/Qwen3-0.6B model | you want to train it further or work in Python with transformers | 85.6% |
Not sure? Start with mikan-research/banking77-qwen3-0.6b-gguf: it runs on a laptop and you can try it in the demo Space first. Larger 1.7B and 4B students scored about the same on this task; their test predictions are in mikan-research/banking77-distill.
How to use it
Install llama-cpp-python (pip install llama-cpp-python huggingface_hub); the script below downloads the file and answers one request. The prompt is a short system
message with no label list, in Qwen3's chat format with thinking off.
Decoding is constrained with a llama.cpp grammar, as in the evaluation.
from huggingface_hub import hf_hub_download
from llama_cpp import Llama, LlamaGrammar
llm = Llama(hf_hub_download("mikan-research/banking77-qwen3-0.6b-gguf", "banking77-qwen3-0.6b-gguf-Q4_K_M.gguf"), n_ctx=1024, verbose=False)
labels = open(hf_hub_download("mikan-research/banking77-distill", "banking77/labels.txt", repo_type="dataset")).read().split()
grammar = LlamaGrammar.from_string("root ::= " + " | ".join(f'"{x}"' for x in labels))
def prompt(text): # Qwen3 chat format, thinking off, exactly as in training
return ("<|im_start|>system\nClassify the online-banking customer message into exactly one intent. Reply with the intent label only.<|im_end|>\n"
f"<|im_start|>user\n{text}<|im_end|>\n<|im_start|>assistant\n<think>\n\n</think>\n\n")
out = llm.create_completion(prompt("I still have not received my new card"), max_tokens=24, temperature=0, grammar=grammar)
print(out["choices"][0]["text"])
Technical details
The LoRA adapter mikan-research/banking77-qwen3-0.6b-lora merged into Qwen/Qwen3-0.6B, converted to GGUF and quantized
to Q4_K_M with llama.cpp, for CPU inference. Part of Mikan, a pipeline that distils a large model's
behaviour on one narrow task into a small model and tests non-inferiority with a pre-registered margin.
How to reproduce or train: contributing guide. Data and predictions: mikan-research/banking77-distill.
A W4A16 version for vLLM on GPU is mikan-research/banking77-qwen3-0.6b-w4a16.
Try it in the demo Space, which runs this file in your browser with wllama (llama.cpp in WebAssembly; its llama.cpp build is newer than the evaluation's, so a few outputs differ: 93% (frames) and 98% (banking) identical on 300 validation items, same accuracy).
Results (Banking77 test split, 3,080 items, ground truth)
| Accuracy | |
|---|---|
| This model (Q4_K_M, llama.cpp, grammar-constrained) | 84.9% |
| W4A16 version (vLLM) | 85.0% |
| Unquantized adapter | 85.6% |
| Teacher (Qwen3-30B-A3B-Instruct-2507-FP8, 10-shot) | 85.6% |
Gap (teacher - this model): 0.7 points, 95% paired bootstrap CI [-0.1, 1.6].
Non-inferiority margin 2 points: PASS. Cost of quantization (unquantized adapter - this model):
0.7 points [0.1, 1.2], McNemar p = 0.019. Valid outputs
100.00%. The quantization recipe and the decision rule were fixed before the test split was predicted,
once; see configs/phase4.json in the repository.
Speed: 0.51 s per request (median; p95 0.81 s) on 2 vCPUs with 2 threads, one request at a time, measured on Modal CPU containers during the test-split run.
Conversion
The merged bf16 model was converted with convert_hf_to_gguf.py (--outtype bf16) at llama.cpp commit
f5e6915c2 and quantized to Q4_K_M with default parameters (no importance matrix) through
llama-cpp-python 0.3.38, which bundles that commit. File: banking77-qwen3-0.6b-gguf-Q4_K_M.gguf, 0.40 GB,
SHA-256 d42cd9c6ae9e39ec7c4190fa7017b60ede7cc7e9007f712e27312f702094fbd8.
Banking77 (PolyAI, CC-BY-4.0): Casanueva et al., 2020, "Efficient Intent Detection with Dual Sentence Encoders".