AWS AI Certification - Demo

Overview

_images/aws_ai.png

AWS AI Demos

Initial Demo Script for AWS AI Certification
1AWS AI practioner
Amazon Bedrock Integration Script
  1GPT-4o is a foundational Model
  2
  31. Amazon Bedrock Foundational Models(FM)
  42. Amazon Bedrock Fine-Tuning Model
  53. Amazon Bedrock RAG & Knowledge Base
  64. Amazon Bedrock GuardRails
  75. Amazon Bedrock Agents
  86. Amazon Bedrock - cloudwatch integration
  9
 10Amazon AIStylist - https://aistylist.awsplayer.com/
 11
 12
 13Generative AI for images from text Diffusion Model(Stable Diffusion)
 14
 15
 16
 171. Amazon Bedrock Foundational Models(FM)
 18-------------------------------------------------
 19RAG, LLM Agents etc..
 20
 21
 22
 23Automated Metrics to Evaluate the Foundational Model(FM):
 24---------------------------------------------------------------------->
 25
 26ROUGE: Recall-Oriented Understudy for Gisting Evaluation   - this is for evaluating the summarization and machine translation systems.
 27   ROUGE-N  - Matching the number of n-grams between reference text and generated text.
 28   ROUGE-L  - Longest common subseuence between reference and generated text.
 29
 30BLEU: Bilingual Evaluation Understudy  -- Evaluate the quality of generated text, especially for translations.
 31
 32BERTScore: Bidirectional Encoder Representations from Transformers.....
 33        Evaluates the Semantic simialrity between generated text.
 34
 35  Uses BERTScore to compare the contextualized embeddings of both texts and computes the cosine similarity between them.
 36
 37Perplexity: How well the model predicts the next token(Lower is better)
 38
 39Business Metrics:
 40--------------------------------->
 41user satisifaction
 42Cross-domain performance
 43average revenue per user
 44
 45
 46Amazon Bedrock - RAG and Knowledge Base
 47----------------------------------------------------->
 48
 49RAG - Retrieval Augmented Generation
 50RAG allows a Foundation Model to reference a data source outside of its training data without being fine-tuned.
 51
 52So we have a knowledge base and its being built and managed by Amazon Bedrock.
 53
 54Amazon Bedrock - RAG Data Sources ---
 55-------------------------------------------------------->
 56AMazon S3
 57Confluence
 58Microsoft Sharepoint
 59Salesforce
 60Webpage
 61
 62https://platform.openai.com/tokenizer
 63
 64
 65each model has their own tokens maximum tokens called context window... its kind of race to context windows :)
 66The larget the context window, the more information and coherence
 67
 68Vector Embeddings
 69
 70Amazon Bedrock with GuardRails
 71
 72Amazon Bedrock - Agents
 73
 74
 75Amazon Bedrock -cloudwatch integration
 76
 77Amazon Bedrock  - AI AIStylist.
 78
 79
 80
 81prompting:
 82
 83Instructions:
 84Exploration:
 85Context:
 86Input Data:
 87Output Indicator:
 88
 89
 90Negative Prompting
 91
 92
 93Prompt Performance Optimization:
 94
 95System Prompts
 96Temperature
 97Top-P
 98Top-K
 99
100
101prompt engineering techniques:
1021. Zero-shot prompting
1032. Few-shots prompting
1043. Chain of thought prompting
105
1064. Retrieval Augmented Generation: Combine the models capability with external data sources to generate more informed and contextually rich response.
Amazon Q (LLM Assistant) Script
 1Amazon Q - Business -----
 2
 3Fully Managed Gen-AI assitant for your business
 4
 5Amazon-Q -- fully managed RAG
 6
 7Amazon-Q - Admin Controls
 8
 9Amazon-Q Apps:
10
11Amazon-Q Developer: Similar to Github Copilot -- supports java, javascript, pythin , c# etc
12
13
14Amazon Q for AWS Services:
15------------------------------------->
161. Amazon QuickSight
172. Amazon Q for Ec2
183. Amazon Q for AWS Chatbot
193. Amazon Q for Glue
20
21
22PartyRock:
23----------->
24
25GenAI app-building playground powered by Amazon Bedrock - Allows you to experiment creating GenAI apps with various FMs
26
27https://partyrock.aws
AI, ML, DL Concepts Script
 1Ml- Algorithms
 2
 3Supervised Learning:
 4
 51. Regression  - numeric value
 62. Classification  - categorical label of input data.
 7
 8
 9Training Set
10Validation Set
11Test Set
12
13
14Feature Engineering:
15
16Feature Engineering on structured and unstructured data.
17
18The process of using domain knowledge to select and transform raw data into meaningful features.
19
20
21Supervised Learning and
22Unsupervised Learning
23
24
25Model Fit, Bias and Variance
26
27Model Evaluation metrics:
28--------------------------------->
29
30Acuuracy of classification models:
311. PRecision
322. Recall
333. F1 Score
344. Accuracy
35
36
37AUC-ROC --- Area Under the Curve - Reciever Operator Curve
38
39
40Regression metrics
41
42MAE - Mean Absolute Error
43MAPE - Mean Absolute Percentage Error
44RMSE - Root Mean Squared Error
45R^2 -
46
47INferencing - is when a model is making prediction on new data.
48
49Realtime inferncing - chatbots
50Batch inferncing  - Data analytics
51INferencing at Edge  - LLM on remote server or run small language model(SLM)
Machine Learning AWS Example Script
 1Data collection and Preparation
 2Feature Engineering
 3Model Training and Parameter Tuning
 4Model Evalution
 5
 6Partial Dependence Plots (PDPs):
 7PDPs help illustrate the relationship between input variables and the models output, making the models behavior easier to understand and explain to stakeholders.
 8
 9
10A company is developing a call center application and wants to extract insights from customer conversations. Which solution best meets this requirement?
11Amazon Transcribe is ideal for converting speech to text, enabling further analysis and extraction of key information from customer calls.
12
13
14A company wants to generate synthetic data based on its existing data. Which type of model is best suited for this task?
15GANs are specifically designed to generate realistic synthetic data by learning the distribution of the input data.
16
17Q: A company uses Amazon SageMaker for its ML pipeline in production.
18   The company handles input data sizes of up to 1 GB and processing times of up to 1 hour, but needs near real-time latency.
19   Which SageMaker inference option meets these requirements?
20A: SageMakers asynchronous inference is designed for large data loads and longer processing times while still delivering low-latency results without needing a persistent connection.
21
22
23
24Import data into Amazon SageMaker Canvas and build ML models by selecting values from the Canvas data..
25Amazon SageMaker Canvas is designed for users with limited coding skills, enabling them to build ML models and forecasts by selecting values from the data directly.
26
27
28
29Reduce the number of tokens in the prompt.. Reducing the token count in the prompt can lower processing costs without affecting performance, especially when the model is invoked infrequently.
30
31
32Deploy the custom model on an Amazon SageMaker endpoint for real-time inference.
33
34Q: A law firm wants to develop an AI application using large language models (LLMs) that can read legal documents and extract their key points. Which solution meets these requirements?
35A: Develop a summarization chatbot.. A summarization chatbot based on an LLM can be trained to read and condense legal documents, extracting only the most critical information.
36
37
38GenAI models -- Creating photorealistic images from text descriptions for digital marketing..
39Generative AI models are often used to generate creative content, such as photorealistic images based on textual input, which is particularly useful in digital marketing.
40
41
42Guardrails for Amazon Bedrock help ensure that generative models produce content that is appropriate and aligned with safety and ethical guidelines, making it ideal for childrens applications.
43
44Model parameter count is a technical metric that measures the size and complexity of a model, not a business metric focused on financial or customer impact.
45
46Prompt modeling involves designing templates that can be reused with different inputs, streamlining the process of prompt engineering.
47
48
49
50
51a) Amazon SageMaker Model Monitor, b) Amazon A2I (Amazon Augmented AI). Amazon SageMaker Model Monitor tracks deployed models for issues like data drift,
52  while Amazon A2I allows for the easy integration of human review for low-confidence predictions or periodic audits.
53
54a) Decision Trees.. Decision trees are interpretable models that clearly show how decisions are made at each node, making it easier to understand how gene characteristics influence classification.
55
56
57AMazon Polly: is a text-to-specch service that uses advanced deep learning techniques to produce natural sounding speech.
58
59
60
61Mask confidential data in the inference responses using dynamic data masking.. Dynamic masking of confidential data in the inference responses ensures that sensitive information is not revealed without the need to retrhe model.
62
63
64Amazon Comprehend and Amazon Bedrock
65Amazon Comprehend can analyze textual sentiment, while Amazon Bedrock offers language models that can be fine-tuned to enhance sentiment analysis capabilities.
66
67
68
69 To teach the model to follow specific instructions..
70 Instruction fine-tuning involves training the model with input-output pairs that are formatted as instructions, helping it learn to respond appropriately to user commands.
71
72
73AUC-ROC --- Area Under the Curve - Reciever Operator Curve
74
75Context-window defines how much text the model can consider in one prompt, which is crucial for tasks that require processing long inputs.
76
77An anomaly detection system is well-suited to identify unusual patterns, such as suspicious IP addresses, thereby helping to secure the application.
78
79
80Amazon EC2 Trn-series. The EC2 Trn-series is designed to be energy-efficient and optimized for ML training, thereby minimizing environmental impact.
81
82
83Pairs of customer messages with the correct customer intents.. Providing pairs of customer messages and their corresponding correct intents helps the model learn context and improve its intent detection accuracy in a few-shot setting.
84
85Amazon SageMaker JumpStart provides pre-trained models and ready-to-use notebooks, enabling rapid deployment and testing within a VPC.
AWS AI Services Commands
 1amazon comprehend : NLP and text analytics
 2
 3amazon transcribe: Speech to Text
 4amazon polly: text to speecH, Lexicons, SSML, VOice Engine, Speech Mark.
 5
 6
 7amazon rekognition, Find objects,people, text, scenes in images and videos using ML.
 8Facial analysis and facial search to do user verification, people counting.
 9
10amazon rekognition - custom labels, also integrated with the Amazon Augmented AI -  Amazon A2I for human review,
11Rekognition Custom Moderation Adapter.
12Content Moderation API
13
14
15
16Amazon Lex - Build chatbots for applications using voice and text - conversational AI
17
18
19Amazon Personalize --- Fully Managed ML-Service to build apps with real-time personalized recommendations.
20Amazon personalize recipes
21
22Amazon Textract: Automatically extracts text, handwriting, and data from any scanned documents using AI & ML.
23
24Amazon kendra: Fully managed document search service powered by Machine Learning.
25Natural language search capabilities.
26
27Amazon Mechanical Turk:

AI Concepts Visualized

_images/1.amazon_bedrock.png _images/2.bedrock_AI_Models.png _images/3.automatic_model_evaluation.png _images/4.RAG_KnowledgeBase.png _images/5.aws_vector_dbs.png _images/6.tokenization_and_embeddings.png _images/7.prompt_performance.png _images/8.ml-terms.png _images/9.confusion_matrix.png _images/10.aws-ai-services.png

📘 Additional AWS AI Demos