The world of AI is extremely fast moving. New models, new technologies and new jargons seem to crop up everyday.
This article seeks to explain what RAG - retrieval augmented generation - is in simple terms, why it is emerging as a game-changer, and provide a side by side comparison of RAG and ChatGPT in action, so readers can better understand the merits of both.
Without getting into too much technical details, LLMs like ChatGPT work by learning from millions and billions of data points within its training data, and outputting a response that it predicts as the most plausible based on its knowledge.
LLMs work extremely well on certain conditions: having been trained on a massive volume of written words, ChatGPT can produce high-quality writing in professional, business-appropriate tone, or Shakespearean prose if you prefer. ChatGPT can also ace tests on subjects that it has been trained on.
However, LLMs also have some glaring weaknesses: given they are trained on a static data set, they lack access to the latest, or private/ proprietary, facts and knowledge. They are also known to “hallucinate”, generating plausible responses that are not based on accurate information, or even outright fabricating facts.
Enters retrieval augmented generation (RAG). RAG is a relatively new technology that started entering discussions in the AI space around 2024. It combines the prowess of large language models (LLMs) with external knowledge sources to generate more accurate and contextual relevant responses.
It does so by adding a few more steps in its architecture:
In short, think of RAG as a helpful librarian who goes to find the most relevant information before generating a summary in their response.
In theory, RAG’s more nuanced approach brings a few key benefits:
Well, theory is theory. How does RAG and ChatGPT match up in action?
While there are many studies and literature out there that compares benchmark data between the two and confirm the benefits of RAG, we at Ragdoll AI decided to run a quick test for fun anyway. Here we go.
We asked both Ragdoll and ChatGPT to generate a blog article based on three inputs: target keywords, reader intent, and writing style.
The goal is to create a blog article that articulates the difference between LightRAG and GraphRAG - two advanced retrieval-augmented-generation techniques - in language that is easy to understand for a non-technical audience.
In the Ragdoll AI knowledge base, we have previously connected a few authoritative sources on GraphRAG and LightRAG, including this original research paper on LightRAG.
Here’s a snippet of the two articles produced:
In the ChatGPT version, it gave an elaborate introduction of a “cutting-edge, cloud-based data analytics platform” that utilizes “a blend of machine learning algorithms and data visualization techniques” to make complex data understandable.
It went on for 1200 words describing this “analytics platform”, but makes no mention whatsoever of the keyword, “retrieval-augmented-generation”.
In short - the ChatGPT version is a highly plausible article based on totally fabricated facts.
Meanwhile, the article produced by Ragdoll AI successfully retrieved the relevant definitions of LightRAG: an advanced RAG method with two primary features, graph-based indexing and dual-level retrieval framework. It even provided linked sources if you want to check out where it got the information from.
Our exercise once again demonstrated the advantage of RAG technology over a pure LLM workflow, showing how the combination of curated knowledge and LLM can truly unleash the maximum potential of generative AI in business applications.
Want to give RAG a try? Ragdoll AI provides an easy-to-use platform where you can simply upload or connect your data to create and chat with your private knowledge base in minutes.