Evaluating Large Language Models: A Comparative Study of GPT, Gemini, LLaMA and Cohere with Retrieval Augmented Generation
摘要
There has been a growing use of large language models (LLM) in various tasks, but there are still few studies that focus on how accurate their generated answers are. Retrieval-Augmented Generation (RAG) helps improve this by reducing hallucinations and grounding the responses in real data. It is important to test how well these models can give correct and meaningful answers. In this study, we compared the performance of four well-known LLMs—OpenAI’s GPT-4o Mini, Google’s Gemini Flash 2.0, Meta’s LLaMA 3 8B Instruct, and Cohere’s Command R Plus—using a RAG setup. We used the same set of queries and retrieved the same relevant information from a shared knowledge base for each model. Each LLM then generated a response based on that retrieved data, and we compared the outputs to a ground truth created from the original source content. GPT-4o therefore provided superior answers to all the other models tested on the basis of factuality, fluency, and relevance, followed by LLaMA 3 8B and Command R Plus. It can thus be inferred from our study that, of all these models tested, the GPT-4o Mini showed the best reliability when paired with RAG. In the future, we will extend this research to include more queries and human feedback in order to build a deeper understanding of these models in different contexts.