# MIRA-ChatGLM: A Fine-Tuned Large Language Model for Intelligent Risk Assessment in Coal Mining
## 4 Experiments and Results
### Fine-Tuning Parameter Configurations and Associated Costs  
We successfully developed MIRA-ChatGLM by fine-tuning GLM-4-9B-chat using PEFT methods. Below are the detailed hyperparameter settings for fine-tuning GLM-4-9B-chat with LoRA and QLoRA algorithms. For LoRA fine-tuning, training was conducted for 2.5 h on two RTX 4090 (48 GB) GPUs, and 4.2 h on a single RTX 4090T (24 GB) GPU. The train_epochs was set to 8, with a batch size of 2. The initial learning rate for the AdamW optimizer was set to \(2\times 10^{-5}\), using bf16 for computational precision, with a maximum gradient norm of 1.0. The total training steps were 6000, and the maximum sequence length was set to 1024. No special warmup or \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Model** & **BLEU-4** & **ROUGE-1** & **ROUGE-2** & **ROUGE-L** \\ \hline Bloom-7B & 65.1465 & 70.2396 & 68.9872 & 71.8386 \\ Qwen-7B & 73.3362 & 78.9910 & 76.1294 & 81.3647 \\ Baichuan-7B & 77.3001 & 82.0610 & 80.8721 & 85.9376 \\
**MIRA-ChatGLM** & **84.4695** & **90.6289** & **86.8820** & **90.6289** \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Comparison of experimental results of different models (bold values indicate better performance). \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Model** & **Safety** & **Usability** & **Smoothness** \\ \hline Bloom-7B & 2.232 \(\pm\) 0.338 & 1.992 \(\pm\) 0.580 & 2.389 \(\pm\) 0.482 \\ Qwen-7B & 2.495 \(\pm\) 0.451 & 2.015 \(\pm\) 0.537 & 2.401 \(\pm\) 0.410 \\ Baichuan-7B & 2.563 \(\pm\) 0.279 & 2.710 \(\pm\) 0.336 & 2.719 \(\pm\) 0.305 \\
**MIRA-ChatGLM** & **2.796 \(\pm\) 0.152** & **2.830 \(\pm\) 0.456** & **2.912 \(\pm\) 0.217** \\ \hline \hline \end{tabular}
\end{table} 
Table 7: SUS scores of different models and corresponding 95% confidence intervals (bold values indicate better performance). weight decay strategies were applied. Additionally, the rank of the low-rank matrix was set to 8, with a scaling factor of 16 and a dropout rate of 0.1. Figure 7 shows the loss curve during the LoRA fine-tuning process. The figure illustrates the loss curve during the model training process. As observed, the loss decreases rapidly at the initial stage, dropping from a relatively high value, which indicates that the model effectively captures the features of the data during this phase. With the increase in training steps, the loss gradually stabilizes and approaches zero, demonstrating that the model has progressively converged and the training process is stable. The smoothed curve further highlights the overall downward trend, showing no significant oscillations or upward spikes, which suggests that the model has been optimized effectively without signs of overfitting. This indicates that the model has achieved satisfactory learning performance on the training dataset. In the QLoRA fine-tuning with two quantization levels, the batch size was also set to 2, using the default learning rate decay strategy of the AdamW optimizer with a learning rate of 2 \(\times\) 10\({}^{-5}\) and bf16 precision. Gradient accumulation was performed every 16 steps, with a maximum source length of 32 and a maximum sequence length of 1024. Similar to LoRA, the total training steps were 6000, without warmup or weight decay. The quantization algorithm from bits and bytes was used, with training conducted at both 4-bit and 8-bit quantization levels. The 4-bit QLoRA fine-tuning was completed in just 5.5 h on a single RTX 4090T (24 GB) GPU and 3 h on two RTX 4090 (48 GB) GPUs, significantly reducing the burden on most researchers. Table 8 presents the training durations for different fine-tuning methods. From the training duration, it can be observed that under the same conditions, the training time for models with quantization is relatively longer, yet the performance of the fine-tuned models is similar across all metrics. In terms of memory and resource consumption, QLoRA outperforms LoRA, especially at lower bit widths (such as 4-bit).