๐๐๐ ๐ ๐ซ๐จ๐ฆ ๐๐๐ซ๐๐ญ๐๐ก
๐๐๐ ๐ ๐ซ๐จ๐ฆ ๐๐๐ซ๐๐ญ๐๐ก
๐๐ก๐๐ญ ๐ข๐ฌ ๐๐๐?
RAG stands for Retrieval-Augmented Generation. RAG technique empowers LLMs to incorporate information from external sources which makes them more accurate and suitable for tasks that require factual and current knowledge.
๐๐๐ ๐๐ข๐ฆ๐ข๐ญ๐๐ญ๐ข๐จ๐ง๐ฌ
๐๐ญ๐๐ญ๐ข๐ ๐๐ง๐จ๐ฐ๐ฅ๐๐๐ ๐ - LLMs are trained on large volumes of text data, but this knowledge is "frozen" at the time of training.
๐๐๐ฅ๐ฅ๐ฎ๐๐ข๐ง๐๐ญ๐ข๐จ๐ง๐ฌ - Sometimes, LLMs generate responses which are factually incorrect or misleading.
๐๐จ๐ฐ ๐๐๐ ๐๐๐ฅ๐ฉ๐ฌ?
RAG addresses the above two LLM limitations by using two key components:
๐๐๐ญ๐ซ๐ข๐๐ฏ๐๐ซ- For the given prompt, the retriever scans the knowledge base (like documents, Wikipedia, databases, etc.) to choose the most relevant pieces of information.
๐๐๐ง๐๐ซ๐๐ญ๐จ๐ซ - The generator model (an LLM) is fed with the original input and the relevant information retrieved. This lets the LLM create a response that's both fluent and draws on the up-to-date knowledge found by the retriever.
Roadmap to RAG:
RAG From Scratch: Part 1 (Overview)
RAG From Scratch: Part 2 (Indexing)
RAG From Scratch: Part 3 (Retrieval)
RAG From Scratch: Part 4 (Generation)
RAG from scratch: Part 5 (Query Translation -- Multi Query)
RAG from scratch: Part 6 (Query Translation -- RAG Fusion)
RAG from scratch: Part 7 (Query Translation -- Decomposition)
RAG from scratch: Part 8 (Query Translation -- Step Back)
RAG from scratch: Part 9 (Query Translation -- HyDE)
RAG from scratch playlist (details in the comments)
Last updated