Professional Documents
Culture Documents
FMOps/LLMOps: Operationalise
Generative AI using MLOps principles
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Agenda
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is MLOps?
MLOps Definition
MLOps
Machine Learning
& Operations People
efficiently.
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
MLOps Foundation Expected Outcomes
STANDARDIZE OPERATIONS AND INFRASTRUCTURE FOR YOUR DATA SCIENCE
MLOps Expected
Business Goal Technical Metric Before MLOps Business Value
Outcomes
Time to value up to Improve Speed-to-Value
1 Be more efficient in delivery < 3 months
(from idea to production) 12 months by 4x
Time to productionize existing ML use Reduce FTE overhead
2 Simplify route-to-live 3-6 months < 2 weeks
cases in average 8x
Focus on innovation
Standardize infrastructure, data,
3 % Template driven development n/a > 85% increasing re-usability
& code
by 85%
Standardize onboarding of new Time to instantiate a new MLOps Accelerate ML adoption
4 40 days < 1 hours
teams and ML use cases infrastructure & ML projects across all business areas
Execute the ML solutions without Your data is safe in your
5 Ensure high security standards n/a No internet
internet access in a private cloud private cloud
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
MLOps Maturity Model
del
Models in Production
Mo Scalable
erating
Op Reliable
Templatize and
Repeatable Productionize Multiple ML
Introduce Testing,
Solutions by Multiple
Monitoring, and Multi-
Teams
account Deployment
Standardize Code
Initial Repositories & ML Solution
Deployment
Establish the
Experimentation
Environment
MLOps Maturity
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
MLOps Key Personas and Roles
Platform Team Business
Secure Cloud/Data/ML Platform Viz Dashboards, ML Adoption, & ROI
ML Production
Environment
Security
Platform Model
Experimentation Model Build Model Test
Administration Deployment
Prove that ML can solve a business
Automate model build/training Automate model testing and Serving and monitoring the model
problem, i.e. PoC
providing scaled data guardrails testing
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
MLOPs Scalable Phase
MULTIPLE TEAMS AND ML USE CASES ADOPT MLOPS
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Generative AI (GenAI) & MLOps
MLOps & FMOps/LLMOps Differentiators
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
GenAI Use Case Domains
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Key Definitions
Technology
Processes
People
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
MLOps & FMOps Differentiators
MLOps FMOps
Processes & People
Providers, fine-tuners, & consumers
Technology
MLOps, data, & application layers
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
MLOps & FMOps Differentiators
Technology
MLOps, data, & application layers
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
GenAI User Types & Skills
Deep end-to-end ML, NLP Strong end-to-end ML expertise No ML expertise required. Mostly
expertise and data science, and knowledge of model application developers or end-
labeler “squad“ deployment and inference. users with understanding of the
Skills Strong domain knowledge for service capabilities. Only prompt
tuning including prompt engineering is required for better
engineering. results.
Productionize applications
MLOps is required where DevOps/AppDev is
more relevant than MLOps
17
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
The Journey of Consumers
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
GenAI Processes - Consumers
19
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Select FM - Consumers
Step 1. Understand Step 2. Test & evaluate the Step 3. Select the best
top proprietary and top selected FMs (e.g. top 3) FM based on your
open source FM priorities
capabilities
13 K
available 20 3 1
FMs
20
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Step 1. Understand top FM capabilities
Proprietary or open-source FM
Trained on Quality
(instructions, code, interne data)
21
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Step 1. Proprietary FM Capabilities
GPU
Company Can be used Available on
Model Name # Params instance Speed Context Window Trained on Fine-tunable
Name Commercially AWS
req.
Internet Data,
Bedrock,
J2 Ultra Instruct Yes 178 B p4d.24xl 8K Code, No
Jumpstart/SM Instructions
Internet Data,
AI21 Bedrock,
J2 Mid Instruct Yes 17 B g5.12xl 8K Code, No
Jumpstart/SM Instructions
Internet Data,
AI21 Summarize Yes g4dn.12xl Jumpstart/SM ~13 K Instructions No
Bedrock,
Stability AI SDXL Yes n/a g5.xl - <Text, Image> No
Jumpstart/SM
https://crfm.stanford.edu/2023/06/15/eu-ai-act.html
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Step 1. Understand FM Capabilities
Can be the same person
Note:
Prompt = Input (data, data source, & instructions) + query
26
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Step 2. Evaluate the top FMs
27
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Step 2. Evaluate the top FMs - Examples
28
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
EX
AM
Step 3. Select the best FM based on priorities PLE
Model Speed
FM1 ⚡⚡
FM2 ⚡
FM3 ⚡
Speed No priority
29
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
GenAI Processes for LLM - Consumers
Backend Front-end
LLM-based GenAI Solution
30
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
GenAI Technology for LLM - Consumers
Amazon Bedrock
33
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
GenAI Processes - Consumers
34
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
GenAI Processes for LLM - Consumers
Backend Front-end
New Test Set
LLM-based GenAI Solution
1.Select FM 3.
3. Test &
Chain Test & Test
5. Input/ Develop & Input/ Output
or Select
1. Use Fine-
FM Test Prompt
Prompts & Prompt
Output Deploy Web & Rating WebUI
tuned Mode lineage
Applications lineage
Filtering GenAI End-users
(input & outputs)
Application Interaction Use web application
(input & outputs)
rate the quality of
output
Create User
4.
4. Input/
Chain 6.
5. Rating Test
2. Prompt Account &
Prompts
Output& Mechanisms Functionality
Engineering (thumbs up/down,
Share Data
Applications
Filtering rating, text)
35
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
GenAI Technology for LLM - Consumers
36
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
GenAI Technology for LLM - Consumers
Amazon Bedrock
37
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
The Journey of Providers
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
GenAI Providers Productionize FM using MLOps
TRAIN MULTIPLE FOUNDATIONS MODELS
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
The Journey of Fine-tuners
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
GenAI Processes - Fine-Tuners
45
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Fine-Tuning, PEFT & Training
Prompt
‘right’ model
Select the
(Inputs)
Fine-Tuning
(Training Job)
Requires high computation power (high cost but lower
Pre-trained FM than training) to calculate all the weights of Large FM
(deep learning model)
Higher accuracy
Thousands of example
input/outputs Fine-Tuned FM
Parameter-Efficient Fine-
Tuning (PEFT - Training Job)
Tens of example Requires low computation power (reduced cost e.g. 1/10 of Completion
input/outputs fine-tuning) as it adds small new layers in the Large FM (deep
learning model) (Outputs)
Lower accuracy
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
MLOPs Technology
MULTIPLE TEAMS AND ML USE CASES ADOPT MLOPS
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
MLOPs & GenAI Technology - Fine-tuner
MULTIPLE TEAMS AND ML USE CASES ADOPT MLOPS
Multi-tenancy
Only Open Source
deployment
FM can be stored in
Model Registry
Select FM Models
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Data & Open Source Fine-tuned FM Deployment
Model Registry
Main Model Group
V1 V2 V3
Preloaded Open-
Source FM
Source FM
Open
FM1 Source
Notebook Internet Code
or
Code Repo Internet connection is
required to get locally the
FMs
Amazon Model
SageMaker
Customer Data Endpoint
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Data & Proprietary Fine-tuned FM Deployment
Internet
Notebook
or V1 V2 V3
Code Repo
Producer Production Ready FM
Amazon Model
SageMaker
Customer Data Endpoint
AWS Account – Proprietary FM Provider 2
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
MLOPs &
Generative AI
Technology –
MLOps
MLOps
Fine-tuner
T H R E E M A I N L AY E R S A R E
INTERCONNECTED
Data
Data
Generative AI
Application
Generative AI Application
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
MLOPs &
Generative AI
Technology – Amazon 4
Fine-tuner Bedrock
THREE MAIN LAYERS ARE
INTERCONNECTED
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
People & Processes
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
MLOps Key Personas and Roles
Platform Team Business
Secure Cloud/Data/ML Platform Viz Dashboards, ML Adoption, & ROI
Data Labelers/Editors Fine Tuners Generative AI Developers, AppDev, & Generative AI End-users
Label or edit billions of Data for Select the corresponding Prompt Engineers/Testers Consume Generative AI solutions as black
FM models and hundreds of data FM, evaluate the model & Design prompt inputs, create examples of box, share data and rate the quality of
for fine tuning interacting with design the deployment prompt input/outputs, and test the output
data lake using a dedicated method/infrastructure engineered prompts, develop the GenAI
website application and front-end
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Generative AI Personas
Labeler Team Data Science Team Extension Application Developer Team End-Users
Data Preparation at Scale Context Adaptation Integrate GenAI models in applications Consume Generative AI applications
59
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Generative AI Personas
Labeler Team Data Science Team Extension Application Developer Team End-Users
Data Preparation at Scale Context Adaptation Integrate GenAI models in applications Consume Generative AI applications
AppDev
Develop the front-end of the GenAI
application
60
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
MLOps Foundation People & Processes
SEPARATION OF CONCERNS IS KEY FOR SUCCESS
ML Production
Environment
Security
Platform Model
Experimentation Model Build Model Test
Administration Deployment
Prove that ML can solve a business
Automate model build/training Automate model testing and Serving and monitoring the model
problem, i.e. PoC
providing scaled data guardrails testing
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
MLOps & GenAI Foundation People & Processes
SEPARATION OF CONCERNS IS KEY FOR SUCCESS
ML Production
Environment
Security
Provide user access Prepare, combine and catalogue Data Data Engineers Data Owners Business Stakeholders Data
Provide data access Visualize data ML Consumers Labelers / Editors
Generative AI
Developers Engineers /Testers
End-users
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Bonus: GenAI/LLM Vulnerabilities
https://owasp.org/www-project-top-10-for-large-
language-model-applications/descriptions/
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
GenAI/LLM Vulnerabilities 1/2
Prompt Injections: Bypassing filters or manipulating the LLM using carefully crafted prompts that make
the model ignore previous instructions or perform unintended actions.
Inadequate Sandboxing: Failing to properly isolate LLMs when they have access to external resources
or sensitive systems, allowing for potential exploitation and unauthorized access.
Unauthorized Code Execution: Exploiting LLMs to execute malicious code, commands, or actions on the
underlying system through natural language prompts.
SSRF Vulnerabilities: Exploiting LLMs to perform unintended requests or access restricted resources,
such as internal services, APIs, or data stores.
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
GenAI/LLM Vulnerabilities 2/2
Overreliance on LLM-generated Content: Excessive dependence on LLM-generated content without
human oversight can result in harmful consequences.
Inadequate AI Alignment: Failing to ensure that the LLM’s objectives and behavior align with the
intended use case, leading to undesired consequences or vulnerabilities.
Insufficient Access Controls: Not properly implementing access controls or authentication, allowing
unauthorized users to interact with the LLM and potentially exploit vulnerabilities.
Improper Error Handling: Exposing error messages or debugging information that could reveal
sensitive information, system details, or potential attack vectors.
Training Data Poisoning: Maliciously manipulating training data or fine-tuning procedures to introduce
vulnerabilities or backdoors into the LLM
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Conclusion
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
MLOps & FMOps Differentiators
Technology
MLOps, data, & application layers
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Thank you! Please complete the session
survey in the mobile app
@sokratis.kartakis