Domain 2: Fundamentals of Generative AI (24%) โ
โ Domain 1 ยท Next Domain โ
2.1: What is Generative AI? โ
Traditional ML: Analyzes and classifies (discriminative)
- Input: Email โ Output: Spam/Not Spam
Generative AI: Creates new content (generative)
- Input: "Write a poem about clouds" โ Output: Original poem
Key Concepts โ
GenAI Core Concepts
What is a Token?
(Click to reveal)Roughly 1 token โ 0.75 words
Example: "Hello world" = 2 tokens
Affects cost and processing.
Foundation Models (FMs) โ
- Large models trained on vast amounts of data
- Can perform multiple tasks without task-specific training
- Examples: GPT-4, Claude, Llama, Stable Diffusion
Large Language Models (LLMs) โ
- Foundation models specifically for text
- Trained on text from books, websites, articles
- Understand and generate human-like text
Transformers โ
- Architecture behind modern LLMs
- Key innovation: Attention mechanism
- Allows model to focus on relevant parts of input
- Enables understanding of context
2.2: Capabilities and Limitations โ
Capabilities of Generative AI โ
Text Generation:
- โ Write articles, stories, emails
- โ Summarize documents
- โ Translate languages
- โ Answer questions
Code Generation:
- โ Write code from descriptions
- โ Debug and explain code
- โ Generate unit tests
Reasoning:
- โ Multi-step problem solving
- โ Chain-of-thought reasoning
- โ Mathematical calculations (with limitations)
Few-Shot Learning:
- โ Learn from just a few examples in prompt
- โ Adapt to new tasks without retraining
Multimodal:
- โ Process text + images
- โ Generate images from text
- โ Understand and describe images
Limitations of Generative AI โ
GenAI Limitations
What is Hallucination in GenAI?
(Click to reveal)Why: Model predicts next token, not accessing knowledge database
Mitigation: Use RAG, implement guardrails, human review.
Critical Exam Concept: Hallucinations
Hallucination: When model generates false or nonsensical information presented as fact.
Why it happens:
- Model is predicting next token, not accessing knowledge database
- Trained to be helpful and complete responses
- No built-in fact-checking
Mitigation:
- Use RAG to provide factual context
- Implement guardrails
- Human review for critical applications
Other Limitations:
Training Data Cutoff
- Models don't know events after training
- Solution: Use RAG for current data
Context Window Limits
- Can't process extremely long documents
- Solution: Chunking, summarization
Computational Cost
- Expensive to train and run
- Larger models = higher cost
Bias in Training Data
- Reflects biases in training data
- Solution: Careful data curation, testing
No Real-Time Data
- Can't access internet or databases
- Solution: RAG, function calling
Lack of True Understanding
- Pattern matching, not reasoning
- Can make logical errors
2.3: AWS Generative AI Services โ
Amazon Bedrock โ
Fully managed service to access foundation models via API
Key Features:
- Multiple model providers (Anthropic, AI21, Cohere, Meta, Stability AI, Amazon)
- Pay-per-use pricing
- No infrastructure management
- Data privacy (your data doesn't train models)
Bedrock Models
Which Bedrock model has the longest context window?
(Click to reveal)200K token context window
Best for: Long document analysis, reasoning, code generation.
Models Available:
| Provider | Model | Strengths |
|---|---|---|
| Anthropic | Claude | Long context (200K), reasoning, code |
| Amazon | Titan Text | Cost-effective, AWS-optimized |
| Amazon | Titan Embeddings | Text embeddings for search |
| Amazon | Titan Image Generator | Image generation |
| AI21 Labs | Jurassic | Multilingual text |
| Cohere | Command | Text generation, summarization |
| Meta | Llama 2 | Open-source, customizable |
| Stability AI | Stable Diffusion | Image generation |
Use Cases:
- Chatbots and virtual assistants
- Content generation
- Document summarization
- Code generation
- Image generation
Amazon Q โ
AI-powered assistant for business
Capabilities:
- Answer questions about your business data
- Generate content
- Summarize documents
- Connect to enterprise data sources
Use Cases:
- Internal knowledge base queries
- Customer support
- Employee assistance
- Business intelligence
Amazon CodeWhisperer โ
AI coding companion
Features:
- Real-time code suggestions
- Supports multiple languages (Python, Java, JavaScript, etc.)
- Security scanning
- Reference tracking (avoids IP issues)
Use Cases:
- Accelerate development
- Learn new APIs
- Generate boilerplate code
- Unit test generation