As we’re getting more used to Large Language Models (LLMs) and their applications, we’re also starting to see the gaps in the accuracy and reliability of the responses that we get from these models. LLMs can start hallucinating, which means that they provide a response that might seem accurate at first glance, but isn’t. One of the reasons why a LLM can hallucinate is because it’s unable to verify information from external sources. The LLM solely relies on training data, without access to real-time, up to data content or databases.
Retrieval-Augmented Generation addresses the problem of unreliable or inaccurate data by enhancing generative AI models to incorporate external data sources. After a user has prompted the LLM, the LLM gets an instruction to retrieve relevant content. This means that the LLM will look up a reputable data source, which can be open (e.g. Internet data) or closed (e.g. internal knowledge database). The LLM will link the information found to the user’s query and provide context about why the response is accurate.

Main learning point: When I hear about the art of creating and fine tuning LLMs, I think about the added aspect of RAG. Including information retrieval from predefined data sources is is another aspect to consider when improving LLM reliability and accuracy.
Related links for further learning:
- https://medium.com/@asheshnathmishra/hallucination-in-large-language-models-2023-f7b4e77855ae
- https://blogs.nvidia.com/blog/what-is-retrieval-augmented-generation/
- https://research.ibm.com/blog/retrieval-augmented-generation-RAG
- https://aws.amazon.com/what-is/retrieval-augmented-generation/
- https://ai.meta.com/blog/retrieval-augmented-generation-streamlining-the-creation-of-intelligent-natural-language-processing-models/
- https://www.smashingmagazine.com/2024/01/guide-retrieval-augmented-generation-language-models/


5 responses to “What is Retrieval-Augmented Generation (RAG)?”
[…] of specific topics to work). You add the files to train Salesforce’s data model on, using RAG to make sure the agent retrieves the right […]
[…] Source […]
[…] I recently did an agentic AI course in which I learned how to create agents and connect them in a workflow. The need for solid data was one of the things that this course reinforced, with a strong focus on knowledge bases and Retrieval-Augmented Generation (RAG). […]
[…] (Retrieval-Augmented Generation) – RAG improves generative AI by retrieving relevant external data from open sources (like the internet) […]
[…] (source) […]