Qwen2.5-3B Trade WhatsApp Reply QC
WhatsApp chat quality control
2 min readupdated
This QLoRA (a small fine-tuned adapter built on top of a base model) adapter is built on Qwen/Qwen2.5-3B-Instruct for automated quality control of sales manager replies in WhatsApp. The model takes a customer chat context and a codebase as input, outputing a strict JSON with a five-dimensional evaluation, an overall score, a breakdown of replies, and ready-to-use reply options in the customer's language. The solution is optimized to work with compact prompts and significantly outperforms the base version in JSON generation accuracy and adherence to guidelines.
Key features
- Structural accuracy: Achieves a strict_pass_rate of 91.7% compared to 33.3% for the base model, thanks to training on 240 synthetic examples.
- Detailed evaluation: Evaluates dialogues across five parameters, including risk handling, professionalism, and negotiation.
- Efficiency: Requires minimal resources (peak VRAM starting at 5.8 GB) and delivers high inference speed on a single RTX 4090 GPU.
- Integration: Easily integrates with the base model via the peft library for fast local execution.
What you can do
- Automated audit: Embed into a CRM system or internal script to check manager messages in real time.
- Quality control: Use for mass analysis of chats with international buyers to identify communication weaknesses.
- Chat assistant: Generate hints and reply options for managers right during customer conversations on WhatsApp.
Example
An example of model initialization and running inference for dialogue evaluation:
import json
import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base_id = "Qwen/Qwen2.5-3B-Instruct"
adapter_id = "mecrycolds/qwen2.5-3b-trade-qc-qlora"
base = AutoModelForCausalLM.from_pretrained(
base_id,
dtype=torch.bfloat16,
device_map="auto",
attn_implementation="sdpa",
)
model = PeftModel.from_pretrained(base, adapter_id).merge_and_unload()
model.eval()Read more
DetailsBenchmarks (on 60 test examples): strict_pass_rate 0.917, verdict_acc 0.754, total_mae 6.400.
Hardware requirements: peak VRAM ranging from 5.8 GB (batch 1) to 11.95 GB (batch 64) on an RTX 4090.
Limitations: synthetic data was generated using a DeepSeek teacher; the model is recommended for auxiliary quality control rather than making final decisions on high-risk deals.
Training details: 4-bit NF4 double quant, 240 samples, 4 epochs, 120 optimizer steps.










Comments