Fine-tuning a small transformer for text classification
Week 14
I fine-tuned DistilBERT to classify short support-style messages. A small model was enough, and it trained on a single modest GPU.
What mattered
- A TF-IDF plus logistic regression baseline, which scored baseline F1. The transformer reached transformer F1.
- Per-class F1, not just overall accuracy, since classes were imbalanced.
- Reading about fifty wrong predictions by hand. Many were genuinely ambiguous labels.
Takeaway
The gain over the simple baseline was real but not huge. For a production system I would weigh that gain against inference cost and latency.