Team Bolaca at S em E val-2024 Task 6: Sentence-transformers are all you need (2024)

Abstract: Our team tackled the SemEval-2024 Task 6, focusing on identifying fluent over-generation hallucinations in NLP outputs. We proposed a pragmatic solution using a logistic regression classifier and a feed-forward ANN, harnessing SBERT embeddings for feature extraction.

## introduction fluent over-generation hallucinations, grammatically correct yet factually incorrect or contextually irrelevant text outputs, remain a persistent obstacle in nlp systems, particularly large language models (llms). moreover, the coherent aspect of the output means that hallucinations are harder to detect than other types of erroneous generation,as discussed in @xcite , particularly in tasks like machine translation, especially considering most metrics for measuring performance only account for fluency rather than correctness @xcite . in order to ensure that tools like llms, which are becoming increasingly popular among the general population, provide the user base with information that is faithful and coherent in the context of various language tasks, research in identifying instances of hallucinations has become necessary. in this paper, we present our contribution for the semeval 2024 task foot_0 , shroom, where we work on solutions for detecting and categorizing hallucinations, using the data made available for different types of language generation tasks, stemming from a model-aware and a model-agnostic track. additionally, taking into account the fact that earlier studies have adopted a llm-based few or zero shot learning approach to the problem, we opt for a computationally economical approach instead, using a two-pronged model making use of logistic regression and a simple feed-forward network. the data consists of 61,080 text outputs, of which 1,080 are manually annotated instances (the rest being unlabeled). the task requires participants to develop a binary classification system which successfully identifies hallucinations for different types of language generation tasks: definition modeling, machine translation and paraphrase generation. the data was generated from two different tracks, model-aware, meaning knowlegde of the model which produced the output is accessible, and model-agnostic, where the model which generated the ouput is unknown. the generated outputs are provided in json format, containing source text, generated text and golden standard prompt, aswell the model name when applicable. 61080 datapoints are obtained in this way, from which 1080 are annotated @xcite . a baseline was made available, using a zero-shot model with calls to llama @xcite . ## our system strategy considering the likely instances where a system to detect hallucinations would find practical use and how current approaches to hallucination detection work @xcite , we decided that we wanted to make reduced inference time a goal of our system. our primary strategy for detecting hallucinations involves a two-pronged approach utilizing either logistic regression or a small feed-forward neural networks trained on a labeled dataset as classification model. this leverages the strengths of each model for efficient and accurate hallucination detection. as input to our classification model we use sentence embeddings generated by sbert @xcite . using a logistic regression model as a baseline helps us to quantify the advantages of using a neural network as a classification model instead of simpler approaches. ## key algorithms and modeling decisions in our shroom system our hallucination detection system employs a hybrid approach that combines both a pretrained llm and a small classification model. the system's core components include: ## results we achieved an accuracy of 0.57 on the modelaware track, and an accuracy of 0.63 on the modelagnostic track, placing us at respectively rank 32 and rank 27 on the competition leaderboard. additionally, we scored 0.24 for accuracy for the modelagnostic track. ## experimental setup because of our approach based on supervised learning we used the development dataset provided by the task organizers as training dataset, using cross validation to gain insights into our systems' performance before the actual test dataset was available. we used pytorch: 1.10.2 foot_1 in order to build our neural network. transformers 4.12.2 foot_2 , more specifically sbert foot_3 , was used in order to extract the sentence embeddings. finally, in order to organize and process the data, we also made use of numpy (1.22.3) foot_4 and pandas (1.4.2) foot_5 . in order to run our code in an efficient manner, we used colab foot_6 . ## conclusion by using a simple model exploiting feature extraction to aid in identifying hallucinations in a dataset containing data from different tasks, we have achieved an accuracy of 0.628. this could potentially indicate that for this type of task, it might be worthwhile to take into consideration approaches which do not exclusively rely on zeroshot classification, but instead make use of less computationally costly techniques. we have shown that such methods are not only efficient, but also present the advantage of being easily reproducible with fewer resources.