English
Share
Sign In
🔍

Retrieval Augmented Generation (RAG): Enriching language models with external knowledge

Retrieval Augmented Generation (RAG) is a language model that uses external information such as the Internet or databases to answer complex questions. This model is especially useful for fact-checking or answering common sense questions. It is a field that has been receiving the most attention recently in December 2023. It is a method that came out while actively publishing papers on LLM, with the announcement of LLaMA2 in Meta.
How RAG works
Input processing: Receive questions or queries from the user.
Information retrieval: Find relevant information on the Internet or in databases such as Wikipedia.
Contextualization: Connect the information you find to your question.
Generate responses: Create accurate answers based on connected information.
Real-world examples
The RAG model finds recent papers or articles and generates answers based on their content.
The advantages of RAG are actually clear. It is a way to overcome the limitations of the language model called hallucination. Augmented Search Generation (RAG) is a major advancement in the field of language models and is very useful in a variety of knowledge-intensive fields. This technology, which can provide up-to-date and accurate answers by utilizing external information, is a powerful tool, especially in situations where fact-checking is important.
Factual consistency: Use up-to-date information to provide more accurate answers.
Adaptability: Generates answers to current situations without having to retrain the model as information changes.
Versatile Uses: Used in a variety of fields that require knowledge, such as question answering, fact checking, etc.
With the introduction of GPTs, we provide an interface that makes the RAG method easier to use. Representative examples include financial services, e-commerce, healthcare, and call center chatbots: RAG is used in these fields to retrieve customer data, generate product descriptions using up-to-date catalog information, provide patient record information, and provide personalized support.
Services in actual use
Azure Machine Learning : Enable RAG through Azure Cognitive Services studio and SDKs, and provide pre-built models like BART-RAG.
ChatGPT : OpenAI has released a retrieval plugin that adds relevant external knowledge to ChatGPT responses. It is currently in limited beta.
Anthropic's Constitutional AI : Provides evidence for generated responses using a trained search module. Focuses on transparency.
What if I apply RAG to Prompt?
Question Analysis: Analyze users' questions and identify keywords or concepts that match them.
Information Search: Use RAG's search function to find relevant knowledge or data. For example, you can find the latest research or statistics on a specific topic.
Create contextual prompts: Create prompts related to the question based on the information retrieved. This includes the information retrieved to provide a more contextual and factual answer to the user's question.
Generate response: Feed prepared prompts to the language model, and it generates answers based on the information retrieved.
Example
"최근에 발견된 외계 행성에 대해 설명해주세요."
1.
Information Search: The RAG system searches the latest research papers, news articles, Wikipedia pages, etc. about "recently discovered exoplanets."
2.
Create contextual prompts: Create prompts based on the information retrieved. For example, you could create a prompt that says, “What are the characteristics of the recently discovered exoplanet TRAPPIST-1, and why is this a significant discovery?”
3.
Generate response: Feed this prompt to a language model to generate an answer that provides a detailed description of TRAPPIST-1 and its significance.
📖
🎨
ⓒ 2023. Haebom, all rights reserved.
It may be used for commercial purposes with permission from the copyright holder, provided the source is cited.