Skip to main content
QUICK REVIEW

[Paper Review] Fine-Tuning or Retrieval? Comparing Knowledge Injection in LLMs

Oded Ovadia, Menachem Brief|arXiv (Cornell University)|Dec 10, 2023
Topic ModelingComputer Science25 citations
TL;DR

The paper compares unsupervised fine-tuning and retrieval-augmented generation (RAG) for injecting knowledge into LLMs and finds RAG consistently outperforms fine-tuning, including on unseen knowledge.

ABSTRACT

Large language models (LLMs) encapsulate a vast amount of factual information within their pre-trained weights, as evidenced by their ability to answer diverse questions across different domains. However, this knowledge is inherently limited, relying heavily on the characteristics of the training data. Consequently, using external datasets to incorporate new information or refine the capabilities of LLMs on previously seen information poses a significant challenge. In this study, we compare two common approaches: unsupervised fine-tuning and retrieval-augmented generation (RAG). We evaluate both approaches on a variety of knowledge-intensive tasks across different topics. Our findings reveal that while unsupervised fine-tuning offers some improvement, RAG consistently outperforms it, both for existing knowledge encountered during training and entirely new knowledge. Moreover, we find that LLMs struggle to learn new factual information through unsupervised fine-tuning, and that exposing them to numerous variations of the same fact during training could alleviate this problem.

Motivation & Objective

  • Assess how well knowledge can be injected into pre-trained LLMs for knowledge-intensive tasks.
  • Compare unsupervised fine-tuning and retrieval-augmented generation (RAG) as knowledge-injection methods.
  • Evaluate performance on both previously seen and novel knowledge scenarios.
  • Investigate the impact of data augmentation (paraphrases) on learning new facts.
  • Provide guidance on which approach is more reliable for knowledge injection in practice.

Proposed method

  • Define a knowledge-injection framework using a question-answering (Q&A) lens and a knowledge base B_Q.
  • Compare two transformation F applied to a pre-trained model M and base knowledge: fine-tuning (FT) and retrieval-augmented generation (RAG).
  • Implement unsupervised fine-tuning (continual pre-training) with lower learning rates to inject knowledge.
  • Employ RAG with a pre-trained embedding model (faiss-based vector store) to retrieve top-K documents from B_Q and augment the input query.
  • Create auxiliary knowledge bases from Wikipedia per topic, with QA datasets and paraphrase-based augmentations for robustness.
  • Evaluate using the LM-Evaluation-Harness framework on MMLU subjects and a current-events dataset, with 0-shot and 5-shot settings.
Figure 1 : A visualization of the knowledge injection framework.
Figure 1 : A visualization of the knowledge injection framework.

Experimental results

Research questions

  • RQ1Is RAG superior to unsupervised fine-tuning for injecting knowledge into LLMs across knowledge-intensive tasks?
  • RQ2Can unsupervised fine-tuning learn new factual information effectively, or is RAG more reliable for both known and novel facts?
  • RQ3Does data augmentation via paraphrasing improve the ability to learn and recall new knowledge through fine-tuning?
  • RQ4How do 0-shot versus 5-shot settings affect knowledge injection performance for FT and RAG?

Key findings

  • RAG consistently outperforms base models and often outperforms unsupervised fine-tuning across MMLU tasks and current events.
  • Fine-tuning provides improvements over the base model but is not competitive with RAG, and combining FT with RAG can be unstable.
  • Paraphrase-based data augmentation yields monotonic improvements in current-events performance and supports learning new information through repetition.
  • Learning new information via fine-tuning benefits from multiple paraphrase variations, suggesting repetition across formats helps knowledge acquisition.
  • Current-events results show RAG is particularly effective when the auxiliary dataset aligns closely with the questions.
Figure 2 : The relative accuracy gain (as explained in Equation 5 ) for each knowledge-injection method, averaged (columnwise) across all experiments in Table 1 .
Figure 2 : The relative accuracy gain (as explained in Equation 5 ) for each knowledge-injection method, averaged (columnwise) across all experiments in Table 1 .

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.