𝐑𝐀𝐆 𝐅𝐫𝐨𝐦 𝐒𝐜𝐫𝐚𝐭𝐜𝐡

𝐑𝐀𝐆 𝐅𝐫𝐨𝐦 𝐒𝐜𝐫𝐚𝐭𝐜𝐡

𝐖𝐡𝐚𝐭 𝐢𝐬 𝐑𝐀𝐆?

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