UMUT eam at S em E val-2025 Task 3: Detecting Hallucinations in Multilingual Texts Using Encoder-only Models Guided by Large Language Models (2025)

Abstract: Large Language Models like GPT-4, LLaMa, Mistral, and Gemma have revolutionized Natural Language Processing, advancing language comprehension, generation, and reasoning. However, they also present challenges, particularly the tendency to hallucinate—that is, to produce false or fabricated information. This paper presents our participation in Task 3 Mu-SHROOM of SemEval 2025, which focuses on detecting hallucinations in multilingual contexts. Specifically, the task requires identifying text segments generated by LLMs that correspond to hallucinations and calculating the hallucination probability for each character in the text. To address this challenge, we adopted a token classification approach using the pre-trained XLM-RoBERTa-large model, fine-tuned on the provided training set. Additionally, we integrated context from Llama-3.1-70B to enhance hallucination detection by leveraging its broader and more up-to-date knowledge base. Our approach combines the multilingual capability of XLM-RoBERTa with the contextual understanding of Llama-3.1-70B, producing a detailed hallucination probability for each character in the text. The results demonstrate that our approach consistently outperforms baseline methods across multiple languages, particularly in detecting token-level hallucinations.

## introduction large language models (llms) such as gpt-4, llama, mistral, gemma, and others, have marked a significant paradigm change in natural language processing (nlp), achieving significant advances in language compression, generation, and reasoning @xcite . these models have overcome many limitations of previous models, enabling more robust and sophisticated applications in areas such as machine translation, virtual assistance, visual content generation, sentiment analysis, etc @xcite . one of the key factors of their success has been the massive scaling of parameters and training data, which has allowed them to capture linguistic nuances and broad domain knowledge. in addition, the development of more efficient and optimized architectures has improved their reasoning capabilities, allowing them to perform complex logic and analysis tasks. another revolutionary aspect has been the ability of llms to perform few-shot learning and even zero-shot learning, adapting to new tasks with few or no specific examples, expanding their versatility and applicability in dynamic environments. this has opened up new possibilities in areas such as customer service @xcite , personalized education @xcite , and ai-powered scientific research. however, along with these remarkable advances, concerns have arisen about the tendency of llms to hallucinate, i.e., to produce false or fictitious information with high confidence and apparent consistency. these hallucinations can range from factually incorrect data to fabricated quotes or specific details that do not correspond to reality, posing significant risks in critical applications such as medicine, legal advice, or news broadcasting @xcite . the root of the problem lies in the way llms generate text: based on statistical patterns learned from large amounts of data. while this allows them to produce fluid, contextually relevant responses, it also means that they have no real understanding of the world and no internal fact-checking @xcite . as a result, they may combine information plausibly but incorrectly, leading to hallucinations. this complicates the practical implementation of llms, especially in real-world information retrieval systems that have become integrated into our daily lives, such as chatbots @xcite , search engines @xcite , or content moderation @xcite @xcite . it is important to note that hallucinations in conventional natural language generation (nlg) tasks have been extensively studied, and are defined as generated content that is illogical or not faithful to the provided source content. moreover, in recent years, several tasks have been developed to detect hallucinations in llms, such as shroom 2024 @xcite , etc. for this reason, task 3 mu-shroom of se-meval 2025 @xcite was also released with the aim of detecting the parts of texts that correspond to hallucinations. the main goal of this task is therefore for participants to determine which parts of a text produced by llm represent hallucinations. the task is organized in several languages and is performed in a multilingual context with different llm. for each text, the probability that it is a hallucination must be generated for each character in the text. to solve this task, we have adopted a token classification approach based on a pre-trained language model, specifically xlm-roberta-large @xcite , which is fine-tuned with the training set. however, in this case, for hallucination detection, the context, or response generated by an llm, such as llama-3.1-70b @xcite , is added, as this model has broader knowledge. this improves hallucination detection by providing additional information that helps the model to distinguish between correct and hallucinatory content. furthermore, the combination of xlm-roberta-large with llama-3.1-70b exploits the strengths of both models: the multilingual capability and robustness of xlm-roberta, together with the up-to-date and contextual knowledge of llama-3.1-70b. the fitted model generates the hallucination probability for each character in the text, providing a detailed and accurate analysis. this approach proves effective in a multilingual context and with different llms, optimizing hallucination detection in different scenarios. ## background llms are large-scale language models designed to understand and process human language by learning contextual patterns and relationships in large volumes of textual data. these models have a large number of parameters and use advanced pre-training techniques, such as masked language modeling (mlm) and autoregressive prediction, allowing them to accurately model probabilities and contextualized semantics of text @xcite . in recent years, several high-profile llms have been developed, including openai's gpt-4, meta ai's llama, google's gemma, mixtral and mistral. these models have demonstrated their versatility in a wide range of applications, from search engines and customer support to code generation, education, healthcare and financial analysis. despite their remarkable advances and versatility in multiple domains, llms present several limitations that affect their reliability and applicability in real environments, such as the generation of hallucinations, lack of fact and reasoning verification, context sensitivity, as well as biases and limitations in complex reasoning and specialized tasks. therefore, there is a need for new approaches and more robust strategies to solve these problems and, thus, optimize resources in the future development of llms @xcite . thus, different techniques and approaches have emerged for detecting hallucinations in llms, such as fact-checking, which verifies the accuracy of generated content by cross-referencing it with reliable external sources @xcite . additionally, frameworks that utilize evidence gathering and internal verification tools leverage the knowledge stored within the llms themselves, using techniques like chain-of-thought (cot) @xcite . however, these methods are limited, as llms are not always reliable data sources. several approaches attempt to detect hallucinations without relying on sources external to the llms themselves. these include analyzing internal signals such as token-level confidence scores or entropy measures @xcite , as well as evaluating model behavior through consistency checks, for example by comparing multiple generations or using multi-agent discussion frameworks @xcite . in our approach, we use a multilingual token classification model based on xlm-roberta to identify hallucinated segments in text generated by llms. instead of relying on external knowledge bases, we incorporate a reference response generated by llama-3.1-70b as additional context. this setup allows the model to compare the original output with a high-quality alternative and detect inconsistencies at the token level. our method uses internal information from the llms' outputs and comparison signals between model generations to improve hallucination detection. specifically, xlm-roberta is used as a token classification model to identify hallucinations generated by llms, incorporating the response generated by llama-3.1-70b as context into the token classification input to improve detection accuracy. this integration allows the xlm-roberta model to benefit from the enhanced generation and understanding capabilities of llama-3.1-70b, increasing its effectiveness in identifying inconsistencies and errors in the output generated by other llms. ## system overview figure 1 shows the system architecture, where the xlm-roberta-large model is used as the basis for performing fine-tuning in a token classification task. in this approach, each token in the text is classified with a value of 1 or 0, indicating whether that token corresponds to a hallucination (1) or not (0). xlm-roberta-large is a multilingual version of roberta, trained on 2.5 tb of commoncrawl filtered data spanning 100 languages. this model was pre-trained using the masked language modeling (mlm) objective, in which 15% of the words in the input are randomly masked, and the model must predict the masked words using the surrounding context. unlike traditional recurrent neural network models (rnns), which process words sequentially, or autoregressive models such as gpt, which mask future tokens, xlm-roberta leverages a bidirectional representation of the sentence. this allows it to learn an internal representation of 100 languages, which is essential for multilingual tasks. to provide the model with a broader context or a pre-answer to the question, an llm such as llama-3.1-70b has been used. since this model has been trained with a larger amount of data, it offers superior performance compared to the llms used to generate the dataset answers. to incorporate the response or context generated by llama-3.1-70b, a text_pair configuration has been employed, in which the text generated by the model (model_output_text) and the context or response of the larger model (teacher model) are entered together. this configuration allows xlm-roberta-large to consider not only the text itself, but also its context, which can help the model better distinguish between factual and hallucinated content. during tokenization, labels are assigned to the tokens using the offset mappings generated by the tokenizer, which indicate the start and end positions of each token in the original text. those tokens whose ranges match the positions specified in the hard labels, which mark the hallucinations in the text, are labeled as 1. all other tokens receive a label of 0. this granular approach at the token level enables accurate and detailed detection of hallucinations, helping to identify exactly where in the text the hallucination occurs. in addition, by using xlm-roberta-large with text pairs (text_pair), a more robust and effective contextual analysis is achieved, maximizing model performance in a multilingual environment. we used the huggingface transformers library with the xlm roberta large model and its associated tokenizer. each input sample was encoded using the text_pair format, where the first segment corresponds to the model-generated output (model_output_text) and the second segment corresponds to the context provided by llama-3.1-70b model. a token classification head with a single linear layer and softmax activation was added on top of the encoder. although the output logits consist of three values per token (due to padding and special tokens), only two labels are used during training: 1 for hallucinated tokens and 0 for the rest. tokens not aligned with any character (e.g., special tokens) were assigned a label of -100 to be ignored by the loss function. the model was trained using the cross-entropy loss function, which is standard for token classification tasks. offset mappings were used to align character-level annotations with token-level labels. ## experimental setup for the experiment, the labeled training set provided by the organizers has been used with 50 examples are kept for each language, except for sv which has 49 examples. in figure 2 , the length distribution of the input, the response generated by the llm and the response generated by the llm teacher (llama-3.1-70b) is shown. it can be seen that the maximum length of the response generated by the llm teacher is around 100 tokens, while the length of the responses generated by the llm can reach up to about 500 tokens. this difference could be e 0 e1 e2 en en que ... punisher ... classification head [0.1, 0.3, 0.6] ... ... [0.2, 0.2, 0.6] -100 0 0 0 1 1 -100 input tokenizer embeddings logits labels xlm-roberta-large la serie de televisión "the punisher" se lanzó en la plataforma de streaming netflix en 2017... ¿en que plataforma se lanzó la serie de televisión the punisher? model_output_text (text to classify) llama-3.1-70b (context) [sep] t 1 t m ... la serie ... 2017 related to the tendency of the llm to generate longer responses, which could be an indication that the model is generating hallucinations. longer responses may be associated with a higher probability of producing unrelated or incorrect information, whereas the llm teacher, being more oriented to provide precise and concise responses, has a more controlled response length. for model training, the dataset has been divided into 80% for training and 20% for validation, in order to evaluate the model performance on an unseen dataset. as for the training parameters, a batch size of 16 tokens per device is used, with a total of 10 training epochs and a learning rate of 2e-5. model evaluation is performed at the end of each epoch, and the model is saved after each evaluation. to generate the answers with llama-3.1-70b, the "meta-llama/llama-3.1-70b-instruct" template loaded in 4-bit format using the bitsandbytes configuration was used to optimize memory usage on gpus. the prompt used follows a consistent template specifying that the wizard must answer in the same language as the question, ensuring a clear, precise and concise answer. the prompt template is described in listing 1. for text generation, the following decoding parameters were used: a limit of 4096 tokens for the maximum length of the generated response, a top_p value of 0.95 to apply nucleus sampling and keep diversity controlled in the generation, and a top_k you are an advanced multilingual assistant . your task is to answer the given question in the same language as the question . ensure your response is clear , accurate , short and concise . question : { question } answer : listing 1: structure of the prompt of 10 to restrict the selection to the 10 most likely tokens. in addition, a temperature of 0.7 was used to balance creativity and consistency of responses, along with a num_beams value of 1 to generate responses efficiently without beam search. ## results overall, our approach consistently outperforms the baselines in both metrics, indicating its ability to effectively detect llm model-generated hallucinations in multiple languages. for example, in es and en, our model obtained an iou of 0.2980 and 0.3667, respectively, and a cor of 0.4152 and 0.4966. these results reflect a considerable improvement compared to the baselines, especially in the cor metric, suggesting a higher accuracy in detecting token-level hallucinations. it is observed that languages with more complex grammatical structures or less represented in the model pre-training, such as ar, fa and fi, show slightly lower performance. this behavior can be attributed to the lower availability of data in these languages, which affects the model's ability to generalize correctly. moreover, only the "mark everything as hallucination" baseline outperforms our approach in some cases. notably, in languages such as sv and zh, the model achieved an iou of 0.4393 and 0.3875, respectively, with cor values of 0.3936 and 0.4916. although our approach presents a lower iou than the baseline (mark all) in these languages, the model maintains a robust correlation, indicating its ability to capture consistent patterns in hallucination generation. in terms of ranking, our approach demonstrates competitive performance, consistently ranking high for most of the languages evaluated. for example, it was ranked 13th in fa and 16th in it, reflecting its effectiveness in languages with different linguistic backgrounds. in conclusion, the results demonstrate the effectiveness and robustness of our approach for hallucination detection in multiple languages, significantly outperforming the baselines and maintaining a robust correlation. this confirms its generalizability in multilingual contexts and its potential application in language model-generated text evaluation tasks. ## conclusion our participation in task 3 mu-shroom of se-meval 2025 focused on the detection of hallucinations in texts generated by llms, a critical challenge as these systems are increasingly integrated into real-world applications. we adopted a token classification approach using the pre-trained multilingual xlm-roberta-large model, augmented with contextual information from llama-3.1-70b. by comparing the model-generated output with a hallucination-free reference, our system produces token-level hallucination probabilities, allowing for fine-grained analysis. experimental results show that our approach consistently outperforms baseline methods in several languages, with particularly strong performance in english and spanish. however, results in languages with complex grammar or fewer pre-training representations, such as arabic and finnish, highlight the need for languagespecific strategies to improve generalization. these results highlight the benefits of combining multilingual modeling with llm-generated context. future work will explore more advanced fusion techniques, cultural and linguistic factors influencing hallucination generation, dataset expansion, and the use of reinforcement learning to further improve performance. future work will explore fine-tuning strategies such as cross-lingual transfer learning or data augmentation to mitigate the performance gap observed in low-resource languages. in addition, while llama-3.1-70b provides strong contextual guidance, its size may hinder real-time deployment. exploring more lightweight alternatives, such as distilled models or hybrid architectures, remains a promising direction. although we did not perform an ablation study to isolate the specific contribution of contextual input, this is an important avenue for future work to better understand its impact on hallucination detection.