-30% $55.99$55.99
Delivery Wednesday, January 29
Ships from: Amazon.com Sold by: Amazon.com
$50.51$50.51
Delivery Monday, February 3
Ships from: Amazon Sold by: Goodbooks Company
Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.
Generative AI on AWS: Building Context-Aware Multimodal Reasoning Applications 1st Edition
Purchase options and add-ons
Companies today are moving rapidly to integrate generative AI into their products and services. But there's a great deal of hype (and misunderstanding) about the impact and promise of this technology. With this book, Chris Fregly, Antje Barth, and Shelbee Eigenbrode from AWS help CTOs, ML practitioners, application developers, business analysts, data engineers, and data scientists find practical ways to use this exciting new technology.
You'll learn the generative AI project life cycle including use case definition, model selection, model fine-tuning, retrieval-augmented generation, reinforcement learning from human feedback, and model quantization, optimization, and deployment. And you'll explore different types of models including large language models (LLMs) and multimodal models such as Stable Diffusion for generating images and Flamingo/IDEFICS for answering questions about images.
- Apply generative AI to your business use cases
- Determine which generative AI models are best suited to your task
- Perform prompt engineering and in-context learning
- Fine-tune generative AI models on your datasets with low-rank adaptation (LoRA)
- Align generative AI models to human values with reinforcement learning from human feedback (RLHF)
- Augment your model with retrieval-augmented generation (RAG)
- Explore libraries such as LangChain and ReAct to develop agents and actions
- Build generative AI applications with Amazon Bedrock
- ISBN-101098159225
- ISBN-13978-1098159221
- Edition1st
- PublisherO'Reilly Media
- Publication dateDecember 19, 2023
- LanguageEnglish
- Dimensions7 x 0.65 x 9.19 inches
- Print length309 pages
Frequently bought together
Customers who bought this item also bought
From the brand
-
Explore more AWS resources
-
Explore Cloud Services
-
Sharing the knowledge of experts
O'Reilly's mission is to change the world by sharing the knowledge of innovators. For over 40 years, we've inspired companies and individuals to do new things (and do them better) by providing the skills and understanding that are necessary for success.
Our customers are hungry to build the innovations that propel the world forward. And we help them do just that.
From the Publisher
From the Preface
After reading this book, you will understand the most common generative AI use cases and tasks addressed by industry and academia today. You will gain in-depth knowledge of how these cutting-edge generative models are built, as well as practical experience to help you choose between reusing an existing generative model or building one from scratch. You will then learn to adapt these generative AI models to your domain-specific datasets, tasks, and use cases that support your business applications.
This book is meant for AI/ML enthusiasts, data scientists, and engineers who want to learn the technical foundations and best practices for generative AI model training, fine-tuning, and deploying into production. We assume that you are already familiar with Python and basic deep-learning components like neural networks, forward propagation, activations, gradients, and back propagations to understand the concepts used here.
A basic understanding of Python and deep learning frameworks such as TensorFlow or PyTorch should be sufficient to understand the code samples used throughout the book. Familiarity with AWS is not required to learn the concepts, but it is useful for some of the AWS-specific samples.
You will dive deep into the generative AI life cycle and learn topics such as prompt engineering, few-shot in-context learning, generative model pretraining, domain adaptation, model evaluation, parameter-efficient fine-tuning (PEFT), and reinforcement learning from human feedback (RLHF).
You will get hands-on with popular large language models such as Llama 2 and Falcon as well as multimodal generative models, including Stable Diffusion and IDEFICS. You will access these foundation models through the Hugging Face Model Hub, Amazon SageMaker JumpStart, or Amazon Bedrock managed service for generative AI.
You will also learn how to implement context-aware retrieval-augmented generation (RAG) and agent-based reasoning workflows. You will explore application frameworks and libraries, including LangChain, ReAct, and Program-Aided-Language models (PAL). You can use these frameworks and libraries to access your own custom data sources and APIs or integrate with external data sources such as web search and partner data systems.
Lastly, you will explore all of these generative concepts, frameworks, and libraries in the context of multimodal generative AI use cases across different content modalities such as text, images, audio, and video.
And don’t worry if you don’t understand all of these concepts just yet. Throughout the book, you will dive into each of these topics in much more detail. With all of this knowledge and hands-on experience, you can start building cutting-edge generative AI applications that help delight your customers, outperform your competition, and increase your revenue!
Editorial Reviews
Review
—Jeff Barr VP and Chief Evangelist at AWS
"This book is a comprehensive resource for building generative AI-based solutions
on AWS. Using real-world examples, Chris, Antje, and Shelbee have done a
spectacular job explaining key concepts, pitfalls, and best practices for LLMs
and multimodal models. A very timely resource to accelerate your journey for
building generative AI solutions from concept to production."
—Geeta Chauhan, Applied AI Leader at Meta
"This is by far the best book I have come across that makes building generative AI very
practical. Antje, Chris, and Shelbee put together an exceptional resource that will be very
valuable for years—if possible, converted to a learning resource for universities. Definitely
a must-read for anyone building generative AI applications at scale on AWS."
—Olalekan Elesin, Director of Data Science Platform at HRS Group
"If you're looking for a robust learning foundation for building and deploying
generative AI products or services, look no further than Generative AI on AWS.
Guided by the deep expertise of authors Chris Fregly, Antje Barth, and Shelbee
Eigenbrode, this book will transition you from a GenAI novice to a master of the
intricate nuances involved in training, fine-tuning, and application development. This
manual is an indispensable guide and true necessity for every budding AI engineer,
product manager, marketer, or business leader."
—Lillian Pierson, PE, Founder at Data-Mania
"This book goes deep into how GenAI models are actually built and used. And it covers
the whole life cycle, not just prompt engineering or tuning. If you're thinking about using
GenAI for anything nontrivial, you should read this book to understand what skill sets
and tools you'll need to be successful."
—Randy DeFauw, Sr. Principal Solution Architect at AWS
"In the process of developing and deploying a generative AI application, there are
many complex decision points that collectively determine whether the application
will produce high quality output and can be run in a cost-efficient, scalable, and
reliable manner. This book demystifies the underlying technologies and provides
thoughtful guidance to help readers understand and make these decisions, and
ultimately launch successful generative AI applications."
—Brent Rabowsky, Sr. Manager AI/ML Specialist SA at AWS
"There's no better book to get started with generative AI. With all the information
on the internet about the topic, it's extremely overwhelming for anyone. But this
book is a clear and structured guide. It goes from the basics all the way to
advanced topics like parameter-efficient fine-tuning and LLM deployment. It's also
very practical and covers deployment on AWS too. This book is an extremely
valuable resource for any data scientist or engineer!"
—Alexey Grigorev, Principal Data Scientist at OLX Group
"It's very rare to find a book that comprehensively covers the full end-to-end process of
model development and deployment! If you're an ML practitioner, this book is a must!"
—Alejandro Herrera, Data Scientist at Snowflake
"This book is a fantastic end-to-end deep-dive into the Generative AI foundations including how to build enterprise-level Generative AI solutions on AWS. Great work!!"
—Dr. Ramine Tinati, Chief Data Scientist at Accenture
"Generative AI on AWS provides an in-depth look at the innovative techniques for creating applications that comprehend diverse data types and make context-driven decisions. Readers get a comprehensive view, bridging both the theoretical aspects and practical tools needed for Generative AI applications. This book is a must-read for those wanting to harness the full potential of AWS in the realm of Generative AI."
—Kesha Williams, Director at Slalom Consulting and AWS ML Hero
From the Author
Ch 1. Generative AI Use Cases, Fundamentals, and Project Life Cycle.
Use Cases and Tasks
Foundation Models and Model Hubs
Generative AI Project Life Cycle
Generative AI on AWS
Why Generative AI on AWS?
Building Generative AI Applications on AWS
Summary
Ch 2. Prompt Engineering and In-Context Learning.
Prompts and Completions
Tokens
Prompt Engineering
Prompt Structure
Instruction
Context
In-Context Learning with Few-Shot Inference
Zero-Shot Inference
One-Shot Inference
Few-Shot Inference
In-Context Learning Gone Wrong
In-Context Learning Best Practices
Prompt-Engineering Best Practices
Inference Configuration Parameters
Summary
Ch 3. Large-Language Foundation Models
Large-Language Foundation Models
Tokenizers
Embedding Vectors
Transformer Architecture
Inputs and Context Window
Embedding Layer
Encoder
Self-Attention
Decoder
Softmax Output
Types of Transformer-Based Foundation Models
Pretraining Datasets
Scaling Laws
Compute-Optimal Models
Summary
Ch 4. Memory and Compute Optimizations
Memory Challenges
Data Types and Numerical Precision
Quantization
fp16
bfloat16
fp8
int8
Optimizing the Self-Attention Layers
FlashAttention
Grouped-Query Attention
Distributed Computing
Distributed Data Parallel
Fully Sharded Data Parallel
Performance Comparison of FSDP over DDP
Distributed Computing on AWS
Fully Sharded Data Parallel with Amazon SageMaker
AWS Neuron SDK and AWS Trainium
Summary
Ch 5. Fine-Tuning and Evaluation
Instruction Fine-Tuning
Llama 2-Chat
Falcon-Chat
FLAN-T5
Instruction Dataset
Multitask Instruction Dataset
FLAN: Example Multitask Instruction Dataset
Prompt Template
Convert a Custom Dataset into an Instruction Dataset
Instruction Fine-Tuning
Amazon SageMaker Studio
Amazon SageMaker JumpStart
Amazon SageMaker Estimator for Hugging Face
Evaluation
Evaluation Metrics
Benchmarks and Datasets
Summary
Ch 6. Parameter-Efficient Fine-Tuning
Full Fine-Tuning Versus PEFT
LoRA and QLoRA
LoRA Fundamentals
Rank
Target Modules and Layers
Applying LoRA
Merging LoRA Adapter with Original Model
Maintaining Separate LoRA Adapters
Full-Fine Tuning Versus LoRA Performance
QLoRA
Prompt Tuning and Soft Prompts
Summary
Ch 7. Fine-Tuning with Reinforcement Learning from Human Feedback
Human Alignment: Helpful, Honest, and Harmless
Reinforcement Learning Overview
Train a Custom Reward Model
Collect Training Dataset with Human-in-the-Loop
Sample Instructions for Human Labelers
Using Amazon SageMaker Ground Truth for Human Annotations
Prepare Ranking Data to Train a Reward Model 118
Train the Reward Model 121
Existing Reward Model: Toxicity Detector by Meta 123
Fine-Tune with Reinforcement Learning from Human Feedback 124
Using the Reward Model with RLHF
Proximal Policy Optimization RL Algorithm
Perform RLHF Fine-Tuning with PPO
Mitigate Reward Hacking
Using Parameter-Efficient Fine-Tuning with RLHF
Evaluate RLHF Fine-Tuned Model
Qualitative Evaluation
Quantitative Evaluation
Load Evaluation Model
Define Evaluation-Metric Aggregation Function
Compare Evaluation Metrics Before and After
Summary
Ch 8. Model Deployment Optimizations
Model Optimizations for Inference
Pruning
Post-Training Quantization with GPTQ
Distillation
Large Model Inference Container
AWS Inferentia: Purpose-Built Hardware for Inference
Model Update and Deployment Strategies
A/B Testing
Shadow Deployment
Metrics and Monitoring
Autoscaling
Autoscaling Policies
Define an Autoscaling Policy
Summary
Ch 9. Context-Aware Reasoning Applications Using RAG and Agents
Large Language Model Limitations
Hallucination
Knowledge Cutoff
Retrieval-Augmented Generation
External Sources of Knowledge
RAG Workflow
Document Loading
Chunking
Document Retrieval and Reranking
Prompt Augmentation
RAG Orchestration and Implementation
Document Loading and Chunking
Embedding Vector Store and Retrieval
Retrieval Chains
Reranking with Maximum Marginal Relevance
Agents
ReAct Framework
Program-Aided Language Framework
Generative AI Applications
FMOps: Operationalizing the Generative AI Project Life Cycle
Experimentation Considerations
Development Considerations
Production Deployment Considerations
Summary
Ch 10. Multimodal Foundation Models
Use Cases
Multimodal Prompt Engineering Best Practices
Image Generation and Enhancement
Image Generation
Image Editing and Enhancement
Inpainting, Outpainting, Depth-to-Image
Inpainting
Outpainting
Depth-to-Image
Image Captioning and Visual Question Answering
Image Captioning
Content Moderation
Visual Question Answering
Model Evaluation
Text-to-Image Generative Tasks
Forward Diffusion
Nonverbal Reasoning
Diffusion Architecture Fundamentals
Forward Diffusion
Reverse Diffusion
U-Net
Stable Diffusion 2 Architecture
Text Encoder
U-Net and Diffusion Process
Text Conditioning
Cross-Attention
Scheduler
Image Decoder
Stable Diffusion XL Architecture
U-Net and Cross-Attention
Refiner
Conditioning
Summary
Ch 11. Controlled Generation and Fine-Tuning with Stable Diffusion
ControlNet
Fine-Tuning
DreamBooth
DreamBooth and PEFT-LoRA
Textual Inversion
Human Alignment with Reinforcement Learning from Human Feedback
Summary
Ch 12. Amazon Bedrock: Managed Service for Generative AI
Bedrock Foundation Models
Amazon Titan Foundation Models
Stable Diffusion Foundation Models from Stability AI
Bedrock Inference APIs
Large Language Models
Generate SQL Code
Summarize Text
Embeddings
Fine-Tuning
Agents
Multimodal Models
Create Images from Text
Create Images from Images
Data Privacy and Network Security
Governance and Monitoring
Summary
From the Inside Flap
The book covers the entire lifecycle of a generative AI project, beginning with use case definition, model selection, and fine-tuning, to more advanced topics like retrieval-augmented generation, reinforcement learning from human feedback, and model quantization optimization. It also explores various model types, such as large language models (LLMs) and multimodal models like Stable Diffusion and Flamingo/IDEFICS, which are used for image generation and answering questions about images.
Designed for AI/ML enthusiasts, data scientists, and engineers, the book assumes a basic understanding of Python and deep learning frameworks such as TensorFlow or PyTorch. Readers will learn about prompt engineering, in-context learning, pretraining of generative models, domain adaptation, model evaluation, and parameter-efficient fine-tuning. The book also introduces tools and platforms like Hugging Face Model Hub, Amazon SageMaker JumpStart, and Amazon Bedrock managed service for generative AI, helping readers get hands-on experience with popular large language models and multimodal generative models.
Overall, "Generative AI on AWS" is an indispensable resource for anyone looking to harness the power of generative AI. It not only provides a solid theoretical foundation but also offers practical guidance and examples for implementing these advanced technologies in real-world applications. The book is particularly valuable for those looking to integrate generative AI into their products and services, as it demystifies the technology and offers a clear pathway from concept to production.
From the Back Cover
You'll learn the generative AI project life cycle including use case definition, model selection, model fine-tuning, retrieval-augmented generation, reinforcement learning from human feedback, and model quantization, optimization, and deployment. And you'll explore different types of models including large language models (LLMs) and multimodal models such as Stable Diffusion for generating images and Flamingo/IDEFICS for answering questions about images.
High-level topics
- Apply generative AI to your business use cases
- Determine which generative AI models are best suited to your task
- Perform prompt engineering and in-context learning
- Fine-tune generative AI models on your datasets with low-rank adaptation (LoRA)
- Align generative AI models to human values with reinforcement learning from human feedback (RLHF)
- Augment your model with retrieval-augmented generation (RAG)
- Explore libraries such as LangChain and ReAct to develop agents and actions
- Build generative AI applications with Amazon Bedrock
About the Author
Antje Barth is a Principal Developer Advocate for AI and Machine Learning at Amazon Web Services (AWS) based in San Francisco, California. She is also co-founder of the global Generative AI on AWS Meetup. Antje frequently speaks at AI and machine learning conferences and meetups around the world, including the O'Reilly AI and Strata conferences. Besides Generative AI, Antje is passionate about helping developers leverage big data, containers, and Kubernetes platforms in the context of AI and Machine Learning. Prior to joining AWS, Antje worked in technical evangelist and solutions engineering roles at MapR and Cisco. She is also co-author of the O'Reilly book, Data Science on AWS.
Shelbee Eigenbrode is a Principal Solutions Architect for Generative AI at Amazon Web Services (AWS) based in Denver, Colorado. She is co-founder of the Denver chapter of Women in Big Data. Shelbee holds 6 AWS certifications and has been in technology for 23 years spanning multiple industries, technologies, and roles. She focuses on combining her DevOps and ML backgrounds to deliver ML workloads at scale. With over 35 patents granted across various technology domains, Shelbee has a passion for continuous innovation and using data to drive business outcomes.
Product details
- Publisher : O'Reilly Media; 1st edition (December 19, 2023)
- Language : English
- Paperback : 309 pages
- ISBN-10 : 1098159225
- ISBN-13 : 978-1098159221
- Item Weight : 1.1 pounds
- Dimensions : 7 x 0.65 x 9.19 inches
- Best Sellers Rank: #153,437 in Books (See Top 100 in Books)
- Customer Reviews:
About the authors
Shelbee Eigenbrode is a Principal Machine Learning Specialist Solutions Architect at Amazon Web Services (AWS). She’s been in technology for 24 years spanning multiple roles, industries and technologies. With over 35 patents granted across various technology domains, she has a passion for continuous innovation and using data to drive business outcomes. She’s a published author as well as co-creator/instructor for ‘Practice Data Science on the AWS Cloud Specialization’ and ‘Generative AI with Large Language Models’ on Coursera. Shelbee is based in Denver, CO and is also the Co-Director of the Denver, Colorado chapter of Women in Big Data.
Antje Barth is a Principal Developer Advocate for generative AI at AWS. She is co-author of the O’Reilly books – Generative AI on AWS and Data Science on AWS. Antje frequently speaks at AI/ML conferences, events, and meetups around the world. She also co-founded the Düsseldorf chapter of Women in Big Data.
Chris Fregly is a Principal Solutions Architect for Generative AI at Amazon Web Services (AWS) based in San Francisco, California. Chris holds every AWS certification. He is also co-founder of the global Generative AI on AWS Meetup. Chris regularly speaks at AI and Machine Learning meetups and conferences across the world. Previously, Chris was an engineer at Databricks and Netflix where he worked on scalable big data and machine learning products and solutions. He is also co-author of the O'Reilly book, Data Science on AWS.
Customer reviews
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on AmazonCustomers say
Customers find the book helpful for understanding high-level concepts and engineering topics. They appreciate the concrete examples and code snippets that help practitioners. The content quality is decent, though there are better options available. However, it demystifies the complex decisions involved in creating high-quality, scalable, and reliable generative AI products.
AI-generated from the text of customer reviews
Customers find the book helpful for understanding high-level concepts and prompt engineering. They find it a valuable resource with concrete examples and code snippets for practitioners. The book is described as comprehensive and useful from novice to expert levels of Generative AI experience.
"Good one for genai" Read more
"...I particularly benefited from the content pertaining to prompt engineering and the explanations of parameters affecting outcomes...." Read more
"this content is a great approach to understand generative AI on AWS. You would enjoy this knowlege for your task definitely." Read more
"Generative AI on AWS is an invaluable resource for any engineer, product manager, marketer, or business leader looking to harness the full potential..." Read more
Customers find the book provides decent content that explains complex decisions involved in creating high-quality, scalable, and reliable generative AI products.
"This is an excellent book, whether one is looking to understand concepts at a high level, or details at the low level...." Read more
"...This book demystifies the complex decisions involved in creating high-quality, scalable, and reliable generative AI products and services on the AWS..." Read more
"This book has some decent content but there are many better options available for learning about Generative AI...." Read more
"Excellent book..." Read more
Reviews with images
Comprehensive & practical guide to build generative AI solutions. I'm buying this for my whole team!
-
Top reviews
Top reviews from the United States
There was a problem filtering reviews right now. Please try again later.
- Reviewed in the United States on August 26, 2024Good one for genai
- Reviewed in the United States on January 20, 2024This is an excellent book, whether one is looking to understand concepts at a high level, or details at the low level. I particularly benefited from the content pertaining to prompt engineering and the explanations of parameters affecting outcomes. Overall, the book was easy to understand and extremely well-written. Good job!
- Reviewed in the United States on August 8, 2024this content is a great approach to understand generative AI on AWS. You would enjoy this knowlege for your task definitely.
- Reviewed in the United States on November 25, 2023Generative AI on AWS is an invaluable resource for any engineer, product manager, marketer, or business leader looking to harness the full potential of generative AI. This book demystifies the complex decisions involved in creating high-quality, scalable, and reliable generative AI products and services on the AWS cloud. My team has already greatly benefited from this book!
- Reviewed in the United States on April 13, 2024It was very easy to follow the book even though there were some complex subjects. The concrete examples and code snippets help a lot for practitioner. Great job by all the authors
- Reviewed in the United States on January 21, 2024This is a comprehensive look at getting started with generative AI in AWS. Lots of practical examples. If you're wanting to get started with your generative AI journey, this is an excellent resource.
- Reviewed in the United States on August 4, 2024AWS conference, AWS mls exams and AWS ans-c01 network cert
- Reviewed in the United States on November 17, 2024This book has some decent content but there are many better options available for learning about Generative AI. The diagrams contain multiple errors and some of the text reads like nothing more than a redundant advertisement for AWS. A few tables and code snippets are helpful but the majority appear to have been added simply to make the book long enough to justify the price. Get O’Reilly’s “Generative Deep Learning” instead.
Top reviews from other countries
- Frank MoralesReviewed in Canada on January 9, 2024
5.0 out of 5 stars Outstanding Textbook For Generative AI
This GREAT book provides good guidelines based on practical examples about using the AWS Ecosystem Toward GENERATIVE AI correctly and accordingly. Also, provide a comprehensive and extensive overview related to the state of the art of the current GAI and beyond. I recommended this book to scholars and the AI enthusiast community. Also, the Python community should be happy with this book, which proves the power of this language one more time—an excellent source for an outstanding generative AI textbook.
- Amitabh DasReviewed in India on April 8, 2024
5.0 out of 5 stars Aws
Good book lot of good information with lot pf good insights. 👍 lot of good information to apply at your work
- Ivana TasicReviewed in Germany on February 21, 2024
1.0 out of 5 stars Pages are not glued!
I just started reading the book and it started to fall apart…
Ivana Tasic
Reviewed in Germany on February 21, 2024
Images in this review - Amazon KundeReviewed in Singapore on September 4, 2024
1.0 out of 5 stars Defective book with lots of pages dangling apart
Many pages are falling apart and not properly glued together, it's a very bad experience when you pay such a high price for the book with low quality.
Amazon Kunde
Reviewed in Singapore on September 4, 2024
Images in this review