# Human-Centered AI for Migrant Integration Through LLM and RAG Optimization
## 6 Results and Discussion
### Results
However, to optimize specific metrics, such as ROUGE-1 or ROUGE-L, it may be advantageous to explore configurations with higher temperatures. Higher temperatures (0.9) degrade quality metrics due to the introduction of excessive randomness, which negatively affects cohesion in configurations with large chunks and high K values. Additionally, the increase in CO2e emissions associated with the chunk size and K indicates a higher computational cost, underscoring the need for a trade-off between efficiency and performance. Perplexity levels, which measure model uncertainty, rise with higher temperatures, potentially impairing performance in configurations requiring high precision. These findings suggest that a moderate chunk size, combined with an intermediate K value and medium temperature, optimizes the quality of generated text while efficiently managing computational resources (see Figure 3). \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**K** & **Temp** & **Stereo** & **Anti-Stereo** & **Neutral** & **Non\_Hate** & **Hate** \\ \hline
1 & 0.1 & \(\pm\)0.130 & \(\pm\)0.188 & \(\pm\)0.211 & \(\pm\)0.058 & \(\pm\)0.247 \\
1 & 0.3 & \(\pm\)0.128 & \(  
The examination of the relationships with the stereotype, anti-stereotype, neutral, Non_Hate, and Hate indicators revealed notable trends influenced by the model's temperature. Stereotype scores increased with the temperature (from 0.938 to 0.960 and between 0.1 and 0.9, respectively), suggesting that higher temperatures capture more biases present in the data. Conversely, the anti-stereotype score also varied with the temperature, rising from 0.868 to 0.908 as the temperature increases, indicating an enhanced ability of the model to counteract stereotypes. Regarding neutrality, there was a decrease in this score from 0.829 to 0.757 with rising temperatures, implying that the model generated less neutral and more polarized responses. As for Non_Hate, these scores fluctuated slightly from 0.927 to 0.933 with increasing temperatures, showing minimal influence. However, the Hate score increased significantly from 0.0 to 0.510 when the temperature changed from 0.1 to 0.3, indicating greater capture of offensive content at higher temperatures (Figure 4). The presented ideas have significant practical applications in the fine-tuning and filtering of language models, aiming to enhance both their accuracy and ethical standards. Fine-tuning is crucial for mitigating inherent biases, as stereotype scores tend to increase with a model's temperature. Therefore, it is imperative to include anti-stereotype examples during training to counteract this trend and reduce the likelihood of generating biased responses. Furthermore, the observed decrease in neutrality with increasing temperatures suggests the necessity of training models with data which promote neutral responses and avoiding polarized data. This approach ensures that the model maintains a fair and balanced output. The notable increase in offensive content at higher temperatures underscores the need for meticulous fine-tuning, including the implementation of additional filters to eliminate inappropriate examples from the training dataset. Filtering data is crucial to ensure that the dataset employed for fine-tuning is devoid of examples which could amplify biases or offensive content, particularly at elevated temperatures. Metrics such as stereotypes, anti-stereotypes, neutral, Non_Hate, and Hate exhibited clear trends as a function of the chunk size. As the chunk size increased from 50 to 1000, the stereotype score rose from 0.925 to 0.972, suggesting that larger chunks captured more biases present in the data. Conversely, the anti-stereotype score decreased from 0.897 to  
Figure 3: The heat map illustrates the impact analysis of the temperature and K value on text quality evaluation metrics and energy efficiency. 0.720, indicating a reduced capacity to generate responses which counteract stereotypes.