SubmissionNumber#=%=#143 FinalPaperTitle#=%=#Infrrd.ai at SemEval-2024 Task 7: RAG-based end-to-end training to generate headlines and numbers ShortPaperTitle#=%=# NumberOfPages#=%=#12 CopyrightSigned#=%=#Deepak Kumar JobTitle#==# Organization#==#Infrrd.ai, Suite 301E, 2001 Gateway Place, San Jose, CA 95110 Abstract#==#We propose a training algorithm based on retrieval-augmented generation (RAG) to obtain the most similar training samples. The training samples obtained are used as a reference to perform contextual learning-based fine-tuning of large language models (LLMs). We use the proposed method to generate headlines and extract numerical values from unstructured text. Models are made aware of the presence of numbers in the unstructured text with extended markup language (XML) tags specifically designed to capture the numbers. The headlines of unstructured text are preprocessed to wrap the number and then presented to the model. A number of mathematical operations are also passed as references to cover the chain-of-thought (COT) approach. Therefore, the model can calculate the final value passed to a mathematical operation. We perform the validation of numbers as a post-processing step to verify whether the numerical value calculated by the model is correct or not. The automatic validation of numbers in the generated headline helped the model achieve the best results in human evaluation among the methods involved. Author{1}{Firstname}#=%=#JiangLong Author{1}{Lastname}#=%=#He Author{1}{Email}#=%=#jianglong@infrrd.ai Author{1}{Affiliation}#=%=#Infrrd.ai Author{2}{Firstname}#=%=#Saiteja Author{2}{Lastname}#=%=#Tallam Author{2}{Email}#=%=#saitejatallam@infrrd.ai Author{2}{Affiliation}#=%=#Infrrd.ai Author{3}{Firstname}#=%=#Srirama Author{3}{Lastname}#=%=#Nakshathri Author{3}{Email}#=%=#srirama@infrrd.ai Author{3}{Affiliation}#=%=#Infrrd.ai Author{4}{Firstname}#=%=#Navaneeth Author{4}{Lastname}#=%=#Amarnath Author{4}{Email}#=%=#navaneethamarnath@infrrd.ai Author{4}{Affiliation}#=%=#Infrrd.ai Author{5}{Firstname}#=%=#Pratiba Author{5}{Lastname}#=%=#KR Author{5}{Email}#=%=#pratibakr@infrrd.ai Author{5}{Affiliation}#=%=#Infrrd.ai Author{6}{Firstname}#=%=#Deepak Author{6}{Lastname}#=%=#Kumar Author{6}{Username}#=%=#deepakumar Author{6}{Email}#=%=#deepakumar@infrrd.ai Author{6}{Affiliation}#=%=#Infrrd.ai ========== èéáğö