% This must be in the first 5 lines to tell arXiv to use pdfLaTeX, which is strongly recommended.
\pdfoutput=1
% In particular, the hyperref package requires pdfLaTeX in order to break URLs across lines.

\documentclass[11pt]{article}

% Change "review" to "final" to generate the final (sometimes called camera-ready) version.
% Change to "preprint" to generate a non-anonymous version with page numbers.
\usepackage[final]{acl}

% Standard package includes
\usepackage{times}
\usepackage{latexsym}

% For proper rendering and hyphenation of words containing Latin characters (including in bib files)
\usepackage[T1]{fontenc}
% For Vietnamese characters
% \usepackage[T5]{fontenc}
% See https://www.latex-project.org/help/documentation/encguide.pdf for other character sets

% This assumes your files are encoded as UTF8
\usepackage[utf8]{inputenc}

% This is not strictly necessary, and may be commented out,
% but it will improve the layout of the manuscript,
% and will typically save some space.
\usepackage{microtype}

% This is also not strictly necessary, and may be commented out.
% However, it will improve the aesthetics of text in
% the typewriter font.
\usepackage{inconsolata}

% If the title and author information does not fit in the area allocated, uncomment the following
%
%\setlength\titlebox{<dim>}
%
% and set <dim> to something 5cm or larger.

\usepackage[acronym]{glossaries}

\usepackage{tabularx}

\usepackage{pgfplots}

\usepackage{multirow}

\newcommand{\red}[1]{\textcolor{red}{#1}}

\glsdisablehyper % disable hyperlink to non-existing glossary section 
\newacronym{llms}{LLMs}{Large Language Models}
\newacronym{llm}{LLM}{Large Language Model}
\newacronym{nli}{NLI}{Natural Language Inference}
\newacronym{pg}{PG}{Paraphrase Generation}
\newacronym{paws}{PAWS}{Paraphrase Adversaries from Word Scrambling}
\newacronym{shroom}{SHROOM}{Shared-task on Hallucinations and Related Observable Overgeneration Mistakes}
\newacronym{qa}{QA}{Question Answering}
\newacronym{harmonee}{HaRMoNEE}{Hallucination Recognition Model for New Experiment Evaluation}


% this will be fixed, but HaRMoNEE is set
\title{HaRMoNEE at SemEval-2024 Task 6: Tuning-based Approaches to Hallucination Recognition}
% not only is it harmony and tune, it is also TAR

% Author information can be set in various styles:
% For several authors from the same institution:
% \author{Author 1 \and ... \and Author n \\
%         Address line \\ ... \\ Address line}
% if the names do not fit well on one line use
%         Author 1 \\ {\bf Author 2} \\ ... \\ {\bf Author n} \\
% For authors from different institutions:
% \author{Author 1 \\ Address line \\  ... \\ Address line
%         \And  ... \And
%         Author n \\ Address line \\ ... \\ Address line}
% To start a separate ``row'' of authors use \AND, as in
% \author{Author 1 \\ Address line \\  ... \\ Address line
%         \AND
%         Author 2 \\ Address line \\ ... \\ Address line \And
%         Author 3 \\ Address line \\ ... \\ Address line}

\author{Timothy Obiso \and Jingxuan Tu \and James Pustejovsky \\
        Department of Computer Science \\
        Brandeis University  \\
        Waltham, Massachusetts \\
\texttt{\{timothyobiso, jxtu, jamesp\}@brandeis.edu}}

\begin{document}
\maketitle
\begin{abstract}
This paper presents the \gls{harmonee} team's winning (\#1) and \#10 submissions for SemEval-2024 Task 6: \gls{shroom}'s two subtasks. This task challenged its participants to design systems to detect hallucinations in \gls{llm} outputs. Team \gls{harmonee} proposes two architectures: (1) fine-tuning an off-the-shelf transformer-based model and (2) prompt tuning large-scale \gls{llms}. One submission from the fine-tuning approach outperformed all other submissions for the model-aware subtask; one submission from the prompt-tuning approach is the 10th-best submission on the leaderboard for the model-agnostic subtask. Our systems also include pre-processing, system-specific tuning, post-processing, and evaluation.
\end{abstract}

\section{Introduction}
The \gls{harmonee} team proposes two architectures to use on the \gls{shroom} \cite{mickus-EtAl:2024:SemEval2024} task: transformer model fine-tuning and large-scale \gls{llm} prompt tuning. First, we pre-process the data. We identify two fields from each example to use in our models.

For the fine-tuning models, the fields are then formatted into a single string with a separator token. We use three different training strategies with \gls{shroom} data to improve performance on the test sets. Finally, we run the model on the test set and post-process the data to get a score. 
For prompt-tuning, the prompt is constructed around the two selected fields. Using the validation datasets, we experiment with two models and two prompts. We select the best of both and finally evaluate the test sets.

This paper reports our results from these experiments submitted during the \gls{shroom} task's evaluation phase. We discuss the data, the task, our methods, and the experiments we ran. In addition, we analyze and discuss our results and make proposals for future work in hallucination recognition. We make our code and best results publicly available.\footnote{\url{https://github.com/brandeis-llc/shroom}}

\begin{figure*}[]
\resizebox{\textwidth}{!}{
\begin{tabular}{l|l}

\textbf{Field}            & \textbf{Value} \\ \hline
\textbf{task}             & ``DM'' \\ 
\textbf{src}              & ``I'm an avid reader. What is the meaning of avid?'' \\ 
\textbf{hyp}              & ``Having an intense interest in something.'' \\ 
\textbf{tgt}              & ``enthusiastic; keen; eager; showing great interest in something or desire to do something'' \\ 
\textbf{ref}              & ``tgt'' \\ 
\textbf{model}            & ``ltg/flan-t5-definition-en-base'' \\ 
\textbf{labels}           & [``Not Hallucination'', ``Not Hallucination'', ``Hallucination'', ``Not Hallucination'', ``Not Hallucination''] \\ 
\textbf{label}            & ``Not Hallucination'' \\ 
\textbf{p(Hallucination)} & 0.2              
\end{tabular}
}
\caption{Example data}
\label{fig:example_data}
\end{figure*}

\section{Related Work}

Several approaches have been taken to scoring faithfulness and identifying hallucinations. \citet{Laban2022SummaCRN} proposed to use \gls{nli} to detect inconsistency in summarization tasks. They applied \gls{nli} to sentence pairs and aggregated the scores on the document level to obtain a faithfulness score.
\citet{lattimer-etal-2023-fast} adopted a similar method by chunking the whole document into smaller pieces. However, they prompted \gls{llms} to generate their scores.
TrueTeacher \citep{gekhman-etal-2023-trueteacher} leveraged \gls{llms} to generate synthetic data that could augment models' ability to identify factual inconsistencies in summarization tasks.
AlignScore \citep{zha-etal-2023-alignscore} is a unified evaluation metric for factual inconsistency that is based on the information alignment between two arbitrary text pieces.
SelfCheckGPT \citep{manakul_selfcheckgpt_2023} proposed using \gls{llms}, particularly GPT models, to generate multiple potential consistent/contradictory responses as a task-agnostic method for hallucination detection and fact-checking.

Several datasets for \gls{nli} and hallucination are commonly used to pre-train and fine-tune models for these tasks.
SNLI \cite{bowman-etal-2015-large} is a large \gls{nli} dataset collected from image captions. It consists of sentence pairs labeled as entailment, contradiction, or neutral.
PAWS \cite{zhang-etal-2019-paws} proposed a new dataset for paraphrase identification that features non-paraphrase pairs with high lexical overlap. 
\citet{honovich-etal-2022-true-evaluating} studied the factual consistencies from text generation systems. They proposed TRUE, an automatic factual consistency assessment tool for tasks including summarization, dialogue generation, fact verification, and paraphrase detection. 
HaluEval \cite{li-etal-2023-halueval} proposed a dataset with human-annotated hallucinated instances specifically for evaluating the performance of \gls{llms} in recognizing hallucinations.


\citet{laban-etal-2022-summac} and \citet{zha-etal-2023-alignscore} both fine-tune pre-trained language models to obtain a score for each example indicating faithfulness between two texts or the likelihood of the presence of hallucination in one of the texts. \citet{lattimer-etal-2023-fast}, \citet{gekhman-etal-2023-trueteacher}, and \citet{manakul_selfcheckgpt_2023} all use \gls{llms} in various ways to perform the same tasks.

\section{Data and Task}

\gls{shroom} is split into two subtasks, model-aware and model-agnostic, with corresponding datasets. Task participants receive two sets of unlabeled training data, two sets of labeled validation data, and two unlabeled test sets. There is also a smaller labeled trial dataset. 

\subsection{Datasets}
Table \ref{tab:dataset_stats} shows a breakdown of each dataset. Table \ref{tab:label_stats} shows a breakdown by label for the labeled datasets. The training sets are evenly split by example task. The validation and test sets are split 25:37.5:37.5. In each of the validation and test sets, there are more examples of ``Not Hallucination'' than ``Hallucination''.

Figure \ref{fig:example_data} is an example from the model-aware validation set.
Every datapoint in the datasets includes the following fields: \texttt{task} (task: the task that the model is trained to perform, e.g. ``DM'', ``MT'', ``PG''\footnote{DM = Definition Modeling, MT = Machine Translation, PG = Paraphrase Generation}), \texttt{src} (source: the text passed to the model), \texttt{hyp} (hypothesis: the model output), \texttt{tgt} (target: the ``gold'' text that the model should output), \texttt{ref} (reference: which field should serve as a reference for semantic information, e.g. ``src'' or ``tgt'').

The model-aware datasets include the additional field \texttt{model} (the name of the model used). The labeled data includes \texttt{labels} (the list of votes from all annotators), \texttt{label} (``Hallucination'' or ``Not Hallucination''), and \texttt{p(Hallucination)} (probability of hallucination: the likelihood that the model output contains hallucinated content).

\begin{table*}[]
\resizebox{\textwidth}{!}{
\begin{tabular}{|l|r|r|r|r|r|r|r|}
\hline
\textbf{Dataset}      & \textbf{Trial} & \textbf{Train Agnostic} & \textbf{Train Aware} & \textbf{Val Agnostic} & \textbf{Val Aware} & \textbf{Test Agnostic} & \textbf{Test Aware} \\ \hline
PG    & 9     & 10,000     & 10,000     & 125      & 125      & 375       & 375       \\ \hline
MT    & 35    & 10,000     & 10,000     & 187      & 188      & 562       & 563       \\ \hline
DM    & 36    & 10,000     & 10,000     & 187      & 188      & 563       & 562       \\ \hline
Total & 80    & 30,000     & 30,000     & 499      & 501      & 1,500     & 1,500     \\ \hline
\end{tabular}
}
\caption{Dataset Task Statistics, PG = Paraphrase Generation, MT = Machine Translation, DM = Definition Modelling}
\label{tab:dataset_stats}
\end{table*}

\begin{table}[]
\centering
\resizebox{\columnwidth}{!}{
\begin{tabular}{|l|r|r|}
\hline
\textbf{Dataset} & \textbf{Val AG} & \textbf{Val AW}  \\ \hline
Hallucination    & 218      & 206       \\ \hline
Not Hallucination  & 281      & 295       \\ \hline
Total            & 499      & 501       \\ \hline
\end{tabular}
}
\resizebox{\columnwidth}{!}{
\begin{tabular}{|l|r|r|}
\hline
\textbf{Dataset} & \textbf{Test AG} & \textbf{Test AW}  \\ \hline
Hallucination     & 611    & 551       \\ \hline
Not Hallucination & 889    & 949       \\ \hline
Total    & 1,500     & 1,500     \\ \hline
\end{tabular}
}
\caption{Dataset Label Statistics, AG = model-agnostic, AW = model-aware}
\label{tab:label_stats}
\end{table}

The validation and test sets were labeled through crowdsourcing. Five annotators annotated each datapoint for the validation and test sets, and three annotators each for the trial set. The label of each datapoint is the label the majority of annotators chose. The probability of hallucination is reported as the ratio of ``Hallucination'' labels to all labels.

\subsection{Task}
This task is a binary classification task to determine whether the text generated by the \gls{llm} contains any hallucinated content. Accuracy is the main benchmark for this task. This task also uses Spearman's correlation coefficient, $\rho$, to measure the degree of agreement using \texttt{p(Hallucination)}.

% is this too narrative?
From the example in Figure \ref{fig:example_data}, we see the challenges of this task. Annotators were asked to determine whether the hypothesis, ``Having an intense interest in something.'' contains hallucinated information. In addition, annotators know that the hypothesis was generated by the model \texttt{tg/flan-t5-definition-en-base}, a Definition Modeling model, from the input ``I’m an avid reader. What is the meaning of avid?'' Annotators are told to use ``enthusiastic; keen; eager; showing great interest in something or desire to do something'' as a semantic reference to make their decision.

In this example from the model-aware validation dataset, four out of five annotators label this as ``Not Hallucination''. A simple probabilistic model may not be able to identify hallucinations. In this example, the target includes a few definitions of avid. Human annotators recognize that only matching one definition indicates no hallucination is present, while a probabilistic model will only see that very few tokens between these fields match. Here, one annotator did believe there was hallucination present, possibly because the hypothesis was not equally diverse or not semantically similar enough. 

Another challenge is approximating the diversity of what humans consider a ``Hallucination'' to be across the three example tasks (PG, MT, DM). With all of this in mind, we formulate methods to identify hallucinations in LLM output.

\begin{figure}
\begin{tabular}{|p{0.9\linewidth}|}
\hline
Definition modeling is a task to generate a definition for a given word in context. In the example shown below, The source corresponds to the context; The target is the correct definition for this context; the hypothesis is the predicated definition from the model. \\ \\
Example: \\
source: The sides of the casket were covered with heavy black broadcloth, with velvet caps, presenting a deep contrast to the rich surmountings. What is the meaning of surmounting? \\
target: A decorative feature that sits on top of something. \\
hypothesis: A sloping top. \\ \\
Your task is to answer whether the hypothesis from the example contains any hallucination (e.g., incorrect semantic information unsupported or inconsistent with the source) and explain why. The target is inferred from the source without any hallucination. You should consider both the source and the target before making a judgment on the hypothesis. \\ \\
The output should be formatted as a JSON instance that conforms to the JSON schema below.\\
As an example, for the schema \{``properties'': \{``foo'': \{``title'': ``Foo'', ``description'': ``a list of strings'', ``type'': ``array'', ``items'': \{``type'': ``string''\}\}\}, ``required'': [``foo'']\}\\
the object \{``foo'': [``bar'', ``baz'']\} is a well-formatted instance of the schema. The object \{``properties'': \{``foo'': [``bar'', ``baz'']\}\} is not well-formatted.\\ \\
Here is the output schema:\\
\{``properties'': \{``answer'': \{``title'': ``Answer'', ``description'': ``answer 'Yes' if the hypothesis contains hallucination; answer 'No' if the hypothesis does not contain hallucination'', ``type'': ``string''\}, ``reason'': \{``title'': ``Reason'', ``description'': ``a brief explanation to your answer'', ``type'': ``string''\}\}, ``required'': [``answer'', ``reason'']\}\\ \\ \hline
    \end{tabular}
    \caption{GPT Prompt 1 (Three Fields)}
    \label{fig:ex_prompt1}
\end{figure}

\section{Methods}
% how the experiment was done, using what method
\subsection{Model Fine-Tuning}
We first explore how transformer-based models would perform on this task. Due to the similarity of this task to \gls{nli}, models made for hallucination detection and \gls{nli} models are considered. For our preliminary experimentation, all models are trained and tested using only the validation datasets as they are labeled. Each of the validation datasets was split 80/20 into a train and test subset. The best-performing model is used for evaluation on the test set. Our preliminary experimentation shows that hallucination recognition models significantly and consistently outperform \gls{nli} models.

Despite the similarity of \gls{nli} to this task, the \gls{shroom} dataset is more diverse than \gls{nli} datasets. \gls{shroom}'s three example tasks include many different forms of hallucinations that \gls{nli} models do not encounter as frequently or at all in their training. Models for hallucination recognition are usually trained on \gls{nli} datasets as well as others. This data diversity makes hallucination models especially well suited for the hallucinations and data in the \gls{shroom} task.

After identifying the best model, we experiment with different fine-tuning approaches. We vary the number of epochs, which data the model is fine-tuned on, and the order of fine-tuning. Additionally, we inference these models before any training to serve as a baseline. 

All models we fine-tune take in two texts as input. The first text is the frame of reference to determine if hallucinated material is present. The second text is the text that may or may not have a hallucination. The output of the model is a number from 0 to 1. A score of less than 0.5 indicates that a hallucination is ``likely'' present. 

A score of 0 represents high confidence that hallucination is present; a score of 1 represents high confidence that hallucination is not present. Because this scale is inverse to the scale used by the task organizers, where \texttt{p(Hallucination)} being 1 indicates all annotators have chosen the label ``Hallucination'', the model output is subtracted from 1 and the difference is used as \texttt{p(Hallucination)}. 

For our fine-tuning model architecture (as shown in Figure \ref{fig:ft_arch}), we pre-process each datapoint by selecting two text fields to pass to the model and inverting the numerical scale to match the model output. After training, we post-process the output by re-inverting the numerical scale to get our \texttt{label} and \texttt{p(Hallucination)} fields.


\usetikzlibrary{shapes.geometric, arrows, chains, shadows.blur}
\usetikzlibrary{shapes.geometric, arrows, chains, shadows.blur}
\tikzstyle{database} = [
    cylinder,
    cylinder end fill=blue!30, % Fill color for the ends
    shape border rotate=90,
    minimum height=2cm,
    minimum width=2cm,
    draw,
    align=center,
    rounded corners=4pt,
    blur shadow={
        shadow blur steps=10,
        shadow blur extra rounding=2pt, 
        shadow xshift=1pt
    }
]
\tikzstyle{process} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, draw=none, fill=blue!30, rounded corners=4pt, blur shadow]
\tikzstyle{eval} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, draw=none, fill=purple!30, rounded corners=4pt, blur shadow]
\tikzstyle{hf} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, draw=none, fill=yellow!30, rounded corners=4pt, blur shadow]
\tikzstyle{gpt} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, draw=none, fill=green!30, rounded corners=4pt, blur shadow]
\tikzstyle{arrow} = [thick,->,>=stealth]

\begin{figure*}[htbp]
\centering
\begin{tikzpicture}[
    node distance=.5cm,
    start chain=going right,
    every join/.style=arrow
    ]
    
    \node (database1) [database, fill=blue!30, on chain] {Data};
    \node (preprocess) [process, on chain, align=center] {Pre-processing \\ (Form Input, \\ Invert Scale)};
    \node (huggingface) [hf, on chain, align=center] {HF Model \\ (Train, Evaluate)};
    \node (hallucination) [process, on chain, align=center] {Post-processing \\ (Re-invert Scale)};
    \node (evaluation) [eval, on chain, align=center] {Evaluation \\ (Accuracy)};
    
    % Arrows between nodes
    \draw [arrow] (database1) -- (preprocess);
    \draw [arrow] (preprocess) -- (huggingface);
    \draw [arrow] (huggingface) -- (hallucination);
    \draw [arrow] (hallucination) -- (evaluation);

\end{tikzpicture}
\caption{Fine-tuning architecture}
\label{fig:ft_arch}
\end{figure*}

\begin{figure*}[htbp]
\centering
\begin{tikzpicture}[
    node distance=.5cm,
    start chain=going right,
    every join/.style=arrow
    ]
    
    \node (database1) [database, fill=blue!30, on chain] {Data};
    \node (preprocess) [process, on chain, align=center] {Pre-processing \\ (Form Prompt)};
    \node (gpt) [gpt, on chain, align=center] {GPT \\ (Inference)};
    \node (hallucination) [process, on chain, align=center] {Post-processing \\ (Interpret JSON)};
    \node (evaluation) [eval, on chain, align=center] {Evaluation \\ (Accuracy)};
    
    % Arrows between nodes
    \draw [arrow] (database1) -- (preprocess);
    \draw [arrow] (preprocess) -- (gpt);
    \draw [arrow] (gpt) -- (hallucination);
    \draw [arrow] (hallucination) -- (evaluation);

\end{tikzpicture}
\caption{Prompt-tuning architecture}
\label{fig:pt_arch}
\end{figure*}

\subsection{LLM Prompt-Tuning}

Our team also uses \gls{llms} as black-box hallucination detection systems. We first experiment with zero-shot classification on the validation sets. We use GPT-3.5 \cite{gpt3} and GPT-4 \cite{gpt4} with the prompt shown in Figure \ref{fig:ex_prompt1}. If a model performs well on the validation sets, it would also be used to evaluate the test sets.

After choosing a model, we tune the prompt. The prompts we experiment with vary with respect to which fields are provided, the structure/order of the prompt, the inclusion of the task definition, and the overall verbosity of the prompt. One additional experiment we performed was the specific format of the model response. Asking a large-scale LLM to respond to a Yes/No question and give a reason may lead to many different responses. Although we expect the model to answer ``Yes'' or ``No'' when told to, it may ignore that part of the instruction and respond in a way that is correct but not directly interpretable by our post-processing such as ``This contains a hallucination'' instead of ``Yes''. 

Asking the model to respond in JSON format increased the likelihood that the answer would be directly interpretable. Additionally, we ask our models to provide explanations for their ``Yes'' or ``No'' responses. While we do not use these to determine the \texttt{label} or \texttt{p(Hallucination)} for any datapoint, we found that asking LLMs to provide reasoning boosted performance. Shorter prompts such as those seen in Figure \ref{fig:ex_prompt2} were also used with these models. To ensure replicability, we set the hyperparameter \texttt{temperature} to $0.0$. Setting this hyperparameter as such leads to increased determinism in responses. 

Our post-processing assigns the \texttt{label} field ``Hallucination'' or ``Not Hallucination'' based on the value of the key \texttt{answer} found in GPT's JSON output. For these models, \texttt{p(Hallucination)} was set naively. Therefore, if the model returns \texttt{...\{``answer'': ``Yes''\}...}, \texttt{label} is ``Hallucination'' and \texttt{p(Hallucination)} is 1. When ``Not Hallucination'' is the label, \texttt{p(Hallucination)} is 0.

\begin{figure}
\begin{tabular}{|p{0.9\linewidth}|}
\hline
Your task is to determine whether the hypothesis contains any hallucinations based on the target. (e.g., incorrect semantic information) and explain why. Only consider target and hypothesis when making the judgement. Your answer must start with 'Yes' or 'No'. \\ \\
Example:\\
target: A decorative feature that sits on top of something .\\
hypothesis: A sloping top .\\ \\
The output should be formatted as a JSON instance that conforms to the JSON schema below.\\
As an example, for the schema \{``properties'': \{``foo'': \{``title'': ``Foo'', ``description'': ``a list of strings'', ``type'': ``array'', ``items'': \{``type'': ``string''\}\}\}, ``required'': [``foo'']\}\\
the object \{``foo'': [``bar'', ``baz'']\} is a well-formatted instance of the schema. The object \{``properties'': \{``foo'': [``bar'', ``baz'']\}\} is not well-formatted.\\ \\
Here is the output schema:\\
\{``properties'': \{``answer'': \{``title'': ``Answer'', ``description'': ``answer 'Yes' if the hypothesis contains hallucination; answer 'No' if the hypothesis does not contain hallucination'', ``type'': ``string''\}, ``reason'': \{``title'': ``Reason'', ``description'': ``a brief explanation to your answer'', ``type'': ``string''\}\}, ``required'': [``answer'', ``reason'']\}\\ \\ \hline
    \end{tabular}
    \caption{GPT Prompt 2 (Two Fields)}
    \label{fig:ex_prompt2}
\end{figure}

\section{Experiments}
Each datapoint contains up to three semantically relevant text fields, \texttt{hyp}, \texttt{src}, and \texttt{tgt}. In the model-agnostic subtask, these fields are always provided. In the model-aware subtask, \texttt{tgt} is left blank if the \texttt{task} is \gls{pg}. We experiment by varying which of these fields get passed to our model and the structure of the model input.

We conduct a series of experiments using two approaches to detecting hallucinations. We first fine-tuned existing hallucination detection models using \gls{shroom} validation data. Second, we experiment with a series of prompts to increase determinism and accuracy of LLMs on the same task. We show similarities of note between the best results of each architecture. 
\subsection{Fine-Tuning Experiments}

The model that we find to perform the best on this task is a model to detect LLM-generated hallucinations. We find that the best results were obtained from this model when the input is of the form [CLS]+\texttt{tgt}+[SEP]+\texttt{hyp} for DM and MT. When \texttt{tgt} is not provided for the model-aware \gls{pg} examples, the input [CLS]+\texttt{src}+[SEP]+\texttt{hyp} is used. This model is \texttt{vectara/hallucination\_evaluation\_model} on HuggingFace. This model took \texttt{microsoft/deberta-v3-base} \citep{he2021deberta} and trained it on two \gls{nli} datasets, SNLI \citep{bowman-etal-2015-large} and MultiNLI \citep{N18-1101}, as well as one paraphrase dataset, \gls{paws} \citep{zhang-etal-2019-paws}.

We first conducted our preliminary experiments on the split validation sets. After, we took the best-performing model, fine-tuned it on the entire validation set(s), and evaluated it on the test set(s). We experimented with varying the number of epochs, the datasets used, and the training order. 

% Our full results from these experiments are reported in Figure \ref{fig:linegraph} and Table \ref{tab:epoch_data}. 
For both the model-agnostic and model-aware subtasks, we experimented with inferencing, 1-5 epochs of training on the corresponding validation dataset, 1-5 epochs of training on all validation data, and 1, 3, or 5 epochs of training on both validation datasets before one epoch of tuning on the corresponding validation dataset.

\subsection{Prompt-Tuning Experiments}
% what the experiment was, how was the method used
In addition to fine-tuning off-the-shelf models, we experiment with GPT-3.5 and GPT-4 using several prompts. After evaluating the validation sets on GPT-3.5 and GPT-4, further prompt tuning was done on GPT-4 due to its superior performance. 

The first prompt we experiment with includes \texttt{hyp}, \texttt{src}, and \texttt{tgt}, task instructions, the example task definition, and the main prompt. The second prompt we used only included two fields (\texttt{hyp} and \texttt{tgt} for DM and MT, \texttt{hyp} and \texttt{src} for PG), task instructions, and the main prompt.

\begin{table}[]
\resizebox{\columnwidth}{!}{%
\begin{tabular}{|l|ll|ll|}
\hline
\textbf{Dataset} & \multicolumn{2}{c|}{\textbf{Test AG}}   & \multicolumn{2}{c|}{\textbf{Test AW}}      \\ \hline
\textbf{Metric} & \multicolumn{1}{c|}{\textbf{acc}}  & \multicolumn{1}{c|}{\textbf{$\rho$}} & \multicolumn{1}{c|}{\textbf{acc}}  & \multicolumn{1}{c|}{\textbf{$\rho$}} \\ \hline
SHROOM Baseline & \multicolumn{1}{l|}{0.697} & 0.403 & \multicolumn{1}{l|}{0.745} & 0.488 \\ \hline
Corresponding Dataset & \multicolumn{1}{l|}{0.783} &  0.663   & \multicolumn{1}{l|}{\textbf{0.813}} &  0.699   \\ \hline
All Data              & \multicolumn{1}{l|}{0.785} &  0.652   & \multicolumn{1}{l|}{0.808} &  0.713   \\ \hline
All + Corresponding   & \multicolumn{1}{l|}{0.783} &  0.683   & \multicolumn{1}{l|}{0.810}  &   0.671  \\ \hline
GPT-4 (Two Fields)   & \multicolumn{1}{l|}{\textbf{0.814}}     &  0.626   & \multicolumn{1}{l|}{0.783}     &   0.614  \\ \hline
\end{tabular}
}
\caption{Best results from each approach and the baseline results. Corresponding Dataset, All Data, and All + Corresponding are fine-tuning results; GPT-4 is prompt-tuning results}
\label{tab:best_results}
\end{table}

\section{Results}
% state improvements over baselines (for gpt4 on val entirely)
% state
Our best results from each training architecture are shown in Table \ref{tab:best_results}. One notable similarity between our best results from each system is that they required pre-processing (data pruning). We obtain our best results by only including two of the three meaningful fields for each datapoint in both fine-tuning and prompt-tuning methods. For the fine-tuning methods, converting three fields into two via concatenation underperformed ignoring one field (\texttt{src} was ignored if \texttt{tgt} was provided). Additionally, removing the definitions of DM, MT, and PG from the prompt led to improved results.

\begin{table}[]
\centering
\begin{tabular}{|l|r|r|}
\hline
\textbf{Dataset} & \textbf{Test AG} & \textbf{Test AW} \\ \hline
PG               & 0.789             & 0.875             \\ \hline
MT               & 0.851             & 0.837             \\ \hline
DM               & 0.794             & 0.747             \\ \hline
All              & 0.814             & 0.813             \\ \hline
\end{tabular}
\caption{Accuracy of best submission to each subtask split by example task}
\label{tab:best_results_task}
\end{table}

Despite not making explicit use of the \texttt{model} field for the model-aware subtask, our models' best performances earned a higher spot in the model-aware subtask than the model-agnostic one. For the model-aware subtask, we use \texttt{src} when \texttt{tgt} is not provided for the model-aware PG examples. We also believe it to be due to the differences in other fields. For instance, the DM examples for the model-aware and model-agnostic tasks are formatted differently. The model-aware examples ask for the definition explicitly at the end of the \texttt{src} field (e.g. ``... What is the meaning of spoilage ?''). The model-agnostic examples put the word to define in tags (e.g. ``The <define> sacrifice bunt </define> was fielded cleanly...''). These different tagging strategies reflect inputs different DM models take in. Based on our results in Table \ref{tab:best_results_task}, it seems that our systems are better are recognizing hallucinations obtained via <define> tags.

Scores within .001 point of each other were obtained for each subtask using these systems, yet different systems performed the best for each. Our shorter prompt with GPT-4 produced our best results (\#10) for the model-agnostic subtask, .117 points above the task organizer baseline. Training on the corresponding \gls{shroom} validation dataset produced the best results (\#1) for the model-aware subtask, .068 points above the task organizer baseline.

\subsection{Fine-Tuning Results}
\begin{figure}
\centering
\resizebox{\columnwidth}{!}{%
\begin{tikzpicture}
\begin{axis}[
    xlabel={Epochs},
    ylabel={Accuracy},
    xmin=0, xmax=5,
    ymin=.72, ymax=.8,
    legend pos=south east,
    ymajorgrids=true,
    grid style=dashed,
    title={Model-agnostic subtask},
]
 
\addplot[
    color=blue,
    mark=square,
    ]
    coordinates {
    (0,0.756)(1,0.769)(2,0.776)(3,0.776)(4,0.783)(5,0.783)
    };
    \addlegendentry{Agnostic Data}

\addplot[
    color=red,
    mark=square,
    ]
    coordinates {
    (0,0.756)(1,0.779)(2,0.777)(3,0.777)(4,0.785)(5,0.78)
    };
    \addlegendentry{All Data}

\addplot[
    color=purple,
    mark=square,
    ] 
    coordinates {
    (0, 0.756)(1, 0.783)(3, 0.775)(5, 0.783)
    };
    \addlegendentry{All Data + 1 Epoch Agnostic Data}
 
\end{axis}
\end{tikzpicture}
}
\resizebox{\columnwidth}{!}{%
\begin{tikzpicture}
\begin{axis}[
    xlabel={Epochs},
    ylabel={Accuracy},
    xmin=0, xmax=5,
    ymin=.74, ymax=.82,
    legend pos=south east,
    ymajorgrids=true,
    grid style=dashed,
    title={Model-aware subtask},
]
 
\addplot[
    color=blue,
    mark=square,
    ]
    coordinates {
    (0,0.794)(1,0.804)(2,0.804)(3,0.805)(4,0.813)(5,0.803)
    };
    \addlegendentry{Aware Data}

\addplot[
    color=red,
    mark=square,
    ]
    coordinates {
    (0,0.794)(1,0.796)(2,0.808)(3,0.808)(4,0.808)(5,0.797)
    };
    \addlegendentry{All Data}

\addplot[
    color=purple,
    mark=square,
    ] 
    coordinates {
    (0, 0.794)(1, 0.808)(3, 0.81)(5, 0.795)
    };
    \addlegendentry{All Data + 1 Epoch Aware Data}
 
\end{axis}
\end{tikzpicture}
}
\caption{Line graphs showing accuracy on the test sets of both subtasks after fine-tuning}
\label{fig:linegraph}
\end{figure}




\begin{figure}
    \centering
    \resizebox{\columnwidth}{!}{%
    \includegraphics{cm_ft_all.png}
    }
    \caption{Confusion matrix for the \#1 submission on the model-aware dataset (fine-tuning approach)}
    \label{fig:cm_aw}
\end{figure}

\begin{figure}
    \centering
    \resizebox{\columnwidth}{!}{%
    \includegraphics{cm_pt_all.png}
    }
    \caption{Confusion matrix for the \#10 submission on the model-agnostic dataset (prompt-tuning approach)}
    \label{fig:cm_ag}
\end{figure}

\begin{table}[]
\resizebox{\columnwidth}{!}{%
\begin{tabular}{|l|r|r|r|r|r|r|}
\hline
\multicolumn{1}{|c|}{\# of epochs}        & 0     & 1     & 2     & 3     & 4     & 5     \\ \hline
Agnostic Data & 0.756 & 0.769 & 0.776 & 0.776 & 0.783 & 0.783 \\ \hline
All Data      & 0.756 & 0.779 & 0.777 & 0.777 & \textbf{0.785} & 0.780 \\ \hline 
All + Agnostic Data & 0.756 & 0.783 & &  0.775 & & 0.783 \\ \hline \hline
Aware Data    & 0.794 & 0.804 & 0.804 & 0.805 & \textbf{0.813} & 0.803 \\ \hline
All Data      & 0.794 & 0.796 & 0.808 & 0.808 & 0.808 & 0.797 \\ \hline
All + Aware Data & 0.794 & 0.808 & & 0.810 & & 0.795 \\ \hline
\end{tabular}
}
\caption{Table of accuracy data shown in Figure \ref{fig:linegraph}}
\label{tab:epoch_data}
\end{table}

Our team's first experiments on the test set involved varying the number of epochs, the training set(s), and the training order. These results for the model-agnostic and model-aware subtasks are shown in Figure \ref{fig:linegraph} and Table \ref{tab:epoch_data}. The 0 epoch results are from inferencing the model before training on \gls{shroom} data. They serve as a baseline for all training strategies. This model's strong performance at inference for both test sets made it a strong contender for more fine-tuning. On the model-agnostic subtask, inferencing resulted in an accuracy of 0.756. On the model-aware subtask, it obtained a score of 0.794.

Training with any \gls{shroom} data led to better performance on the test set. For the model-agnostic subtask, our team's best result came from fine-tuning the model on the model-agnostic and model-aware datasets together for four epochs. This increased the accuracy from our inference baseline by 0.029 to 0.785. On the model-aware subtask, our team's best results were obtained after fine-tuning the model using only the model-aware data for four epochs. This increased the accuracy from the inference baseline by 0.019 to 0.813, our winning submission for the model-aware subtask.

As seen in Figure \ref{fig:cm_aw}, this architecture performs well on the \gls{shroom} model-aware subtask. Figure \ref{fig:cm_aw3} and Table \ref{tab:best_results_task} show a breakdown by task. This model performed very well on PG and MT but much worse on DM. 
We believe this task has the lowest accuracy for the same reason we identified earlier in the paper. The target, source, and hypothesis fields may vary much more than in the other two tasks. The target may be much more or much less semantically rich than the hypothesis, which can be interpreted by human annotators and out models in many different ways. For the winning submission, the accuracy for the PG task was .875, MT was .837, and DM was .747.

\begin{figure*}
    \centering
    \resizebox{\textwidth}{!}{%
    \includegraphics{cm_ft_pg.png}
    \includegraphics{cm_ft_mt.png}
    \includegraphics{cm_ft_dm.png}
    }
    \caption{Confusion matrices for the \#1 submission on the model-aware dataset (fine-tuning method) split by example task. Left to right: Paraphrase Generation, Machine Translation, Definition Modeling}
    \label{fig:cm_aw3}
\end{figure*}

\begin{figure*}
    \centering
    \resizebox{\textwidth}{!}{%
    \includegraphics{cm_pt_pg.png}
    \includegraphics{cm_pt_mt.png}
    \includegraphics{cm_pt_dm.png}
    }
    \caption{Confusion matrices the \#10 submission on the model-agnostic dataset (prompt-tuning method) split by example task. Left to right: Paraphrase Generation, Machine Translation, Definition Modeling}
    \label{fig:cm_ag3}
\end{figure*}

\begin{table}[]
\centering
\begin{tabular}{|l|c|c|}
\hline
\textbf{Dataset} & \textbf{Val AG} & \textbf{Val AW} \\ \hline
SHROOM Baseline               & 0.649               & 0.707            \\ \hline
GPT-3.5                 & 0.661               & 0.596         \\ \hline
GPT-4 (Three Fields)    & 0.778               & 0.751      \\ \hline
GPT-4 (Two Fields)      & \textbf{0.782}      & \textbf{0.773}            \\ \hline
% GPT4 + Few Shot        & 0.756                &                  \\ \hline
\end{tabular}
\caption{Comparison of the baseline results to our results on the validation sets using accuracy}
\label{tab:val_gpt_results}
\end{table}

\subsection{LLM-Tuning Results}
Our LLM experimentation results are shown in Table \ref{tab:val_gpt_results}. Because we experimented with prompt-tuning on the validation sets, we were able to directly compare our results to the baselines provided by the task organizers. We found that GPT-3.5 performed worse than the baseline for one subtask and did not pursue further experiments with it. We tested two prompts on the validation sets. 

Our first prompt (Figure \ref{fig:ex_prompt1}) includes all meaningful fields that annotators had access to when labeling the data. For the model-agnostic subtask, this prompt outperformed the baseline by 0.129 with an accuracy of 0.778. it improved the accuracy in the model-aware subtask by 0.044 with an accuracy of 0.751.

Our second prompt (Figure \ref{fig:ex_prompt2}) includes selected fields of meaningful information from each datapoint. It does not explain the example task (DM, MT, or PG) for the datapoint but still explains the shared-task instructions and output formatting instructions. This reduction in verbosity led to improved performance for both subtasks. For the model-agnostic validation set, this change resulted in a .133 point increase in accuracy above the baseline and a .004 point increase compared to the first prompt. For the model-aware validation set, this change resulted in a .066 point increase compared to the baseline and a .022 increase compared to the first prompt. 

We also experimented with few-shot learning and found that both random examples and selected examples did not improve performance on either subtask. Overall, we found that a less verbose prompt outperformed a more verbose prompt indicating that GPT has difficulty making connections across large amounts of text. Additional information that GPT may not need in each prompt, such as the example task definition and the third field, adds noise to the prompt and impairs its ability to detect hallucinations.

The confusion matrices in Figures \ref{fig:cm_ag} and \ref{fig:cm_ag3} show the performance of this architecture on the entire test set and on each task for the model-agnostic subtask. For this submission, the accuracy for the PG task was .789, significantly lower than the other example tasks. We believe this is because we used the \texttt{tgt} field for all tasks here as it is always provided. In the model-aware subtask, \texttt{tgt} is not provided for PG examples, so \texttt{src} is used instead. This may indicate that \texttt{tgt} is best for MT and DM, but \texttt{src} for PG even if \texttt{tgt} is provided. The accuracy for the MT task examples was .851, similar to the model-aware subtask. The accuracy for Definition Modeling was .794.












% \begin{figure}
%     \centering
%     \resizebox{\columnwidth}{!}{%
%     \includegraphics{cm_pt_all.png}
%     \includegraphics{cm_pt_pg.png}
%     }
    
%     \resizebox{\columnwidth}{!}{%
%     \includegraphics{cm_pt_dm.png}
%     \includegraphics{cm_pt_mt.png}
%     }
%     \caption{Confusion matrices for best results on the model-aware dataset, all and split by subtask. From top to bottom and left to right: All Data, PG, DM, MT}
%     \label{fig:enter-label}
% \end{figure}

% \begin{figure}
%     \centering
%     \resizebox{\columnwidth}{!}{%
%     \includegraphics{cm_ft_mt.png}
%     }
%     \caption{Caption}
%     \label{fig:enter-label}
% \end{figure}

% \begin{figure}
%     \centering
%     \resizebox{\columnwidth}{!}{%
%     \includegraphics{cm_ft_dm.png}
%     }
%     \caption{Caption}
%     \label{fig:enter-label}
% \end{figure}

\section{Discussion and Conclusion}
In this paper, we present two systems for hallucination recognition, one transformer-based model fine-tuned on \gls{shroom} data and one prompt-tuned zero-shot classification model using GPT-4. Our results show that both systems can better handle semantically complex tasks such as hallucination recognition when only semantically relevant information is provided. Pre-processing each example is essential to good performance on this task. From our results, fine-tuning using available labeled data from all tasks improves performance from the baseline. Additionally, pruning information such as over-explicit instructions, irrelevant fields, and definitions from prompts also improves performance from the baseline.

Some avenues we did not fully explore include training on pseudo-labeled training data, training on additional datasets besides SNLI, MultiNLI, and PAWS (specifically adversarial translation or word disambiguation datasets), as well as experimenting with dense paraphrasing and frame saturation methods as proposed by \citet{tu-etal-2023-dense}.
In this shared task, our team found that it is easier to harmonize by tuning fewer, clearer voices.

\section*{Acknowledgements}
The authors would like to acknowledge the support and input from Kyeongmin Rim. This work was supported in part by NSF grant 2326985 to James Pustejovsky. The opinions and views reported herein are those of the authors alone.

%\nocite{Ando2005,andrew2007scalable,rasooli-tetrault-2015}

% Bibliography entries for the entire Anthology, followed by custom entries
\bibliography{anthology, custom, latex/references}
% \clearpage
% \appendix

% \section{Appendix}


\end{document}
