[Paper Review] Investigating the performance of Retrieval-Augmented Generation and fine-tuning for the development of AI-driven knowledge-based systems
This study compares Retrieval-Augmented Generation (RAG) and fine-tuning (FN) for building AI-driven knowledge systems using GPT-J-6B, OPT-6.7B, LLaMA, and LLaMA-2 models. RAG outperforms FN by 16% in ROUGE, 15% in BLEU, and 53% in cosine similarity, significantly reducing hallucination despite FN's slightly higher METEOR score.
The development of generative large language models (G-LLM) opened up new opportunities for the development of new types of knowledge-based systems similar to ChatGPT, Bing, or Gemini. Fine-tuning (FN) and Retrieval-Augmented Generation (RAG) are the techniques that can be used to implement domain adaptation for the development of G-LLM-based knowledge systems. In our study, using ROUGE, BLEU, METEOR scores, and cosine similarity, we compare and examine the performance of RAG and FN for the GPT-J-6B, OPT-6.7B, LlaMA, LlaMA-2 language models. Based on measurements shown on different datasets, we demonstrate that RAG-based constructions are more efficient than models produced with FN. We point out that connecting RAG and FN is not trivial, because connecting FN models with RAG can cause a decrease in performance. Furthermore, we outline a simple RAG-based architecture which, on average, outperforms the FN models by 16% in terms of the ROGUE score, 15% in the case of the BLEU score, and 53% based on the cosine similarity. This shows the significant advantage of RAG over FN in terms of hallucination, which is not offset by the fact that the average 8% better METEOR score of FN models indicates greater creativity compared to RAG.
Motivation & Objective
- To evaluate and compare the performance of Retrieval-Augmented Generation (RAG) and fine-tuning (FN) in developing domain-specific, knowledge-based AI systems.
- To assess the impact of combining RAG with fine-tuned models, given that both techniques are commonly used in practice.
- To measure the trade-offs between hallucination reduction and linguistic creativity in RAG versus FN approaches.
- To determine the optimal configuration of RAG, including vector search thresholds and embedding-based retrieval on domain-specific datasets.
Proposed method
- Retrieval-Augmented Generation (RAG) was implemented using vector-embedded sentence retrieval from indexed databases ($ID_s$ and $ID_q$) to inject relevant context into the LLM’s input prompt.
- Fine-tuning (FN) was applied to GPT-J-6B, OPT-6.7B, LLaMA-7B, and LLaMA-2-7B models using domain-specific datasets ($Q ext{ extbackslash}&A_{CORN}$, $Q ext{ extbackslash}A_{UB}$, $Q ext{ extbackslash}A_{COVID}$) over five training epochs.
- Performance was evaluated using standard NLP metrics: ROUGE, BLEU, METEOR, and cosine similarity (CS) on a held-out test set.
- The RAG system used a semantic search engine with vector embeddings, and the threshold for retrieved passages was tuned across values from 0.0 to 1.0 in 0.1 increments.
- Baseline performance was measured using the LLaMA-2-7B base model without RAG or FN to establish a reference point.
- The best-performing RAG configuration used the LLaMA-2-7B base model with the $ID_s$ dataset and a threshold of 0.5, achieving optimal balance between relevance and recall.

Experimental results
Research questions
- RQ1Does RAG outperform fine-tuning in terms of factual consistency and knowledge retrieval accuracy in domain-specific knowledge systems?
- RQ2What is the impact of combining fine-tuned models with RAG on overall performance, and does it lead to performance gains?
- RQ3How do RAG and FN compare in reducing hallucination, as measured by cosine similarity to ground-truth responses?
- RQ4What is the optimal retrieval threshold for RAG when using different LLMs and domain-specific datasets?
Key findings
- RAG-based systems outperformed fine-tuned models by 16% in ROUGE score, 15% in BLEU score, and 53% in cosine similarity, indicating superior factual consistency and reduced hallucination.
- The best-performing RAG configuration used the LLaMA-2-7B base model with the $ID_s$ dataset, achieving a ROUGE score of 0.3, BLEU of 0.063, METEOR of 0.22, and cosine similarity of 0.57.
- Fine-tuned models achieved a higher METEOR score (0.242 vs. 0.222), suggesting greater linguistic fluency or creativity, but at the cost of significantly higher hallucination.
- Combining fine-tuned models with RAG did not improve performance; in fact, the best threshold for the fine-tuned model in RAG was 1.0, indicating that retrieved context was largely rejected.
- The baseline LLaMA-2-7B model without RAG or FN achieved a ROUGE score of 0.142, which was outperformed by all RAG and FN variants.
- Cosine similarity showed that RAG-based systems were significantly more aligned with ground-truth responses (0.545) than fine-tuned models (0.356), confirming RAG’s advantage in factual accuracy.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.