๐‘๐€๐† ๐…๐ซ๐จ๐ฆ ๐’๐œ๐ซ๐š๐ญ๐œ๐ก

๐‘๐€๐† ๐…๐ซ๐จ๐ฆ ๐’๐œ๐ซ๐š๐ญ๐œ๐ก

๐–๐ก๐š๐ญ ๐ข๐ฌ ๐‘๐€๐†?

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