1. Utilizing encoding models to retrieve relevant docu-
ments based on questions, such as BM25, DPR, Col-
BERT, and similar approaches[Robertson et al., 2009,
Karpukhin et al., 2020, Khattab and Zaharia, 2020].

2. Generation Phase: Using the retrieved context as a con-

dition, the system generates text.

2.2 RAG vs Fine-tuning
In the optimization of Large Language Models (LLMs), in
addition to RAG, another important optimization technique
is fine-tuning.

RAG is akin to providing a textbook to the model, allow-
ing it to retrieve information based on specific queries. This
approach is suitable for scenarios where the model needs to
answer specific inquiries or address particular information re-
trieval tasks. However, RAG is not suitable for teaching the
model to understand broad domains or learn new languages,
formats, or styles.
Retrieval-AugmentedGenerationforLargeLanguageModels-ASurvey