Home Artificial Intelligence Augmenting LLMs with RAG

Augmenting LLMs with RAG

2
Augmenting LLMs with RAG

An End to End Example Of Seeing How Well An LLM Model Can Answer Amazon SageMaker Related Questions

Image from Unsplash

I’ve written quite a couple of blogs on Medium around different technical topics, and more heavily around Machine Learning (ML) Model Hosting on Amazon SageMaker. I’ve also these days developed an interest for the growing Generative AI/Large Language Model ecosystem (like everyone else within the industry lol).

These two different verticals led me to an interesting query. How good are my Medium articles at teaching Amazon SageMaker? To reply this I made a decision to implement a Generative AI solution that utilizes Retrieval Augmented Generation (RAG) with access to a few of my articles to see how well it could answer some SageMaker related questions.

In this text we’ll take a take a look at constructing an end to finish Generative AI solution and utilize a couple of different popular tools to operationalize this workflow:

  • LangChain: LangChain is a preferred Python framework that helps simplify Generative AI applications by providing ready made modules that help with Prompt Engineering, RAG implementation, and LLM workflow orchestration.
  • OpenAI: LangChain will deal with the orchestration of our Generative AI App, the brains nonetheless remains to be the model. On this case we use an OpenAI provided LLM, but LangChain also integrates with different model sources similar to SageMaker Endpoints, Cohere, etc.

NOTE: This text assumes an intermediate understanding of Python and a basic understanding of LangChain in specific. I might suggest following this text for understanding LangChain and constructing Generative AI applications higher.

DISCLAIMER: I’m a Machine Learning Architect at AWS and my opinions are my very own.

Large Language Models (LLMs) by themselves are incredibly powerful and might often answer many questions without assistance from fine-tuning or additional knowledge/context.

This nonetheless can turn into a bottleneck whenever you need access to other specific sources of knowledge and particularly recent data. For instance, while OpenAI has been trained on a big corpus of knowledge it doesn’t have knowledge of my recent…

2 COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here