Enhanced Multi-Class Model Evaluation: Analyzing BERT, GPT-2, and LLaMA with Precision, Recall, and F1-Score Metrics

Authors:

Abstract
An effective evaluation of the multi-class classification model is very essential in evaluating the performances of the model in varied applications. Common accuracy percentages give insufficient information, especially in the case of imbalanced datasets and complex classification tasks. This paper enhances the evaluation process through the use of confusion matrix and derived metrics such as precision, recall, and F1-score for each class. Among the architectural modifications that significantly improved the model's stability and performance were greater model depth, varied attention heads, and improved regularization. Among other models, Bidirectional Encoder Representations from Transformers (BERT), Generative Pre-trained Transformer 2(GPT 2), and Large Language Model Meta AI(LLaMA) were evaluated along with a modified version across four different classes. Results indicate that BERT achieves an overall accuracy percentage of 98% with class-wise F1-scores of 0.97, 0.98, 0.97, and 0.97 for classes 0, 1, 2, and 3 respectively. GPT-2, on the other hand, has an overall accuracy percentage of 97%, along with class-wise F1-scores of 0.97, 0.98, 0.96, and 0.97 for classes 0, 1, 2, and 3 respectively. LLaMA yields 98% accuracy, with F1-scores of 0.98 for class 0, 0.99 for class 1, 0.97 for class 2, and 0.97 for class 3. The modified version of LLaMA also performs up to 98% accuracy which is fairly similar to the F1-scores of BERT.