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 generative models, RAG significantly enhances the accuracy and reliability of AI outputs. Attendees will learn about the principles of RAG, its implementation strategies, and practical applications, gaining insights on how to effectively reduce hallucinations in their own GenAI applications.
Report
Share
Report
Share
1 of 19
More Related Content
Applying Retrieval-Augmented Generation (RAG) to Combat Hallucinations in GenAI
1. 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
2. 850+ team members
Offices across Australia and New Zealand
Voted Best Place to Work in 2021 and 2022
Operating at over 150 clients
3. Changing how the world works for the better.
Agenda
● GenAI Beyond the Buzz
● Customizing Foundation Models
● What is RAG
● The complicated workflow
● Amazon Bedrock to the Rescue
● Demo
5. Changing how the world works for the better.
GenAI Beyond the Buzz
6. Changing how the world works for the better.
Why Customize
GPT = Generative Pre-trained Transformers,
Model doesn't know your domain
7. Changing how the world works for the better.
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
8. Changing how the world works for the better.
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
9. Changing how the world works for the better.
Customization Effort
10. Changing how the world works for the better.
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
11. Changing how the world works for the better.
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
12. Changing how the world works for the better.
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.
13. Changing how the world works for the better.
What are Embeddings
14. Changing how the world works for the better.
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 !!!!!!