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
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
AI guide
【One-Line Pitch】
A practical, AWS-centric guide for building production-grade generative AI applications—covering the full project life cycle from prompt engineering and model selection to fine-tuning, RLHF, RAG, and deployment—ideal for ML practitioners, data engineers, and application developers who want to move beyond hype and ship real solutions.
【Book Arc】
- **Opening (~0%–9%)**: Introduces the generative AI landscape, common use cases (translation, content generation, etc.), and the end-to-end project life cycle—use case definition, model selection, fine-tuning, alignment, evaluation, deployment, and augmentation. Sets the stage for why a structured approach matters.
- **Early (~9%–25%)**: Dives into prompt engineering and in-context learning fundamentals—zero-shot, one-shot, few-shot inference, context design, and best practices like XML/HTML tags, PII masking, and selective focus. Warns about in-context learning pitfalls (e.g., tricking models with bad examples).
- **Early (~25%–34%)**: Explains large-language foundation models—embedding vectors, attention mechanisms, transformer architecture (query/key vectors, softmax), and scaling laws. Shows how model size vs. dataset size trade-offs affect performance and compute budgets.
- **Middle (~34%–44%)**: Covers memory and compute optimizations—quantization (fp16, int8), memory footprint reduction, and distributed computing with FSDP across GPUs. Includes practical code snippets for SageMaker and AWS Trainium.
- **Middle (~44%–47%)**: Continues optimization techniques—post-training quantization (PTQ), GPTQ, and deployment considerations. Bridges training optimizations to inference performance.
- **Late (~47%–end)**: Moves to context-aware reasoning applications using RAG and agents—addressing LLM limitations (hallucination, knowledge cutoff), document loading/chunking, embedding vector stores, retrieval chains, and reranking with Maximum Marginal Relevance. (Excerpts thin here; full book likely covers LangChain/ReAct and Amazon Bedrock.)
【Key Takeaways】
- **Generative AI is a full life cycle, not a single model** (Opening): Success requires iterating through use case definition, model selection, prompt engineering, fine-tuning, alignment, evaluation, and deployment—each stage has its own tools and trade-offs.
- **Prompt engineering is the first lever to pull** (Early): Start with zero-shot, escalate to one-shot/few-shot inference, and use structured tags (XML/HTML) and PII masking to improve output quality. But beware—in-context examples can mislead models if poorly chosen.
- **Context is everything for coherent responses** (Early): Passing relevant background, dialogue, or examples as context enables in-context learning; the quality of your prompt-completion pairs directly determines output reliability.
- **Transformer architecture explains model behavior** (Early): Embedding vectors (512–4,096 dimensions), attention weights (query-key dot products), and softmax probability distributions are the mechanics behind "completions"—understanding them helps you debug and tune models.
- **Scaling laws offer a compute-smart path** (Middle): You can match 175B-parameter performance by increasing dataset size instead of model size—a key insight for teams with limited compute budgets.
- **Quantization is a memory and speed win** (Middle): fp16 and int8 quantization cut memory usage by 50–75% with acceptable precision loss; tools like bitsandbytes/LLM.int8() minimize performance impact, making deployment cheaper and faster.
- **Distributed training is essential for scale** (Middle): FSDP (Fully Sharded Data Parallel) across GPUs, via SageMaker's distributed library, enables training large models efficiently—with practical code patterns for sharding and bf16.
- **RAG solves hallucination and knowledge cutoff** (Late): Retrieval-augmented generation grounds models in external knowledge via document loading, chunking, embedding stores, and reranking (e.g., MMR)—critical for production accuracy.
【Reading Tips】
- **Skim the opening chapters** (~0–9%) for the life cycle overview; they're foundational but high-level—don't get bogged down in use-case examples if you're already familiar with gen AI basics.
- **Deep-read the prompt engineering chapter** (~9–25%): It's the most immediately actionable content; practice the few-shot and XML-tag techniques with your own models to internalize them.
- **Pay attention to the quantization and distributed computing sections** (~34–47%): These are dense but crucial for cost and performance; skim the math, focus on the practical trade-offs (memory vs. precision) and code snippets.
- **For RAG and agents** (~47%+): Expect hands-on implementation details—document chunking strategies, embedding vector stores, and reranking—but note the excerpts are thin here; supplement with the book's GitHub code if needed.
- **Skip the front matter** (preface, permissions) unless you need code-usage guidelines; it's standard O'Reilly boilerplate.
【Coverage Limits】
This guide synthesizes excerpts covering roughly the first half of the book (through optimization and into RAG). The later chapters on Amazon Bedrock, LangChain/ReAct agents, and full deployment workflows are only partially represented—consult the book directly for those details.
Page 12
g with RLHF 130 Evaluate RLHF Fine-Tuned Model 131 Qualitative Evaluation 131 Quantitative Evaluation 132 Load Evaluation Model 133 Define Evaluation-Metric...
rative models with external data sources or APIs. Evaluate. To properly implement generative AI applications, you need to iterate heavily. Therefore, it’s im...
ace it with XXX,” for instance. Here is an example. Prompt: Human: Here is some text inside the <text></text> XML tags. Please remove all personally identifi...
post-training quantization (GPTQ)1 in more detail when you prepare the model for deployment in Chapter 8. 1 Elias Frantar et al., “GPTQ: Accurate Post-Traini...
ining_args, train_dataset=tokenized_datasets["train"] ) As shown in Figure 6-6, the two low-rank matrices, A and B, are multiplied together to create a matri...
ure the toxicity score again using the same aggregate_toxic ity_scores() function: from transformers import AutoTokenizer model_checkpoint = "..." # generati...
if the data is already in a consumable format; however, the preparation of data is often a prerequisite in RAG-based architecture to prepare the data for ret...
t guide models to create step-by-step action plans, you can now build powerful context-aware reasoning applications. To build end-to-end generative AI soluti...
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Add Tag
Enter tag name (max 50 characters)
Share E-Book
Generative AI on AWS Building Context-Aware Multimodal Reasoning Applications (Chris Fregly, Antje Barth, Shelbee Eigenbrode) (Z-Library)
Scan QR code with your phone to access
Copy the link or scan the QR code to access this e-book on your phone
Share E-Book via Email
Please enter email address
Donation Statistics
¥.00
Total Donations
0
Donation Count
Generative AI on AWS Building Context-Aware Multimodal Reasoning Applications (Chris Fregly, Antje Barth, Shelbee Eigenbrode) (Z-Library)
Find Your Favorite Books
Only registered users can comment after logging in. Comments need to be reviewed by administrators before being displayed
Loading comments...
Reply to Comment
Edit Comment