A detailed walkthrough of fine-tuning Mistral Small 3.1 (24B) on the GoEmotions dataset for multi-label emotion recognition across 15 emotion categories. The tutorial covers handling severe class imbalance using a three-pronged approach: undersampling the majority 'neutral' class, applying the 2025 ISMOTE algorithm to synthetically expand minority classes, and using a per-label weighted focal loss function. Full Python code is provided using the Unsloth framework with LoRA adapters, covering data loading, model setup, custom multilabel wrapper, training configuration, and evaluation. The resulting model (MistralSmall-3.1.GoEmotions) achieves macro F1 of 0.82 and is released on Hugging Face under Apache 2.0.
Table of contents
Introduction2. Data3. Training set preprocessing4. SLM Fine-tuning4.1. Coding5. SummaryReferences110 Impressions