Enhancing text comprehension for Question Answering with Contrastive Learning (2023)

Abstract: Although Question Answering (QA) have advanced to the human-level language skills in NLP tasks, there is still a problem: the QA model gets confused when there are similar sentences or paragraphs. Existing studies focus on enhancing the text understanding of the candidate answers to improve the overall performance of the QA models. However, since these methods focus on re-ranking queries or candidate answers, they fail to resolve the confusion when many generated answers are similar to the expected answer. To address these issues, we propose a novel contrastive learning framework called ContrastiveQA that alleviates the confusion problem in answer extraction. We propose a supervised method where we generate positive and negative samples from the candidate answers and the given answer, respectively. We thus introduce ContrastiveQA, which uses contrastive learning with sampling data to reduce incorrect answers. Experimental results on four QA benchmarks show the effectiveness of the proposed method.

## introduction large language model (llm) is developing rapidly, and chatgpt @xcite , which can perform almost all natural language processing tasks, is receiving tremendous attention. chatgpt can be easily used by anyone through a conversation interface, and chatgpt responds appropriately to the user's query. it is clear that chatgpt has led to tremendous development and success, but it has a fatal problem called hallucination @xcite . a generative model such as chatgpt can have serious consequences if poor decisions are made when it is used in specific domains such as finance, law, and medicine @xcite . to avoid this hallucination problem in specific domains, finding the correct figure 1 : an example of hotpotqa dataset that consists of several paragraphs in one context. hotpotqa consists of two supporting paragraphs and eight distractor settings. a distractor paragraph appears to be related to the question but is used to induce confusion. with this motivation, we propose a novel qa model called contrastiveqa that uses contrastive learning to pull semantically similar sentences closer and push different sentences further. in addition, the proposed model introduces a method of positive and negative sampling with candidate answers. contrastiveqa performs the contrastive learning by generating positive and negative samples with the given answer and candidate answers obtained from a pre-finetuned qa model. the proposed model extracts an answer close to the correct answer because the qa model uses a contrastive objective to alleviate the confusing problem of selecting the correct answer. we demonstrate the effectiveness of our approach on four extractive qa datasets: hotpotqa @xcite , squad @xcite , triviaqa @xcite and newsqa @xcite . we obtain notable performance for the proposed contrastiveqa, a method learned by contrastive learning, on extractive qa datasets. in particular, the experimental results demonstrate that the proposed method performs significantly better than the previous approaches due to the positive and negative sampling. ## proposed model in this work, we propose a novel questionanswering (qa) model, called contrastiveqa. the proposed model allows accurate answers to be extracted by adding a contrastive loss term, which alleviates the confusion and errors that may occur when using the existing qa model. to achieve this purpose, we divide the training phase into three main steps: candidate answer extraction, positive and negative sampling, and con-trastiveqa to perform contrastive learning. in particular, we introduce a method for creating data to perform contrastiveqa, where the correct answer is known, in the positive and negative sampling step. the overall flow of the proposed contrastiveqa model is shown in fig. 2 . ## experiment setup in this section, we provide experimental datasets and detail about the experiments. we summarize the number of train datasets and the source of the dataset in ## conclusion in this work, we proposed a novel contrastiveqa to alleviate the problem of confusion in answer extraction using contrastive learning. the proposed model contrastiveqa consists of three tasks: 1) candidate answer extraction, 2) positive and negative sampling, 3) contrastiveqa using contrastive learning. we demonstrated the effectiveness of the proposed model by outperforming the performance of the baseline models on four benchmark datasets. in the future, we would like to adopt a method to specify the number of samples required in contrastive learning dynamically. this approach created an adaptive mechanism to use the number of samples for each input. this method could improve the overall performance of the model.