## 4 Experimental Results
### MedicoBERT Fine-Tuning Results for Question Answering  
For the question-answer fine-tuning experiments of the MedicoBERT model, the following resources were used: an NVIDIA 3090 GPU, PyTorch, the Huggingface ([[https://huggingface.co/](https://huggingface.co/)]([https://huggingface.co/](https://huggingface.co/)), accessed on 4 July 2024) Transformer library, an adaptive learning-generated tokenizer, and the BioASQ10 dataset, fragmented as shown in Table 4.  
Five experiments were conducted with identical hyperparameter configurations to ensure the reliability and reproducibility of the results. The QA question set was consistently fragmented, and each test's data was split randomly. Subsequently, the arithmetic mean of the F1 metric for the five experiments was calculated. The objective was to assess the degree of generalization of the MedicoBERT model, that is, its capacity to correctly predict questions not included in the training data. Table 5 presents the most significant results of fine-tuning the MedicoBERT and base BERT models for the QA task, using the hyperparameter configuration obtained from the literature. These results underscore the importance of our research in the field of natural language processing and machine learning. Table 6 shows the best training results of the MedicoBERT model for the Spanish medical QA task, using the optimal hyperparameter configuration obtained from coarse calibration with the exploratory method. Table 7 presents the results of fine-tuning the MedicoBERT model for the Spanish medical QA task, utilizing the hyperparameters derived from the heuristic search conducted with the hill-climbing algorithm. Table 8 presents the training results of the MedicoBERT model for the QA task, using the hyperparameters obtained through the harmonic search algorithm. \begin{table}
\begin{tabular}{c c c c c} \hline
**Epochs** & **Batch** & **Learning Rate** & **Weight** & **Average F1** \\ \hline
3.25 & 8 & \(2.5\times 10^{-5}\) & 0.015 & 57.5 \\ \hline \end{tabular}
\end{table} 
Table 6: MedicoBERT training results for the QA task with coarse hyperparameter calibration. \begin{table}
\begin{tabular}{c c c} \hline
**Partition** & **Number of Examples** & **Percent** \\ \hline Train & 23,808 & 60\% \\ Test & 7936 & 20\% \\ Validation & 7936 & 40\% \\ \hline \end{tabular}
\end{table} 
Table 4: Partitioning of the BioASQ10 dataset. \begin{table}
\begin{tabular}{c c c c c} \hline
**Epochs** & **Batch** & **Learning Rate** & **Weight** & **Average F1** \\ \hline MedicoBERT & 5 & 8 & \(1\times 10^{-5}\) & 0.001 & 48.05 \\ Base BERT & 5 & 8 & \(1\times 10^{-5}\) & 0.001 & 21.33 \\ \hline \end{tabular}
\end{table} 
Table 5: LLM training results with hyperparameter configuration from the literature. Figure 5 compares the average F1 scores obtained from training the base BERT and MedicoBERT models for the QA NLP task using different hyperparameter calibration strategies. The hill-climbing algorithm facilitated the identification of the optimal hyperparameter configuration for MedicoBERT fine-tuning. The results obtained with the harmonic search substantiate this configuration's robustness, indicating that it is statistically significant. In evaluating various hyperparameter configurations for answering Spanish-language questions about medical texts, it was found that the hyperparameters pertaining to batch size and weight had a pronounced impact on the model's efficiency. It was determined that processing small batches facilitated a more gradual adaptation of the model parameters. However, it is essential to exercise caution when utilizing exceedingly small values, as this markedly increases the training time. Furthermore, allowing for fractional variations in the number of epochs resulted in more precise control over the training process, thus avoiding overfitting and enabling the model to converge at an earlier stage, specifically at epoch 3.5. Ultimately, the comparison results clearly demonstrate that the default hyperparameter settings are not optimal for the medical model.