Skip to content

AI Spy #1: RAG

Published: at 06:30 PM

A pixelated cow in a wrestling match. I think

If you’ve seen “RAG” thrown around and thought “I’d like to know what that is” then boy do I have good news for you. In the first of a new series, I’m diving into The Big Book Of AI Glossary Terms to do some little explainers so we can navigate this world together.

What’s a RAG?

Retrieval Augmented Generation (RAG) is a technology that not only answers your questions but does so with accuracy and a touch of creativity. RAG is a technology that significantly improves the accuracy and relevance of AI-generated responses.

After receiving a query or prompt (eg. a question you want to be answered), the retrieval part of RAG searches for relevant information in a large dataset. That information is then passed to the generative model. Said model then produces a detailed, informed response with contextually appropriate answers, distinguishing it from search engines that primarily display extracted information.

Where It’s Used

If you’re looking for reliable information from an AI chatbot, RAG is likely your go-to solution.

Educational software, for example, generates custom study materials and provides detailed explanations to complex questions by pulling information from textbooks, research papers, and educational resources. Quizlet is an example of educational software that utilizes RAG to generate personalized study materials and practice quizzes for students.

Customer support automation is another area seeing use, with the Zendesk app using it to sift through support documents and past tickets to help provide more accurate responses to customer inquiries.

You’ll also find it used for search engines, research assistance, and content recommendations. Netflix and Spotify incorporate similar principles of retrieving and utilizing large datasets to personalise a user’s experience.

RAGnificent Responses

LLMs (Large Language Models) are trained to respond, not to admit ignorance, so they’ll often hallucinate due to a lack of relevant context, either because they can’t locate the necessary data or aren’t sure which data to reference for a particular question. RAG addresses this issue by incorporating additional knowledge or content into interactions with an LLM, which results in more accurate and factual answers.

Just bear in mind, however, that if the dataset used for retrieval is incomplete, biased, or contains inaccuracies, it can result in skewed or incorrect responses.

Increased Flexibility = Happier Devs

Using RAG allows for efficient updates to datasets. There’s no need to completely retrain the entire model; just refresh the dataset to keep the knowledge base current. RAG’s flexibility allows developers to customize their applications for different industries and use cases. The ability to update the dataset in real time ensures that RAG remains responsive to evolving information, maintaining its flexibility and adaptability over time.

It’s Not All Roses

Ambiguous context or the need for additional external information means RAG is still going to struggle to generate accurate responses. Likewise, there could be a lack of transparency which makes it challenging to understand how specific responses are generated, making explainable responses in healthcare or legal domains particularly a bit of a minefield, and leaving the user with trust issues. COVID-19 misinformation, anyone?

And don’t even mention the beefy computational costs, hefty training data requirements, and the potential latency issues that come with the time-consuming nature of the retrieval and generation processes. If you’ve used ChatGPT at peak times, you know what I mean.

RAGs All, Folks

RAG technology has revolutionized the way AI systems generate responses, making them more accurate, informative, and contextually appropriate. Its applications span a wide range of industries, from education and customer support to content recommendation and research assistance. While RAG still faces challenges such as ambiguous context and computational costs, its flexibility and adaptability make it a promising technology with the potential to transform the way we interact with AI systems in the future.

(( one more thing ))

I am still exploring diagram tools in order to make future articles more visually appealing, so for now please just enjoy the ‘tipped’ cow picture. I have many, many, MANY more.