GAI Workshop L200 Budiling With GenAI On AWS ASEAN

Download as pdf or txt
Download as pdf or txt
You are on page 1of 87

AWS GENERATIVE AI WORKSHOP

Building with
Generative AI on AWS

Pedro Paez
Principal AI/ML Solutions Architect

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Time Duration Format Content

Generative AI – what is it, why is it so big right now,


1:00pm 40 min Intro
and how do you get started with it on AWS?
1:40pm 15 min Setup Sagemaker Jumpstart

Agenda 1:55pm
2:25pm
30 min
45 min
Demo
Lab 1
Stable Diffusion
Text2Image, Text2Image Fine-tuning
3:15pm 15 min Break Break
3:30pm 30 min Demo Large Language Models
4pm 45 min Lab 2 LLM on Sagemaker Jumpstart
4:45pm 45 min Demo RAG on AWS
5:30pm 15 min Wrap Discuss insights and next steps

© 2023, Amazon Web Services, Inc. or its affiliates. 2


Part 1 – What is Generative AI? Why is
it so important? How do I get started?

© 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates.
Generative AI is the fastest growing trend in AI
Developer adoption Consumer adoption
Stable Diffusion accumulated 40k stars ChatGPT reached the 1 million
on GitHub in its first 90 days users mark in just 5 days

40,000
Stable Diffusion ChatGPT Instagram Spotify
1M 5 days 75 days 150 days

500k
Ethereum
Bitcoin

Github
Stars Stylized path

400 800 1,200 1,600 2,000 2,400 2,800 3,200 0 25 50 75 100 125 150

Days since repository was started Days since launch

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 4
What is Generative AI?

AI that can Powered by


generate content foundation models
close enough to human created pre-trained on large sets of data with
content for real-world tasks several hundred billion parameters

Applicable to Tasks can be


many use cases customized for
like text summarization, question specific domains
answering, digital art creation, with minimal fine-tuning
code generation, etc.

New Volvo car concept design by midjourney


Credit: @sugardesign_1 Instagram

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 5
How foundation models work

Text generation

Summarization

Information extraction

Pretrain Adapt
Q&A

Chatbot

Unlabeled FM Broad range of


data general tasks

© 2022, Amazon Web Services, Inc. or its Affiliates. 6


Where is Generative AI having the most impact?

Creativity Search
New features and innovation! Improved access to
Expand customer base. organizational data

Chatbot/Virtual Assistant Productivity


Improved UX > Minimize human Automate labor intensive tasks.
intervention and reduce costs. Improve internal processes.
Reduce costs.

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 7
Enhance Creativity

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 8
Building on AWS

© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Enhance User Experience

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 11
Use case:
-----------
Conversational AI
(Voice/Text) as the app UI
for all sorts of
transactional B2C apps
(Travel, Ecom, Food,
Grocery)

Source: Expedia
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Enhance Search

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 13
Amazon innovates search with Generative AI

Amazon Search helps teams across Amazon bring


FMs to their applications, pre-trained FMs to improve
search results on Amazon.com Alexa Teacher Model excels other large
language models on few-shot tasks such as
summarization and machine translation.

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Enhance Productivity

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 15
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Code
CODE GENERATION, DOCUMENTATION, AUTOCOMPLETE, TESTING

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 17
Key use cases

Improve customer Automate code Search and


loyalty with development, test summarize
conversational scenarios, and SQL internal and
assistants and CC queries from natural external
intelligence language documents

Lex, Kendra, JS/Bedrock CW, JS/Bedrock Kendra, JS/Bedrock

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 18
Key use cases

Automate personalized Create personalized Automate draft


marketing campaigns wallpapers, avatars, and review of
and images legal,
compliance, and
HR documents

Personalize, JS/Bedrock JS/Bedrock JS/Bedrock

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 19
How to build with Foundation Models?

Build your own


foundation model from Access publicly Access proprietary
scratch available models models

Expensive, time Substantial No control over data,


Challenges undifferentiated work costs, and little
consuming and requires
deep expertise needed to operationalize customization support

20
Lessons from the field
§ OpenAI/ChatGPT are great consumer products and have won mindshare for PoCs

§ Customer journey : 1/Test on ChatGPT > 2/Define viable use cases > 3/Prod implementation
(Security? Latency? Costs? Data privacy?)

§ We don’t have a comparable solution for 1/ (Bedrock will be our solution). Need to lean on
demos and existing tech…
§ We can help with 2/ The main use cases are addressable with Code Whisperer (Code development),
AI Services + LLMs (RAG), OS models through HuggingFace/Jumpstart.

§ One model does NOT rule them all for prod implementation. Customers have reservations of third
party APIs, data and IP control, cost and latency. AWS has an answer for this!

§ Winning trend: Orchestration (Langchain) + Tech Stack (AI Services, Databases, APIs) + smaller OS
models (or bigger models)
21
Why AWS for Generative AI?

EXPERIENCE FLEXIBILITY TRUST VIABILITY

AWS and Amazon bring Choose a base FM and Data protection for FM Manage infrastructure to
20+ years of AI and ML customize it securely consumer, IP protection ensure optimal
experience and quickly to build for FM provider performance and cost
differentiated apps
100,000+ customers Adapt FMs using your The most cost-efficient,
running ML on AWS Choice of fully-managed organization’s data, high-performance
or self-managed extend FMs to deliver training and inference
Integrate FMs with our deployment for 1P, 3P high confidence
entire ecosystem and OS
Comprehensive AWS
security capabilities

22
The AWS AI/ML Stack
Generative SCALING GENERATIVE AI AMAZON BUILT FOUNDATIONAL MODEL
AI Amazon Bedrock Amazon Titan
Consumer

BUSINESS PROCESSES SEARCH CONVERSATION CODE + DEVOPS INDUSTRIAL HEALTH


Amazon Personalize Amazon Kendra Amazon Lex Amazon CodeGuru Amazon Monitron Amazon HealthLake
AI Specialized
Amazon Forecast Contact Lens Amazon CodeWhisperer Amazon Lookout for Equipment Amazon Comprehend Medical
SERVICES AI Services
Amazon Fraud Detector Voice ID Amazon DevOps Guru Amazon Lookout for Vision Amazon Transcribe Medical
Amazon Lookout for Metrics Amazon Transcribe Call Analytics Amazon Omics

TEXT SPEECH VISION


Core Amazon Translate Amazon Comprehend Amazon Polly Amazon Transcribe Amazon Textract Amazon Rekognition AWS
Panorama

STUDIO IDE
Tuner

JUMPSTART CANVAS STUDIO LAB GROUND TRUTH Prepare data Geospatial ML Build with Train models Deploy in production
AMAZON
Use pre-built models No-code ML for Learn ML Label data notebooks
SAGEMAKER in SageMaker business analysts
Store features Tune parameters Manage and monitor

CI/CD | GOVERNANCE | RESPONSIBLE ML


Provider

ML FRAMEWORKS Habana
PyTorch, TensorFlow Amazon EC2 CPUs GPUs AWS Inferentia AWS Trainium FPGA
& INFRASTRUCTURE Gaudi

23
The AWS AI/ML Stack
Generative SCALING GENERATIVE AI AMAZON BUILT FOUNDATIONAL MODEL
AI Amazon Bedrock NE W Amazon Titan NE W
Consumer

BUSINESS PROCESSES SEARCH CONVERSATION CODE + DEVOPS INDUSTRIAL HEALTH


Amazon Personalize Amazon Kendra Amazon Lex Amazon CodeGuru Amazon Monitron Amazon HealthLake
AI Specialized
Amazon Forecast Contact Lens NE W Amazon CodeWhisperer Amazon Lookout for Equipment Amazon Comprehend Medical
SERVICES AI Services
Amazon Fraud Detector Voice ID Amazon DevOps Guru Amazon Lookout for Vision Amazon Transcribe Medical
Amazon Lookout for Metrics Amazon Transcribe Call Analytics Amazon Omics

TEXT SPEECH VISION


Core Amazon Translate Amazon Comprehend Amazon Polly Amazon Transcribe Amazon Textract Amazon Rekognition AWS
Panorama

STUDIO IDE
Tuner

JUMPSTART NE W CANVAS STUDIO LAB GROUND TRUTH Prepare data Geospatial ML Build with Train models Deploy in production
AMAZON
Use pre-built models No-code ML for Learn ML Label data notebooks
SAGEMAKER in SageMaker business analysts
Store features Tune parameters Manage and monitor

CI/CD | GOVERNANCE | RESPONSIBLE ML


Provider

ML FRAMEWORKS Habana
PyTorch, TensorFlow Amazon EC2 CPUs GPUs NE W AWS Inferentia NE W AWS Trainium FPGA
& INFRASTRUCTURE Gaudi

24
Summary of AWS generative AI services and
infrastructure

Amazon CodeWhisperer Amazon Bedrock Amazon SageMaker Jumpstart

AWS Trainium AWS Inferentia2


Amazon CodeWhisperer: Now generally available and free to
use for individual developers!

Generate code Scan code for hard-to- Flag code that resembles
suggestions in real-time find vulnerabilities open-source training
data or filter by default

During preview Amazon ran a productivity challenge, and participants who used
Amazon CodeWhisperer were 27% more likely to complete tasks successfully and did
so an average of 57% faster than those who did not use CodeWhisperer.
26
Amazon Bedrock

Accelerate Choose FMs from Privately customize Enhance your data Use AWS tools and
development of AI21 Labs, Anthropic, FMs using your protection using capabilities that you
generative AI Stability AI, and organization’s data comprehensive AWS are familiar with to
applications using Amazon to find the security capabilities deploy scalable,
FMs through an API, right FM for your use reliable, and secure
without managing case generative AI
infrastructure applications

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 27
Bedrock supports a wide range of foundation models

FMs from Amazon FMs from AI21 Labs, Anthropic, and Stability AI

Titan Text Titan Jurassic-2 Claude Stable


Embeddings Diffusion

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 28
Foundation models available on SageMaker JumpStart
for self-managed access
Publicly available Proprietary models

Models Models Models Models Models Models


Text2Image AlexaTM Flan T-5 models Cohere Lyra-Fr Jurassic-1
Upscaling 20B (8 variants) generate-med 10B Grande 17B
DistilGPT2, GPT2
Tasks Bloom models Tasks Tasks Tasks
Tasks (3 variants)
Machine Text generation Text generation Text generation
Generate translation
photo-realistic Information Keyword Long-form
images from Question Tasks extraction extraction generation
text input answering Machine Question Information Summarization
Improve quality Summarization translation answering extraction Paraphrasing
of generated Annotation Question Summarization Question
images Chat
Data generation answering answering
Information
Summarization Summarization extraction
Features Annotation Sentiment
analysis Question
Fine-tuning on Data generation answering
SD 2.1 model Classification Classification

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 29
29
3 ways to use foundation models with SageMaker
JumpStart

SageMaker Studio SageMaker AWS Management


One-step deploy Notebooks Console Preview

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon Bedrock vs Amazon SageMaker Jumpstart (as
of today)
Amazon Bedrock Amazon SageMaker Jumpstart:
• The easiest path to use GenAI models, • “GenAI Hub” for many external
LLMs, including fine-tuning or directly proprietary and opensource (i.e.
using APIs for production. HuggingFace) LLM builders.

• Serverless (fully managed) • Full control over models/artifacts and


deployable in your own account with all
• You can select multiple LLMs, from a Sagemaker features.
select cohort of FM providers including
Amazon’s Titan. • Available today

• In preview

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 31
Purpose-built accelerators for generative AI

AWS Inferentia AWS Trainium AWS Inferentia2

Lowest cost per inference The most cost-efficient, high- High performance at the
in the cloud for running performance training of lowest cost per inference for
deep learning (DL) models LLMs and diffusion models LLMs and diffusion models

Up to 70% lower Up to 50% savings Up to 40% better


cost per inference on training costs price performance
than comparable over comparable than comparable
Amazon EC2 instances Amazon EC2 instances Amazon EC2 instances

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 32
Generative AI - Key Considerations

Hallucination
RISKS Opaque
Compliance & Legal
Potential for Misuse
Static Knowledge
Compute

Emergence
Domain Adaptation
Accessibility
Innovative Ecosystem
BENEFITS

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 33
RAG : control for hallucination and static knowledge

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Content moderation: control for toxicity

Rekognition
Content Moderation

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Data privacy/security

Data Privacy Data Sovereignty Model Control

Will my request/prompt Will my data be used to Can I have control of


data be exposed to model retrain the model? Risk of where my model/data is
providers? data leaks? deployed and what
security controls I want in
place?

© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 36
AWS GENERATIVE AI WORKSHOP

SageMaker Studio Setup


us-east-1

git clone
https://github.com/ljunkai/sagemaker-jumpstart-generative-
ai-examples

© 2022, Amazon
© 2023, Web
Amazon Web Services,
Services, Inc. or its Affiliates.
Inc. or its affiliates.
Stable Diffusion

Arun Surendran
Solutions Architect

© 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates.
Rise of large-scale models and recent improvements
“a picture of a very clean living room”

2017 2022
StackGAN, Stable Diffusion,
Zhang et al. Rombach et al.
© 2022, Amazon Web Services, Inc. or its Affiliates.
Stable Diffusion
T H E F I R S T F O U N D AT I O N M O D E L T O G O G L O B A L

Floral Wolf Color Splashes Cat Knight


Stable Diffusion 2.0
C L E A N E R D ATA S E T, B E T T E R Q U A L I T Y, L E S S B I A S , A N D F A S T E R
Stable Diffusion 2.0
APPROACHING PHOTOREALISM
Stable Diffusion 2.0
UNLIMITED CONTENT
Stable Diffusion 2.0
U N L I M I T E D C R E AT I V I T Y
Customized Stable Diffusion 2.0
T R A I N TO YO U R OW N ST Y L E
Stable Diffusion 2.0 Depth to Image
T R A N S F O R M I M A G E S D Y N A M I C A L LY
Stable Diffusion 2.0 Depth to Image
T R A N S F O R M I M A G E S D Y N A M I C A L LY
Stable Diffusion 2.0 Inpainting
C H A N G E I M A G E D E TA I L S
Stable Diffusion 2.0 Upscaler
Our communities
DEVELOPER COMMUNITIES BUILDING THE FUTURE OF AI

OpenBioML CarperAI DeepFloyd

LAION eleutherai Harmonai


DeepFloyd

© 2022, Amazon Web Services, Inc. or its Affiliates.


Stability AI builds foundation models on SageMaker
S TA B L E D I F F U S I O N R U N S O N S A G E M A K E R

“AWS has been an integral partner in scaling


our open-source foundation models across
modalities, and we are delighted to bring
these to SageMaker to enable tens of
thousands of developers and millions of users
to take advantage of them. “

-Emad Mostaque, Founder and CEO of


Stability AI.

Reduced training time and cost by 58% on SageMaker

52
Distilled Stable Diffusion
FA S T E R , C H E A P E R , B E T T E R

Time to generate an image Steps to generate an image

Seconds Seconds Steps Steps


54

pencil sketch
“data scientist” Van Gogh style Mona Lisa

“Kristine”
Sample original portrait images
(15 -18 images total) Wonder Woman Pixar character pencil sketch
“nature explorer”

© 2022, Amazon Web Services, Inc. or its Affiliates.


Lab

© 2022,
2023, Amazon Web Services, Inc. or its affiliates. 55
Generative AI is transforming businesses
TEXT GENERATION, TEXT SUMMARIZATION, EXTRACTION, CLASSIFICATION

co:here’s real estate listing generator AI21 Labs’ wordtune read AI21 Labs’ wordtune

56
Foundation models available on SageMaker JumpStart
for self-managed access (not exhaustive)
Publicly available Proprietary models

Models Models Models Models Models Models


Text2Image AlexaTM Flan UL2, T-5XXL Cohere Command Lyra-Fr Jurassic 2 Jumbo
Upscaling 20B models XL and med 10B and Grande
GPT-Neo, GPT-J, Cohere Jurassic-1
Tasks DistilGPT2, GPT2 generate-med Tasks
Tasks
Machine Bloom and Text generation Tasks
Generate translation BloomZ Tasks
photo-realistic Keyword Text generation
images from Question Text generation extraction
Tasks Long-form
text input answering Information Information generation
Improve quality Summarization Machine extraction extraction Summarization
of generated Annotation translation Question Question
images Paraphrasing
Question answering answering
Data generation Chat
answering Summarization Summarization
Features Summarization Sentiment
Information
Annotation analysis extraction
Fine-tuning on
SD 2.1 model Q&A
Data generation Classification
Classification

57
Prompt Engineering for
LLMS

Bryan Tan
Solutions Architect

© 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates. 58
What is Prompting?
§ Language models like GPT require tweaking the input, or
"prompt," to achieve the desired output called the
“completion”.
§ Slight changes to the prompt can significantly impact the
output.
§ It takes trial and error, as well as artistic flair, to arrive at the
correct output.
§ Language models do not always behave predictably.
§ Prompts must be tailored to the task at hand.
§ The effectiveness of a prompt is determined by how the
model was trained.
§ Newer models can better understand less structured prompts
and those in natural language or dialogue formats.
§ The prompt is the interface to the model, and knowing how
to craft it effectively is crucial.
© 2023, Amazon Web Services, Inc. or its affiliates. 59
Prompt Engineering Examples
Cohere generate - Jurassic Grande AlexaTM
FLAN Stable Diffusion Medium (AI21)

Summarization: Generate Images Generate: Rephrasing: Summarization:


* Briefly Summarize this from text * Write a social media post * The following * Article: {test_article} è
sentence: {text} * A Rembrandt style about starting a career in sentences contain Short summary:
* Write a short summary for painting of Eiffel tower Tech business jargon. Rewrite
this text: {text} on a beach them using simple
* Generate a short summary * Character Design: * Write a blog outline for a words: {Jargon}
of this summary: {text} robot warrior, diverse blog titled “ How
medical cybersuit transformers made Large
Language models possible Text Generation:
* Food image: Croissant * {CLM} {train_inp}
QnA on a yellow plat * Write a cold outreach email Explaining context: {test_input} è sentence
* Answer based on introducing me as Susan, a * What does “link” describing the place
context:\n\n{context}\n\n{q Business Development meanin following
uestion} Manger, to Julia, a Product sentence?
* {context}\n\nAnswer this Manager as AWS asking if
Sentence: The excavation
question based on the they’d be interested about a machine malfunctioned
article: {question} product integration with dues to a broken link.
Images generation Kendra
after finetuning on [Output]: a ring or loop
custom dataset in a chain
* Write a creative product
Sentence/Sentiment * A picture of my dog on description for a wireless
Classification ferris wheel headphone named CO-1T
* Review:\n{sentence}\nIs this * A photo of my family with keywords “Bluetooth”,
movie review sentence in Machhu Pichhu “wireless”, “fast charging” for One sentence
negative or a software developer who description
positive?\n{options_} works in a noisy office. * Write one sentence
* Is the sentiment of the description for product
following sentence positive or based on following list of
negative?\n{sentence}\n{opti features:
ons_} {Product}: XX
{features}: xx,xx,xx
Prompt Engineering Types

Prompting by Instruction * Prompting by Exemplars*

61

* Image courtesy: Cohere.ai


Anatomy of a Prompt

© 2023, Amazon Web Services, Inc. or its affiliates. 62


Prompt Engineering: Translating text to SQL

63
In-context Learning

© 2023, Amazon Web Services, Inc. or its affiliates. 64


Prompt Engineering
Anatomy of a Prompt*

65

* Image courtesy: Cohere.ai


Chain-of-thought (CoT) Prompting
§ Improves reasoning abilities in foundation models

§ Addresses multi-step problem-solving challenges in arithmetic


and commonsense reasoning task

§ Generates intermediate reasoning steps, mimicking human


train of thought, before providing the final answer.

§ Enhances model performance on average compared to standard


methods.

§ Works better with larger models (>100B) and can be fine-tuned


on CoT reasoning datasets for better interpretability.

§ FLAN-T5 series models in our model hub are trained for CoT
reasoning. [Demo]

© 2023, Amazon Web Services, Inc. or its affiliates. 66


Learning and Fine-
Tuning Strategies

Fahim Surani
Solutions Architect

© 2023, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates. 67
Language Model (LM): Predicting Next Token
Of Robot may a robot may not injure a
human being
A Country would

That Nation can

prompt So Human ought

Recite the first law … … … …

Apple A A

The Of Of

Law The The

first first robot

© 2023, Amazon Web Services, Inc. or its affiliates. 68


Instruct Learning

© 2023, Amazon Web Services, Inc. or its affiliates. 69


Learning Paradigms

© 2023, Amazon Web Services, Inc. or its affiliates. 70


Knowledge Augmentation

© 2022,
2023, Amazon Web Services, Inc. or its affiliates. 71
Domain Adaptation
On Roadmap

§ Process of tailoring a language model to a specific


industry, context, or application.
§ Enhanced Relevance: Ensures the model understands
and generates domain-specific language and concepts
§ Enterprise Applications: Critical for tasks like sentiment
analysis, document classification, and information
extraction in specialized fields.
§ Reducing Misinterpretations: Minimizes errors due to
unfamiliar terminology, jargon, or complex domain
knowledge.

© 2023, Amazon Web Services, Inc. or its affiliates. 72


Retrieval Augmented Generation (RAG) On Roadmap

§ RAG combines the power of pre-trained LLMs with information retrieval


- enabling more accurate and context-aware responses

§ Two step process:


1. Retrieve relevant information from a knowledge base using a
retriever
2. Generate a response based on retrieved information and input
query using a generator

§ Dynamic Knowledge Integration


o RAG allows models to access and integrate external knowledge
on-the-fly, enhancing their ability to provide precise answers.

© 2023, Amazon Web Services, Inc. or its affiliates. 73


Q&A without Context: Hallucination

Question: "Which instances can I use with Managed Spot Training in


SageMaker?”

Answer: "The Managed Spot Training is a subscriptions product


available for the following instances: Data Science Virtual Machine
(DSVM), DSVM High, and DSVM Low. "

© 2023, Amazon Web Services, Inc. or its affiliates. 74


Q&A with Context: Correct Answer
Context: “Managed Spot Training can be used with all instances
supported in Amazon SageMaker. Managed Spot Training is
supported in all AWS Regions where Amazon SageMaker is
currently available. “

Question: "Which instances can I use with Managed Spot Training in


SageMaker?”

Answer: ”All instances supported by SageMaker"

© 2023, Amazon Web Services, Inc. or its affiliates. 75


Given a Question, Fetch the Relevant Context

Knowledge Base Embeddings Embedding


Prompt
Document 1 [ …… ]

Document 2 Context
[ …… ]
Embedding Embedding
LLM LLM
Document 3 [ …… ] [ …… ] Question

Document 4 [ …… ]
Most Similar Match Q&A
LLM

Document n [ …… ] Answer

Vector Database

© 2023, Amazon Web Services, Inc. or its affiliates. 76


Limitations of LLMs

🤖
1. Poor Memory
2. One Task at a Time 77
Limitations of LLMs

Vector Databases Langchain

78
Vector Databases

79
Vector Databases

Dedicated Vector DBs Existing DBs Supporting Vectors

80
Langchain

❓ 💬 🤖
Question answering
Chatbots Agents
over specific Documents

81
Langchain

🤖 Agents

82
Langchain

🤖 Agents

83
RAG Demo

© 2022,
2023, Amazon Web Services, Inc. or its affiliates.
affiliates. 84
Next Steps

© 2023,
2022, Amazon Web Services, Inc. or its affiliates.
affiliates. 85
Continue Learning

• The labs are active for another 2 days

© 2023, Amazon Web Services, Inc. or its affiliates. 86


Reach out

• Speak to your Account Teams


• Brainstorm Ideas and use cases
• Find a partner for implementation
• Speak to your SA / Specialist
• Immersion Days

© 2023, Amazon Web Services, Inc. or its affiliates. 87


Thank you!
Pedro Paez
Arun Surendran
Bryan Tan
Fahim Surani

© 2022, Amazon Web Services, Inc. or its affiliates. © 2023, Amazon Web Services, Inc. or its affiliates.

You might also like