Enhanced Multi-Class Model Evaluation: Analyzing BERT, GPT-2, and LLaMA with Precision, Recall, and F1-Score Metrics
Authors:
- 3 September 2025
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- p. 984-989
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.Keywords
This publication has 6 references indexed in Scilit:
- Attention Is All You NeedarXiv, 2023
- SAS: Self-Augmentation Strategy for Language Model Pre-trainingProceedings of the AAAI Conference on Artificial Intelligence, 2022
- The advantages of the Matthews correlation coefficient (MCC) over F1 score and accuracy in binary classification evaluationBMC Genomics, 2020
- Transformers: State-of-the-Art Natural Language Processing2020
- Learning Phrase Representations using RNN Encoder–Decoder for Statistical Machine Translation2014
- The class imbalance problem: A systematic study1Intelligent Data Analysis: An International Journal, 2002