AWS AI Practitioner Exam Notes
Task Statement 2.1: Explain the Basic Concepts of Generative AI
1. What Is Generative AI?
Generative AI is a subset of artificial intelligence and deep learning that creates new content rather than only classifying existing data or making predictions.
Common generated content
- Text
- Images
- Video
- Audio
- Music
- Computer code
- 3D content
- Synthetic data
Traditional machine learning often answers questions such as:
- “Is this email spam?”
- “What category does this image belong to?”
- “What is the predicted sales amount?”
Generative AI answers questions such as:
- “Write a summary of this document.”
- “Generate an image of a sunset over the ocean.”
- “Translate this text into French.”
- “Create a Python function that sorts a list.”
Generative AI models learn statistical patterns and representations from large datasets. They use those learned patterns to generate an output that is statistically plausible based on the input.
Important: Generative AI does not retrieve and copy an answer in the same way as a traditional database query. It generates an output based on learned patterns, probabilities, and the supplied context.
2. Key Generative AI Terminology
2.1 Foundation Models
A foundation model (FM) is a large, general-purpose model trained on broad and diverse data. It can be adapted to many downstream tasks.
Examples of capabilities include:
- Text generation
- Summarization
- Question answering
- Translation
- Image generation
- Speech processing
- Code generation
Foundation models generally have:
- Large numbers of parameters
- Broad knowledge from pre-training
- The ability to perform multiple tasks
- The ability to be adapted using prompting, fine-tuning, or other techniques
AWS examples include foundation models available through:
- Amazon Bedrock
- Amazon SageMaker JumpStart
- Amazon Titan models
- Third-party models available in Amazon Bedrock
Foundation model versus traditional task-specific model
| Foundation model | Traditional task-specific model |
|---|---|
| General-purpose | Designed for a specific task |
| Trained on broad data | Often trained on focused data |
| Can perform multiple tasks | Usually performs one primary task |
| Can be prompted or fine-tuned | Often requires task-specific training |
| Examples: text, image, multimodal FMs | Examples: fraud classifier, demand predictor |
2.2 Large Language Models
A large language model (LLM) is a foundation model specialized in understanding and generating language.
LLMs learn relationships between words, tokens, phrases, and larger structures such as:
- Sentences
- Paragraphs
- Documents
- Conversations
- Programming code
An LLM commonly generates text by predicting the next likely token based on the preceding tokens and the available context.
For example, given:
“The capital of France is”
The model may assign a high probability to:
“Paris”
An LLM does not “think” exactly like a human. It performs statistical computations using learned parameters.
Transformer-based LLMs
Most modern LLMs use the transformer architecture, introduced in the 2017 research paper Attention Is All You Need.
Transformers use attention mechanisms to determine which parts of the input are most relevant when producing each output token.
Advantages of transformers include:
- Effective handling of long-range relationships
- Parallelized processing during training
- Strong performance across language tasks
- Scalability to very large models
2.3 Parameters
Parameters are numerical values learned during model training. They represent patterns learned from the training data.
A model with more parameters may be able to represent more complex relationships, but larger is not automatically better for every use case.
Larger models generally require:
- More memory
- More compute
- More storage
- More time to train
- Potentially higher inference cost
A smaller model may be preferable when:
- The task is narrow
- Low latency is important
- Cost must be minimized
- The application runs on constrained infrastructure
Exam trap: More parameters can increase capability, but also increase cost, latency, and infrastructure requirements.
2.4 Prompt
A prompt is the input provided to a generative AI model.
A prompt may contain:
- Instructions
- Questions
- Background information
- Examples
- Constraints
- Output formatting requirements
- Retrieved documents
- Conversation history
Example:
Summarize the following document in five bullet points.
Use language suitable for a nontechnical audience.
[Document text]
Prompts can be used with multiple modalities, including:
- Text prompts for LLMs
- Text-to-image prompts
- Audio prompts
- Image and video inputs for multimodal models
2.5 Completion
A completion is the output generated by a model in response to a prompt.
Depending on the model, a completion may be:
- A text answer
- A summary
- A translation
- Source code
- An image
- A video
- Audio
- A structured JSON response
The model generates the completion during inference.
2.6 Inference
Inference is the process of using a trained model to generate a prediction or output.
For generative AI:
- The application sends a prompt and any additional context.
- The model processes the input.
- The model generates a completion.
- The application returns or uses the result.
Inference is different from training:
| Training | Inference |
|---|---|
| Learns model parameters | Uses existing parameters |
| Usually computationally intensive | Usually faster than training |
| Uses training data and loss functions | Uses prompts and context |
| Updates model weights | Normally does not update model weights |
2.7 Tokens
A token is a unit of text processed by a language model.
A token may represent:
- A complete word
- Part of a word
- A punctuation mark
- A number
- A whitespace pattern
- A special symbol
For example, a word may be represented as one token, while a less common or longer word may be split into multiple tokens.
Tokenization depends on the model and tokenizer. Therefore, token count is not exactly the same as word count.
Why tokens matter
Tokens affect:
- Context-window usage
- Input and output pricing
- Inference latency
- Maximum prompt and response length
- Model performance
A request may contain:
- Input tokens: the prompt and supplied context
- Output tokens: the generated completion
Some AWS model pricing is based on the number of input and output tokens processed.
Exam trap: Tokens are not always words. One word can contain multiple tokens, and one token can sometimes represent part of a word or punctuation.
2.8 Tokenizer and Token IDs
A tokenizer converts raw text into tokens that the model can process.
A simplified process is:
Human text → tokens → token IDs → embeddings → model computation
Each token is mapped to an integer called a token ID or input ID. The token ID identifies the token in the model’s vocabulary.
Important distinction
- Token ID: An integer identifier for a token
- Embedding: A learned, high-dimensional numerical representation of a token or other entity
The transcript describes token IDs as vectors in places, but for exam understanding these should be distinguished carefully.
2.9 Vocabulary
A model’s vocabulary is the collection of tokens that its tokenizer understands.
A vocabulary can contain:
- Words
- Word fragments
- Numbers
- Punctuation
- Special tokens
The tokenizer determines how a sentence is broken into tokens, and the vocabulary determines the available token IDs.
2.10 Embeddings
An embedding is a numerical vector representation of an entity, such as:
- A word
- A phrase
- A sentence
- A document
- An image
- An audio clip
- A product
- A user profile
Embeddings encode semantic meaning and relationships.
Items with similar meanings tend to be located close to one another in embedding space. For example:
- “automobile” and “car” may have similar embeddings.
- Documents about billing may be close to other billing-related documents.
Embeddings are useful for:
- Semantic search
- Retrieval-augmented generation
- Recommendation systems
- Document clustering
- Similarity matching
- Classification
- Duplicate detection
Example
A document can be converted into an embedding and stored in a vector database. When a user asks a question:
- Convert the question into an embedding.
- Search for nearby document embeddings.
- Retrieve the most relevant chunks.
- Add those chunks to the prompt.
- Ask the foundation model to generate an answer.
2.11 Vectors and Vector Databases
A vector is an ordered list of numbers.
Example:
[0.12, -0.43, 0.87, 0.05, ...]
The vector represents a point in a high-dimensional mathematical space.
A vector database stores vectors and supports similarity searches. Common similarity methods include:
- Cosine similarity
- Euclidean distance
- Dot-product similarity
A vector database is not primarily searching for exact keyword matches. It is searching for semantically similar representations.
Exam distinction
| Keyword search | Vector search |
|---|---|
| Looks for matching words | Looks for semantic similarity |
| Exact or lexical matching | Meaning-based matching |
| May miss synonyms | Can find related concepts |
| Often uses inverted indexes | Uses embeddings and similarity search |
2.12 Chunking
Chunking is the process of splitting large documents into smaller sections before creating embeddings or placing content into a prompt.
Documents may be chunked by:
- Number of tokens
- Paragraphs
- Sentences
- Headings
- Sections
- Semantic boundaries
- Fixed-size windows with overlap
Why chunking is needed
Large documents may exceed the model’s context window. Chunking allows the application to:
- Process large documents
- Retrieve only relevant portions
- Reduce input token usage
- Improve retrieval precision
- Reduce unnecessary context
Chunk overlap
A small overlap between chunks can preserve context when an important sentence spans a chunk boundary.
Chunking trade-offs
| Chunk too small | Chunk too large |
|---|---|
| May lose context | May contain irrelevant information |
| More chunks to search | Higher token cost |
| May make retrieval fragmented | May exceed context limits |
| Can reduce answer quality | Can reduce retrieval precision |
Exam trap: Chunking is not model training. It is usually a data-preparation or retrieval step used to manage context and improve relevance.
3. Prompt Engineering and In-Context Learning
3.1 Prompt Engineering
Prompt engineering is the practice of designing and refining prompts to obtain more accurate, useful, safe, and consistently formatted outputs.
Prompt engineering can include:
- Clearly describing the task
- Providing relevant context
- Specifying the intended audience
- Defining the output format
- Adding constraints
- Providing examples
- Asking the model to follow a particular role
- Instructing the model to identify uncertainty
- Refining the prompt based on evaluation results
Example
Weak prompt:
Summarize this.
Improved prompt:
Summarize the following policy in five bullet points.
Use plain language for new employees.
Include deadlines and required actions.
Do not add information that is not present in the policy.
3.2 Zero-Shot, One-Shot, and Few-Shot Prompting
Zero-shot prompting
The model receives an instruction without examples.
Classify this review as positive, neutral, or negative:
“The product arrived early and works perfectly.”
One-shot prompting
The prompt provides one example.
Review: “The delivery was late.”
Sentiment: Negative
Review: “The product arrived early and works perfectly.”
Sentiment:
Few-shot prompting
The prompt provides multiple examples.
In-context examples help the model infer:
- The desired task
- The expected format
- The classification labels
- The style or tone
- The level of detail
This is called in-context learning.
Exam trap: In-context learning does not necessarily update the model’s weights. The model is adapting its response based on examples in the prompt, not being permanently retrained.
4. Context Windows and Context Engineering
4.1 Context Window
A context window is the maximum amount of input and output content that a model can process in a single request.
It may include:
- System instructions
- User prompt
- Conversation history
- Retrieved documents
- Tool results
- Examples
- Generated output
Context-window capacity is measured in tokens.
If the total content exceeds the context window:
- Some content may need to be removed
- The request may fail
- The application may summarize or truncate information
- The model may lose important context
4.2 Context Engineering
Context engineering is the broader design of the information supplied to a foundation model at inference time.
It includes deciding:
- What information to provide
- Which information to retrieve
- How to organize the information
- How to prioritize information
- How to manage conversation history
- Which tools and tool results to include
- How to fit useful information within the context window
Prompt engineering focuses primarily on wording and instructions. Context engineering focuses on the entire information environment supplied to the model.
Context engineering techniques
- Retrieve relevant documents instead of sending an entire knowledge base
- Chunk documents appropriately
- Rank retrieved information by relevance
- Summarize older conversation history
- Remove duplicate or irrelevant content
- Use structured formats such as JSON or XML
- Clearly separate instructions from reference material
- Include source citations or document identifiers
- Manage tool outputs to avoid overwhelming the context window
- Use short, focused system instructions
Why context engineering matters
Better context can improve:
- Accuracy
- Relevance
- Grounding
- Consistency
- Latency
- Cost
Exam tip: If the question asks how to improve an FM application without retraining the model, consider prompt engineering, context engineering, retrieval, or tool use before fine-tuning.
5. Transformer Architecture
5.1 Self-Attention
The key innovation of transformers is the self-attention mechanism.
Self-attention allows the model to determine how important each input token is in relation to other tokens.
For each token, the mechanism uses:
- Query
- Key
- Value
Attention scores are calculated using relationships between queries and keys. The values are then combined using those attention weights.
The result is a context-aware representation of each token.
Why attention is useful
It helps the model understand relationships such as:
- Pronouns and the nouns they refer to
- Important words in a long sentence
- Relationships between distant parts of a document
- The meaning of a word based on surrounding words
5.2 Positional Information
Transformers process tokens in parallel, so they need a way to understand token order.
Positional encodings or position embeddings provide information about the location of tokens in a sequence.
This helps distinguish between:
The dog chased the cat.
and:
The cat chased the dog.
The same words appear, but their order changes the meaning.
5.3 Encoder and Decoder
A transformer can contain:
- An encoder
- A decoder
- Both encoder and decoder components
Encoder
Processes input and creates contextual representations.
Often useful for:
- Understanding text
- Classification
- Embedding generation
- Information extraction
Decoder
Generates output tokens, often one token at a time.
Often used for:
- Text generation
- Chatbots
- Code generation
- Completion tasks
Some modern models are encoder-only, decoder-only, or encoder-decoder architectures.
Exam tip: You generally do not need to memorize low-level transformer mathematics for the AWS AI Practitioner exam. Understand self-attention, token processing, positional information, and generation.
6. Unimodal and Multimodal Models
6.1 Unimodal Models
A unimodal model works primarily with one type of data.
Examples:
- Text input and text output
- Image input and image output
- Audio input and audio output
A traditional text-only LLM is an example of a unimodal generative AI model.
6.2 Multimodal Models
A multimodal model can process or generate multiple data types, such as:
- Text
- Images
- Audio
- Video
Examples of multimodal tasks include:
- Image captioning
- Visual question answering
- Text-to-image generation
- Image-to-text extraction
- Speech transcription
- Text-to-speech
- Video understanding
- Audio and image reasoning
Common use cases
- Customer service with image upload
- Medical image analysis
- Product design
- Marketing content
- Digital assistants
- Avatars
- Accessibility tools
- Visual search
- Document understanding
Exam trap: Multimodal does not simply mean “a model produces multiple outputs.” It means the model can work with multiple data modalities, potentially in combination.
7. Diffusion Models
A diffusion model is a class of generative model commonly used for generating images, audio, and other content.
Diffusion models learn to reverse a gradual noising process.
7.1 Forward Diffusion
During forward diffusion:
- Clean training data is gradually corrupted.
- Noise is added over multiple steps.
- The original data eventually becomes mostly random noise.
7.2 Reverse Diffusion
During reverse diffusion:
- The model starts with random noise.
- It predicts and removes noise over multiple steps.
- The output gradually becomes a coherent image, audio clip, or other object.
The denoising process can be conditioned on information such as:
- A text prompt
- An image
- A mask
- A class label
- Other guidance
7.3 Stable Diffusion
Stable Diffusion performs the diffusion process in a lower-dimensional latent space rather than directly in the full pixel space.
This can improve efficiency compared with performing all operations directly on image pixels.
Common applications include:
- Text-to-image generation
- Image-to-image generation
- Inpainting
- Image editing
- Image upscaling
Diffusion model advantages
Diffusion models are often associated with:
- High-quality outputs
- Good diversity
- Strong image-generation performance
- Flexible conditioning
- Stable training compared with some alternatives
Related architectures
| Architecture | General characteristics |
|---|---|
| Transformers | Strong sequence and language modeling; attention-based |
| GANs | Generator competes with discriminator; can produce realistic outputs but may be difficult to train |
| VAEs | Learn a latent representation; useful for generation and representation learning |
| Diffusion models | Generate content by iterative denoising |
Exam trap: Diffusion models do not generate an image by simply copying an image from a database. They learn a denoising process and generate content from noise, often conditioned on a prompt.
8. Generative AI Use Cases
Text generation and transformation
- Writing
- Rewriting
- Editing
- Tone adjustment
- Personalized content
- Technical-to-plain-language conversion
Summarization
- Legal documents
- Financial reports
- News articles
- Meeting transcripts
- Technical documentation
- Customer interactions
Summarization can be:
- Extractive: selects existing text
- Abstractive: generates a new summary using the source content
Question answering
- Internal knowledge assistants
- Product support
- Policy lookup
- Technical support
- Documentation assistants
Translation
- Text translation
- Speech translation
- Multilingual chat
- Code translation
Code generation
- Code completion
- Function generation
- Test generation
- Documentation generation
- Bug explanation
- Code translation between languages
AWS examples include:
- Amazon Q Developer
- Amazon Bedrock foundation models
Customer service and conversational agents
- Chatbots
- Contact-center assistance
- Agent response suggestions
- Case summarization
- Automated customer-service workflows
Search
Generative AI can improve search by:
- Understanding natural-language questions
- Performing semantic search
- Summarizing results
- Providing conversational answers
- Combining search with enterprise data
Recommendation engines
Generative AI can support:
- Personalized product recommendations
- Content recommendations
- Personalized marketing
- Product descriptions
- Customer segmentation
Image, video, and audio generation
- Advertising and marketing
- Product concept design
- Image editing
- Music generation
- Voice generation
- Video creation
- Virtual production
- Digital avatars
- Accessibility services
Information extraction and classification
- Extracting entities from documents
- Categorizing customer requests
- Identifying harmful content
- Contract analysis
- Invoice processing
- Sentiment analysis
Exam tip: Generative AI can perform classification and extraction too, even though its defining characteristic is content generation.
9. Foundation Model Lifecycle
The exam identifies the following lifecycle stages:
- Data selection
- Model selection
- Pre-training
- Fine-tuning
- Evaluation
- Deployment
- Feedback
The lifecycle is iterative rather than strictly linear.
9.1 Define the Use Case and Scope
Before selecting a model, define:
- Business objective
- Users
- Required input and output
- Accuracy requirements
- Latency requirements
- Cost constraints
- Safety requirements
- Data sensitivity
- Compliance requirements
- Required modalities
- Whether the application needs tools or external data
A narrow, well-defined task can often use:
- A smaller model
- Prompt engineering
- Retrieval
- Fine-tuning on a focused dataset
Exam tip: Clearly scoping the use case can reduce training, inference, and infrastructure costs.
9.2 Data Selection
Data selection involves determining what data is appropriate for the model and use case.
Consider:
- Data quality
- Relevance
- Diversity
- Quantity
- Accuracy
- Bias
- Duplicates
- Personally identifiable information
- Copyright and licensing
- Toxic or harmful content
- Data freshness
- Representation of target users and tasks
Public internet data generally requires filtering, cleaning, deduplication, and quality curation before training.
9.3 Model Selection
Choose whether to:
- Use an existing foundation model
- Use a smaller specialized model
- Fine-tune an existing model
- Train a model from scratch
Factors include:
- Modality
- Task requirements
- Model quality
- Context-window size
- Latency
- Cost
- Deployment options
- Data residency
- Safety controls
- Customization capability
Using an existing foundation model is generally faster and less expensive than training a model from scratch.
9.4 Pre-Training
Pre-training teaches a model broad patterns using a very large dataset.
For language models, pre-training may involve predicting missing or next tokens.
During pre-training:
- Data is passed through the model.
- The model generates predictions.
- A loss function measures error.
- Model weights are updated.
- The process repeats over large amounts of data.
Pre-training typically requires:
- Large datasets
- Significant compute
- GPUs or other accelerators
- Distributed training
- Data cleaning and curation
- Extensive time and cost
Pre-training creates broad general capabilities but does not necessarily make the model ideal for a specific business task.
9.5 Fine-Tuning
Fine-tuning adapts a pre-trained model to a specific task, domain, style, or behavior using additional data.
Examples:
- Legal document classification
- Medical summarization
- Company-specific writing style
- Industry terminology
- Customer-service response format
Fine-tuning generally requires less data and compute than pre-training from scratch.
It may be appropriate when:
- Prompting is not sufficient
- Consistent behavior is required
- The task is specialized
- The model must learn a particular output format or domain style
Exam trap: Fine-tuning changes model parameters. In-context learning generally does not.
9.6 Alignment and Human Feedback
Models can be further adapted to improve helpfulness, safety, and alignment with human preferences.
One technique is reinforcement learning from human feedback (RLHF).
Human reviewers provide feedback on model outputs. That feedback helps train the model to produce outputs that better match desired preferences.
Alignment may address:
- Helpfulness
- Harmlessness
- Truthfulness
- Refusal behavior
- Tone
- Safety
- Policy compliance
9.7 Evaluation
Evaluation determines whether a model meets technical, business, and safety requirements.
Evaluate:
- Accuracy
- Relevance
- Fluency
- Factuality
- Groundedness
- Toxicity
- Bias
- Hallucination rate
- Robustness
- Latency
- Cost
- User satisfaction
- Task-specific metrics
Evaluation should use:
- Representative test data
- Benchmarks
- Human review
- Automated metrics
- Adversarial testing
- Safety testing
Exam tip: Evaluation is not a one-time final step. It should occur throughout development and after deployment.
9.8 Deployment
Deployment makes the model available to an application or users.
Deployment considerations include:
- Inference infrastructure
- Scaling
- Availability
- Latency
- Security
- Access control
- Monitoring
- Cost optimization
- Model versioning
- Data protection
- Guardrails
AWS-managed services such as Amazon Bedrock can simplify access to foundation models without requiring an organization to manage the underlying model infrastructure.
9.9 Feedback and Iteration
After deployment, collect feedback such as:
- User ratings
- Corrections
- Failed queries
- Safety incidents
- Latency data
- Cost data
- Commonly unanswered questions
- Hallucination reports
Feedback may lead to:
- Prompt changes
- Better retrieval
- Improved chunking
- Fine-tuning
- Model replacement
- New evaluation tests
- Updated guardrails
- Application workflow changes
10. Token-Based Pricing and Its Effect on Cost and Performance
Many generative AI model providers charge based on tokens processed.
Costs may be separated into:
- Input-token cost
- Output-token cost
- Sometimes cached-token or batch-processing cost
- Other service-specific charges
Input tokens can include
- User prompt
- System instructions
- Conversation history
- Retrieved documents
- Few-shot examples
- Tool results
Output tokens include
- The generated response
- Generated code
- Structured output
- Explanations
Cost relationship
A simplified formula is:
Total inference cost =
(input tokens × input price)
+
(output tokens × output price)
The exact pricing depends on the selected AWS service and model.
How tokens affect cost
Costs increase when you:
- Send long prompts
- Include unnecessary conversation history
- Retrieve too many document chunks
- Use many few-shot examples
- Request unnecessarily long responses
- Use a larger or more expensive model
- Make repeated agent/tool calls
How tokens affect performance
More tokens can:
- Increase processing time
- Increase latency
- Increase memory requirements
- Increase the probability of exceeding the context window
- Improve answer quality when the additional context is relevant
- Reduce answer quality when the context is irrelevant or contradictory
Cost and performance optimization
- Keep prompts concise
- Limit output length
- Retrieve only relevant chunks
- Summarize old conversation history
- Use appropriate chunk sizes
- Select a smaller model when suitable
- Use caching where available
- Use batch inference for suitable workloads
- Avoid unnecessary agent loops
- Use structured outputs
- Monitor token usage
Exam trap: More context does not always produce better results. Irrelevant context increases cost and may reduce model accuracy.
11. Foundational Agentic AI Concepts
Agentic AI applications use models to perform multi-step tasks, make decisions, use tools, and interact with external systems.
An agent may:
- Interpret a user goal.
- Plan one or more steps.
- Select tools.
- Call external systems.
- Inspect tool results.
- Adjust its plan.
- Produce a final response or complete an action.
An LLM by itself generally generates text. An agent system adds capabilities such as tools, memory, planning, state, and workflow control.
11.1 Tool Usage
Tools allow an agent to interact with systems outside the model.
Examples:
- Search engines
- Databases
- APIs
- Calculators
- Ticketing systems
- Inventory systems
- Payment services
- Calendar systems
- Code execution environments
- Internal enterprise applications
A tool definition typically describes:
- Tool name
- Purpose
- Input parameters
- Required parameter types
- Expected output
- Permissions
Important safety considerations
- Validate tool inputs
- Limit permissions
- Require confirmation for high-impact actions
- Log tool calls
- Handle failures and timeouts
- Protect credentials
- Prevent unauthorized data access
Exam trap: An LLM does not automatically have access to current databases, private systems, or the internet. It needs retrieval or tools to access external information.
11.2 Memory Management
Agent memory allows an application to retain useful information across interactions or steps.
Short-term memory
Information within the current interaction, such as:
- Current prompt
- Conversation history
- Recent tool results
- Current task state
Long-term memory
Information retained across sessions, such as:
- User preferences
- Previous decisions
- Persistent task state
- Organizational knowledge
Memory may be implemented using:
- Conversation stores
- Databases
- Vector stores
- Summaries
- Structured user profiles
Memory challenges
- Context-window limits
- Outdated information
- Incorrect memories
- Privacy concerns
- Excessive storage
- Conflicting facts
Memory should be selectively stored, retrieved, updated, and deleted.
11.3 Workflow Orchestration
Workflow orchestration coordinates the steps of an agentic application.
It may control:
- Which model is called
- Which tool is invoked
- The order of operations
- Retry behavior
- Error handling
- Human approval
- Parallel execution
- State transitions
- Completion criteria
A deterministic workflow may be preferable when the process must be predictable. An autonomous agent may be useful when the steps are not known in advance.
AWS services that can support orchestration include:
- AWS Step Functions
- AWS Lambda
- Amazon Bedrock agent capabilities
- Event-driven AWS services
- Amazon SQS or Amazon EventBridge for decoupling and coordination
11.4 Multi-Agent Systems
A multi-agent system uses multiple specialized agents instead of one general agent.
Each agent may have a distinct role, such as:
- Research agent
- Planning agent
- Data-analysis agent
- Writing agent
- Verification agent
- Customer-service agent
- Compliance agent
Common multi-agent patterns
Supervisor pattern
A supervisor agent delegates tasks to specialized agents and combines their results.
User → Supervisor → Specialist agents → Supervisor → User
Useful when:
- A central coordinator is needed
- Tasks require different expertise
- Results need to be consolidated
Sequential pattern
Agents execute in a fixed sequence.
Research → Analysis → Drafting → Review
Useful when each stage depends on the previous stage.
Parallel pattern
Multiple agents perform independent tasks simultaneously.
Research agent ┐
Analysis agent ├→ Aggregator
Review agent ┘
Useful when tasks are independent and latency matters.
Handoff pattern
One agent transfers responsibility to another agent based on the task or current state.
Example:
- General support agent → Billing agent
- Billing agent → Escalation agent
Debate or critic pattern
One agent generates an answer and another agent critiques or verifies it.
Useful for:
- Quality control
- Fact checking
- Safety review
- Reducing unsupported claims
Multi-agent trade-offs
Benefits:
- Specialization
- Modularity
- Parallelism
- Easier ownership of components
Costs and risks:
- More model calls
- Higher latency
- Higher token cost
- More complex state management
- Communication failures
- Conflicting agent outputs
- More difficult debugging
Exam tip: Use multiple agents when specialization or workflow complexity justifies the added orchestration overhead. Do not assume multi-agent architectures are always better.
11.5 Multi-Agent Communication Patterns
Agents may communicate through:
- Direct messages
- Shared state
- A central coordinator
- Events or queues
- Shared databases
- Structured task results
Communication should define:
- Message format
- Sender and receiver
- Task ownership
- State and status
- Error handling
- Completion conditions
- Authorization
Structured communication, such as JSON, can make agent interactions more reliable than unrestricted natural-language messages.
11.6 Model Context Protocol
The Model Context Protocol (MCP) is an open protocol for connecting AI applications or agents to external tools, data sources, and systems using standardized interfaces.
MCP can help an agent discover and interact with:
- Files
- Databases
- APIs
- Business applications
- Development tools
- Enterprise information sources
Role of MCP
MCP provides a standardized way to expose capabilities and context to models, reducing the need to build a separate custom integration for every model or application.
A simplified relationship is:
AI application or agent
↓
MCP client
↓
MCP server
↓
External tools, data, or systems
MCP benefits
- Standardized integrations
- Reusable tool connections
- Tool discovery
- Structured access to external context
- Easier interoperability between AI clients and tools
MCP considerations
MCP does not automatically make an external system safe. Applications still need:
- Authentication
- Authorization
- Input validation
- Output filtering
- Logging
- Data privacy controls
- Least-privilege access
- Human approval for sensitive actions
Exam trap: MCP is a connection and interoperability protocol. It is not a foundation model, an embedding model, or a replacement for identity and access management.
12. Important AWS Services and Examples
Amazon Bedrock
A fully managed service providing access to foundation models through APIs.
Useful for:
- Text generation
- Chatbots
- Summarization
- RAG applications
- Agents
- Guardrails
- Model evaluation
- Model customization
Amazon Titan
A family of AWS foundation models that can support tasks such as:
- Text generation
- Embeddings
- Image generation
Amazon SageMaker
A managed machine learning service used to:
- Build models
- Train models
- Fine-tune models
- Deploy models
- Monitor models
- Manage machine learning workflows
SageMaker JumpStart
Provides access to pre-trained models and solution templates that can be used, customized, and deployed.
Amazon Q Developer
An AI-powered developer assistant that can support:
- Code suggestions
- Code completion
- Code generation
- Code explanation
- Code transformation
Amazon Sumerian
Supports virtual production and 3D experiences.
13. Common Exam Traps and Distinctions
Trap 1: Token IDs versus embeddings
- Token IDs are integer identifiers.
- Embeddings are high-dimensional numerical representations.
- The tokenizer creates token IDs; the model’s embedding layer maps IDs to embeddings.
Trap 2: Prompting versus fine-tuning
- Prompting supplies instructions at inference time.
- Fine-tuning changes model parameters using additional training data.
- In-context learning uses examples in the prompt and generally does not change weights.
Trap 3: Training versus inference
- Training learns or updates parameters.
- Inference uses the trained model to generate an output.
Trap 4: More tokens are not always better
More context may improve accuracy when relevant, but it also increases cost and latency. Irrelevant context can harm performance.
Trap 5: Multimodal versus multimodel
- Multimodal: one model or system handles multiple data types.
- Multi-agent or multi-model: multiple models or agents cooperate.
- These are different concepts.
Trap 6: Model knowledge versus current external data
A foundation model’s training data may be outdated or may not contain private enterprise information. Use retrieval or tools to provide current and private data.
Trap 7: Hallucination
A model can produce plausible but incorrect information. Common mitigations include:
- Retrieval grounding
- Better prompts
- Tool verification
- Fine-tuning
- Evaluation
- Guardrails
- Human review
No single technique guarantees that hallucinations are eliminated.
Trap 8: Large model versus best model
The largest model may not be the best choice. Select based on:
- Use case
- Quality
- Cost
- Latency
- Context needs
- Modality
- Security
- Deployment requirements
Trap 9: Diffusion process
- Forward diffusion adds noise.
- Reverse diffusion removes noise.
- Stable Diffusion operates in latent space rather than directly in pixel space.
Trap 10: Agent versus chatbot
A chatbot may only generate responses. An agent can plan, use tools, access data, maintain state, and take actions.
14. Quick Exam Review
Remember these relationships:
Text
↓
Tokenizer
↓
Tokens and token IDs
↓
Embedding layer
↓
Vectors/embeddings
↓
Transformer attention layers
↓
Probability distribution over next tokens
↓
Completion
Remember the FM lifecycle:
Data selection
→ Model selection
→ Pre-training
→ Fine-tuning
→ Evaluation
→ Deployment
→ Feedback
Remember the major concepts:
- Generative AI creates new content.
- Foundation models are broad, reusable models.
- LLMs specialize in language.
- Transformers use self-attention.
- Tokens are the units processed and often billed.
- Embeddings represent meaning numerically.
- Vectors support semantic similarity search.
- Chunking divides large content into manageable pieces.
- Prompt engineering improves instructions and outputs.
- Context engineering manages all information supplied to the model.
- Multimodal models process multiple data types.
- Diffusion models generate content through iterative denoising.
- Agents use tools, memory, planning, and workflows.
- Multi-agent systems use multiple specialized agents.
- MCP standardizes connections between AI applications and external tools or data.
- More context can improve quality but increases cost and latency.
- Evaluation and feedback are continuous parts of the lifecycle.