Evidence-backed Fact Checking using RAG and Few-Shot In-Context Learning with LLM s (2024)

Abstract: Given the widespread dissemination of misinformation on social media, implementing fact-checking mechanisms for online claims is essential. Manually verifying every claim is very challenging, underscoring the need for an automated fact-checking system. This paper presents our system designed to address this issue. We utilize the Averitec dataset (Schlichtkrull et al., 2023) to assess the performance of our fact-checking system. In addition to veracity prediction, our system provides supporting evidence, which is extracted from the dataset. We develop a Retrieve and Generate (RAG) pipeline to extract relevant evidence sentences from a knowledge base, which are then inputted along with the claim into a large language model (LLM) for classification. We also evaluate the few-shot In-Context Learning (ICL) capabilities of multiple LLMs. Our system achieves an ‘Averitec’ score of 0.33, which is a 22% absolute improvement over the baseline. Our Code is publicly available on https://github.com/ronit-singhal/evidence-backed-fact-checking-using-rag-and-few-shot-in-context-learning-with-llms.

## introduction the proliferation of fake news and misinformation on social media platforms has emerged as a significant contemporary issue @xcite . false online claims have, in some cases, incited riots @xcite and even resulted in loss of life @xcite . this problem is particularly amplified during critical events such as elections @xcite and pandemics @xcite @xcite . given the vast volume of online content, manually fact-checking every claim is impractical. therefore, the development of an automated fact * work does not relate to position at amazon. figure 1 : overview diagram of our system. first, the claim is used to retrieve the top 3 relevant documents. next, evidence is extracted from these documents using questions and answers generated by an llm. finally, the evidence is used for veracity prediction via few-shot icl. in this paper, we present our system for automated fact verification. our system classifies a given textual claim into one of four categories: supported, refuted, conflicting evidence/cherrypicking, or not enough evidence. additionally, it provides supporting evidence for the classification. our approach leverages recent advancements in large language models (llms), specifically retrieval-augmented generation (rag) and in-context learning (icl), to produce evidence-backed veracity predictions. given a claim and a collection of documents, our system first employs a rag pipeline to retrieve the three most relevant documents and extract evidence from them. subsequently, we utilize icl to determine the veracity of the claim based on the extracted evidence. figure 1 provides a high-level overview of our system. we evaluate our system on the averitec dataset @xcite , where it outper-forms the official baseline by a large margin. our key contributions are as follows: the remainder of this paper is structured as follows: section 2 provides a literature review of related works, while section 3 describes the dataset. in section 4, we outline our methodology, followed by a detailed account of the experimental setup in section 5. section 6 presents and analyzes our results, and finally, we conclude in section 7. ## related work recently, there has been increased research interest in fake news detection and fact checking. @xcite proposed an ensemble of bert @xcite for covid fake news @xcite detection. harrag and djahli (2022) employed deep learning techniques for fact checking in arabic @xcite . @xcite tackled the problem of fake news detection using graph neural networks. the factify tasks @xcite aimed to detect multi-modal fake news. however, these systems only provide the veracity prediction without any evidence. on the fever dataset ( thorne et al., 2018 @xcite based method for fact checking over unstructured information @xcite . these systems provide evidence or explanation to back their predictions but they test the veracity of synthetic claims whereas we test real claims. some researchers have also used llms to tackle the problem. llms as agents to enhance the faithfulness of explanations of evidence for fact-checking. zhang and gao (2023) designed a hierarchical prompting method which directs llms to separate a claim into several smaller claims and then verify each of them progressively. there have also been attempts to solve the problem using rag. khaliq et al. (2024) utilized multimodal llms with a reasoning method called chain of rag to provide evidence based on text and image. @xcite proposed a method to decrease misinformation in rag pipelines by reranking the documents during retrieval based on a credibility score assigned to them. similar to these systems, we also use rag and llms in our solution. for more detailed surveys, please refer to thorne and vlachos (2018); kotonya and toni (2020); @xcite . convert the following claim to one neutral question. do not miss out anything important from the claim. question the claim, not the fact. claim: donald trump has stated he will not contest for the next elections incorrect question: "what did donald trump state for the next elections?" correct question: "did donald trump state that he will not contest for the next elections?" claim: [another claim] incorrect question: [example of an incorrect question] correct question: [expected correct question] given claim: in a letter to steve jobs, sean connery refused to appear in an apple commercial. generated question: "is it true that sean connery wrote a letter to steve jobs refusing to appear in an apple commercial?" the following: support (s), refute (r), conflicting evidence/cherrypicking (c), or not enough evidence (n). a claim is labeled as c when it contains both supporting and refuting evidence. the data distribution, as shown in on average, each claim consists of 17 words. figure 2 (word cloud of the claims) reveals that most claims are related to politics and covid-19. ## methodology given a claim and a knowledge store, our system is comprised of three key components: relevant document retrieval, evidence extraction from the documents, and veracity prediction based on the extracted evidence. the first two components form our retrieval-augmented generation (rag) pipeline. ## experiments to convert documents into dense embeddings, we utilize the dunzhang/stella_en_1.5b_v5 model foot_1 . this model is chosen because, at the time of our experiments, it was ranked first on the massive text embedding benchmark (mteb) leaderboard @xcite , and holds the second position at the time of writing this paper. for all llms used in our experiments, we employ their 4-bit quantized versions via ollama foot_2 . this quantization enables us to load larger llms onto our gpus. for question generation, we use the phi-3medium model @xcite . the temperature is set to 0, and greedy decoding is used to ensure that the answers are as factual as possible and to minimize hallucinations. for answer generation and final classification, we experiment with multiple llms of varying sizes, including internlm2.5 @xcite , llama-3.1 @xcite , qwen2 @xcite , and mixtral @xcite . these models are selected based on their performance on the open llm leaderboard @xcite and their availability through ollama. we utilize an a40 gpu for mixtral, while all other models are run on an a100 gpu. our best-performing model, mixtral, requires an average of 2 minutes for evidence extraction and final prediction. our code is publicly available on https://github.com/ronit-singhal/evidence-backedfact-checking-using-rag-and-few-shot-in-context ## conclusion and future work in this paper, we introduced our system for evidence-supported automated fact verification. our system -based on rag and icl -requires only a minimal number of training examples to extract relevant evidence and make veracity predictions. we observed that all llms demonstrate sub-optimal performance on the "conflicting evidence/cherrypicking" and "not enough evidence" categories, which emphasizes the inherent challenges of these categories. additionally, no single llm consistently outperforms others across all categories. our system achieved an averitec score of 0.33, highlighting the complexity of the problem and indicating a substantial potential for future improvement. future research could involve fine-tuning the llm using parameter-efficient fine-tuning (peft) techniques @xcite and improving performance through the use of ensemble techniques @xcite . extending the system to include multi-modal fact verification @xcite also represents an interesting direction for further investigation.