Applying Retrieval-Augmented Generation (RAG) to Combat Hallucinations in GenAI

ssuserd4e0d2 158 views 19 slides Jul 04, 2024
Slide 1
Slide 1 of 19
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19

About This Presentation

phenomenon of "hallucinations," where models generate plausible-sounding but incorrect or nonsensical information. This presentation delves into the innovative technique of Retrieval-Augmented Generation (RAG) as a solution to this problem. By integrating retrieval mechanisms with generati...


Slide Content

Applying Retrieval-Augmented Generation (RAG) to Combat Hallucinations in GenAI Auckland AWS User Group - July 2024 Geethika Guruge Lead Consultant @ Mantel Group AWS Ambassador | AWS Community Builder

Agenda GenAI Beyond the Buzz Customizing Foundation Models What is RAG The complicated workflow Amazon Bedrock to the Rescue Demo

Remember this???

GenAI Beyond the Buzz

Why Customize GPT = Generative Pre-trained Transformers, Model doesn't know your domain

Why Customize Adapt to domain specific language Health care terminology Medical devices Enhance Performance Teach the model about the specialised tasks your organization does Improve context awareness in responses Provide the model with external data Company intranet Your code base

Customization Options Prompt Engineering ( Craft and Iterate upon the input) Priming Weigiting Chaining RAG Leveraging external knowledge sources NOT changing anything in the foundation model Fine-tune Adapt a foundation model on a specialized task set Training the foundation model on labeled examples of tasks Specifying the expected output and outcome Re-train

Customization Effort

When to Customize

What is RAG Retrieval Fetches the relevant content from the external knowledge base Argumentation Argument the retrieved context to the user prompt Generation Response from the foundation model based on the augmented prompt

Types of Retrieval Rule based Unstructured data Keyword searches Structured data Retrieval from a database i.e Select cases where resolution like reboot Semantic search Get relevant documents based on text embedding

What are Embeddings Numerical representation of text (vectors) Captures semantics and relationships between words. Embedding models capture features and nuances of the text. Rich embeddings can be used to compare text similarity. Multilingual Text Embeddings can identify meaning in different languages.

What are Embeddings

Importance of Embedding in RAG Powers text retrieval based on semantic meaning. Used to augment prompts with more accurate context from vector stores High-accuracy embeddings leads to improved context and higher quality responses Less Hallucinations !!!!!!

RAG in Action

Knowledge Bases for Amazon Bedrock

Retrieval and Generate

RetrieveAndGenerate API

Demo Time!!!!!
Tags