A LoRA adapter that teaches a 0.5B model to sort bank customers' messages into 77 intents, measured against the best prompt you can write.
Load banking77 from Hugging Face (13,083 bank customer messages, each labelled with one of 77 intents) and set 200 test messages aside.
Score Qwen2.5-0.5B-Instruct on them with an instruction that lists all 77 intents, then with five examples added, counting exact matches.
Turn 2,000 training rows into chat-format prompt and reply pairs, and train a LoRA adapter on q_proj and v_proj with TRL's SFTTrainer.
Log training and validation loss, keep a checkpoint after each pass, and pick one by its validation score.
Score that adapter once on the 200 test messages, and ask it five general questions to see what the tuning cost it.
Price each setup by its prompt tokens per request, and note the adapter's size on disk.
How you'll know it worksA table of exact-match accuracy, prompt tokens per request and size for the bare prompt, five examples and the adapter on the same 200 test messages, with the adapter ahead of the best prompt.
Python with transformers, peft, trl and datasets. A 0.5B model trains with LoRA on a laptop (Apple Silicon or a recent CPU) in an evening, with no API. Uses lessons 05 to 13.
Project: A small model fine-tuned with LoRA
From insideout, Training and Tuning: A LoRA adapter that teaches a 0.5B model to sort bank customers' messages into 77 intents, measured against the best prompt you can write.
Steps:
1. Load banking77 from Hugging Face (13,083 bank customer messages, each labelled with one of 77 intents) and set 200 test messages aside.
2. Score Qwen2.5-0.5B-Instruct on them with an instruction that lists all 77 intents, then with five examples added, counting exact matches.
3. Turn 2,000 training rows into chat-format prompt and reply pairs, and train a LoRA adapter on q_proj and v_proj with TRL's SFTTrainer.
4. Log training and validation loss, keep a checkpoint after each pass, and pick one by its validation score.
5. Score that adapter once on the 200 test messages, and ask it five general questions to see what the tuning cost it.
6. Price each setup by its prompt tokens per request, and note the adapter's size on disk.
How you'll know it works: A table of exact-match accuracy, prompt tokens per request and size for the bare prompt, five examples and the adapter on the same 200 test messages, with the adapter ahead of the best prompt.
Runs on: Python with transformers, peft, trl and datasets. A 0.5B model trains with LoRA on a laptop (Apple Silicon or a recent CPU) in an evening, with no API.
Help me build this on my machine, one step at a time. Ask what I've tried first, give hints before full answers, and check my work against "How you'll know it works".