Augmenting LLMs with RAG. An End to End Example Of Seeing How… | by Ram Vegiraju | Oct, 2023


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 few blogs on Medium around different technical topics, and more heavily around Machine Learning (ML) Model Hosting on Amazon SageMaker. I’ve also lately developed an interest for the growing Generative AI/Large Language Model ecosystem (like everyone else in the industry lol).

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

In this article we’ll take a look at building an end to end Generative AI solution and utilize a few different popular tools to operationalize this workflow:

  • LangChain: LangChain is a popular 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 take care of the orchestration of our Generative AI App, the brains however is still the model. In this case we use an OpenAI provided LLM, but LangChain also integrates with different model sources such as SageMaker Endpoints, Cohere, etc.

NOTE: This article assumes an intermediate understanding of Python and a basic understanding of LangChain in specific. I would suggest following this article for understanding LangChain and building Generative AI applications better.

DISCLAIMER: I am a Machine Learning Architect at AWS and my opinions are my own.

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

This however can become a bottleneck when you need access to other specific sources of data and especially recent data. For example, while OpenAI has been trained on a large corpus of data it does not have knowledge of my recent…



Source link

Be the first to comment

Leave a Reply

Your email address will not be published.


*