AWS-119 · Lesson 4 of 12 · 21 min
Domain 2 review: generative AI fundamentals
▶ Video coming soon A video version of this lesson is on the way.
Domain 2 carries 24 of every 100 scored points, about a dozen questions. It covers what generative AI is, what it is good and bad at, and which AWS services and infrastructure support it. Jonah learned this in AWS-112 while Noor and the emergency hospital explored after-hours call summaries: a model that turns a technician's rushed notes from a 2 a.m. phone call into a tidy summary for the morning veterinarian, without ever deciding how urgent the case is. Noor's notes for this lesson say: "Domain 2 is vocabulary plus judgment. The vocabulary must be exact, and the judgment is mostly about limits and cost."
Task 2.1: the core concepts
A token is the unit a language model reads and writes: often a word, part of a word or a punctuation mark. Models have a context window, the maximum number of tokens they can consider at once, including both the prompt and the response. Chunking means splitting long documents into smaller pieces so they can be embedded and retrieved. An embedding is a list of numbers, a vector, that represents the meaning of a piece of text, image or audio, so that items with similar meanings have vectors that are close together. Vectors can be searched by similarity, which is the basis of semantic search and retrieval augmented generation.
A foundation model is a large model trained on broad data that can be adapted to many tasks. Most language models today are transformer-based large language models, which use a mechanism called attention to weigh how each token relates to the others. Multimodal models work with more than one kind of data, such as reading an image and answering in text. Diffusion models generate images, and increasingly video, by starting from random noise and refining it step by step. Prompt engineering means designing the input, the instructions, context and examples, to get better output without changing the model.
The guide also lists the foundation model lifecycle: data selection, model selection, pre-training, fine-tuning, evaluation, deployment and feedback. Most organizations, including the veterinary group, never pre-train a model; they select an existing one and adapt it, which is why the later stages matter more to them. Two newer items appear in the current task statement. Context engineering is the practice of deciding what information goes into the model's context for each request, such as retrieved documents, conversation history, tool results and instructions, and in what form, so that the model has what it needs and nothing that misleads it. Agentic AI concepts include tool use, memory management, workflow orchestration, multi-agent patterns in which several agents with different roles cooperate, and the Model Context Protocol, or MCP, an open standard for connecting models and agents to tools and data sources in a consistent way.
Token-based pricing
Most managed foundation models are priced per token, often with different prices for input tokens and output tokens. Cost therefore depends on how long your prompts are, how much retrieved context you add, and how long the responses are. Longer context can improve answers but costs more and may slow responses. The guide expects you to describe this effect, not to calculate real prices. Noor showed Jonah a simple calculation with illustrative prices that are not AWS's actual rates.
# Illustrative prices only, not real AWS rates
price_in, price_out = 0.003, 0.015 # US dollars per 1,000 tokens
calls_per_night = 40
prompt_tokens, response_tokens = 1800, 350
per_call = prompt_tokens / 1000 * price_in + response_tokens / 1000 * price_out
print("cost per call (USD):", round(per_call, 4))
print("cost per 30 nights (USD):", round(per_call * calls_per_night * 30, 2))cost per call (USD): 0.0106 cost per 30 nights (USD): 12.78
What this code does
It estimates the cost of model calls with illustrative prices per thousand input and output tokens. The cost of one call is its prompt tokens and response tokens multiplied by their prices, and that is multiplied by 40 calls a night for 30 nights. It prints the cost per call and per month, showing that output tokens cost more per token than input tokens.
The example shows why output tokens can matter more than they first appear: the response is shorter than the prompt, but at a higher price per token it makes up a large share of the cost. It also shows that the after-hours summaries are cheap at this scale. If the same prompt were sent a million times a month, prompt length and caching would become important design choices, which domain 3 covers.
Task 2.2: capabilities and limitations
Generative AI's advantages, in the guide's words, include adaptability, responsiveness, conversational ability and content generation. One model can summarize, draft, classify, translate and answer questions, and it can be steered with instructions in plain language. Its disadvantages are just as important for the exam. A hallucination is a fluent, confident output that is false, such as an invented drug dose or a protocol that does not exist. Interpretability is limited: it is hard to explain why a large model produced a particular answer. Outputs can be inaccurate even when not invented, and they are nondeterministic, meaning the same prompt can produce different answers, especially at higher temperature settings.
These limits explain the group's rules. The after-hours summaries may reorganize what the technician wrote, but they may not add clinical facts, and a veterinarian reads the original notes for any urgent case. On the exam, when a scenario describes a high-stakes decision such as a medical, legal or financial outcome, look for answers that keep a human in the loop and ground the model in trusted sources, rather than answers that let the model decide alone.
The guide also lists factors for selecting a generative model: model type, performance, capabilities, constraints, compliance, cost, latency and complexity. Business value is measured with metrics such as return on investment, efficiency, conversion rate, average revenue per user, accuracy, customer lifetime value and cross-domain performance. The pattern on the exam is to choose the metric that matches the stated goal. If the goal is to reduce the time staff spend writing summaries, an efficiency measure such as minutes saved per shift fits better than revenue per user.
| Business goal | A fitting metric |
|---|---|
| Staff spend less time on paperwork | Efficiency: minutes saved per shift |
| More online visitors book appointments | Conversion rate |
| Clients return to the clinic for years | Customer lifetime value |
| Project pays back its cost | Return on investment |
| Answers are factually right | Accuracy, checked against trusted sources |
Task 2.3: AWS services and infrastructure
Amazon Bedrock is the fully managed service that gives access to foundation models from Amazon and other providers through one API, with features for retrieval, agents, guardrails, evaluation and customization; you do not manage servers. Amazon SageMaker AI is the broader machine learning platform for building, training, tuning and deploying models, including hosting your own. SageMaker JumpStart is a hub inside SageMaker AI with pre-trained models and solution templates that you can deploy and fine-tune. Amazon Q is a family of generative AI assistants: Amazon Q Developer helps with code and AWS tasks, and Amazon Q Business answered questions over an organization's own content but is now closed to new customers, with AWS recommending Amazon Quick in its place. The current guide also names Amazon Quick, an AWS service for business users that brings together analytics, research and AI agents and now includes what was earlier QuickSight; Kiro, an AI-assisted development environment; Strands Agents, an open-source framework for building agents in code; and Amazon Bedrock AgentCore, which provides services to deploy and operate agents securely at scale. Product details move quickly, so learn each one's purpose rather than its feature list.
The guide lists advantages of AWS generative AI services: accessibility, a lower barrier to entry, efficiency, cost-effectiveness, speed to market and alignment with business objectives. It also lists the benefits of running on AWS infrastructure: security, compliance, responsibility and safety. Cost trade-offs include responsiveness and latency, availability and redundancy, performance, regional coverage, token-based pricing, provisioned throughput and custom models. Provisioned throughput means reserving model capacity for a period for a fixed charge, which suits steady, high-volume or latency-sensitive workloads and is often required to run a customized model; on-demand, pay-per-token pricing suits variable or light use. Regional coverage matters to the group because not every model is available in every Region, and client data must stay in the United States.
Agents and multi-agent patterns
Domain 2 introduces agentic AI at the level of concepts, and domain 3 returns to it for applications. An agent is given a goal, a set of tools it may call and some form of memory. It plans steps, calls tools, reads the results and decides what to do next, repeating until the goal is met or it needs help. Memory can be short term, the context of the current task, or long term, information kept between sessions such as a client's preferred clinic. Workflow orchestration controls the order in which steps or agents run, including when a person must approve. In a multi-agent pattern, several specialized agents work together: one might gather information, another draft a response and a third check it against policy, with a supervising agent coordinating them and passing messages between them.
The Model Context Protocol matters because without a common standard every tool needs its own custom connection. With MCP, a tool or data source is described once and any compatible agent can use it. For an exam question, remember the purpose: MCP standardizes how models and agents connect to tools and data. You will not be asked to write an MCP server.
Use cases the guide names
Task 2.1 lists use cases for generative AI: image, video and audio generation; summarization; AI assistants; translation; code generation; customer service agents; search; and recommendation engines. A good exam habit is to match each scenario to the use case it describes before thinking about services. A tool that condenses after-hours call notes is summarization. A tool that answers staff questions about protocols is an AI assistant built on search. A tool that suggests the next appointment type for a pet based on its history leans toward recommendation. Naming the use case first makes it easier to spot the service and technique that fit, and to notice when an option offers the wrong kind of solution.
Domain 2 also asks why AWS services lower the barrier to entry. Managed services remove the need to buy specialized hardware, recruit a team to host models, or negotiate separately with each model provider. A small organization such as the group can experiment with several models in an afternoon, pay only for what it uses and stop if the experiment fails. That is what the guide means by accessibility, speed to market and cost-effectiveness. The benefits of AWS infrastructure, security, compliance, responsibility and safety, are the reason a privacy lead like Hannah Weiss can approve an experiment at all.
One more domain 2 idea is worth a final check: the difference between what a model knows and what it is told. A foundation model's knowledge stops at its training cut-off and covers only what was in its training data. Anything newer or private, such as the group's current protocols or a client's history, must be supplied in the context at request time, which is the job of context engineering and retrieval.
Worked problem
On-demand or provisioned throughput?
The group's after-hours summaries run about 40 times a night, with almost no use during the day. A large referral network that uses the same model for every intake call, around the clock and at high volume, also needs predictable response times. Which pricing approach suits each?
Show solution
- The group's use is light and uneven; paying per token means paying only for what is used.
- The referral network's use is steady and heavy, and it needs predictable latency.
- Provisioned throughput reserves capacity for a fixed charge over a term, which suits steady high volume.
- Custom models generally also need provisioned throughput, which would matter if either organization fine-tuned a model.
Answer: On-demand for the group; provisioned throughput for the referral network.
Common mistakes
MistakeTreating embeddings and tokens as the same thing.
InsteadTokens are pieces of text a model reads; embeddings are vectors that represent meaning.
MistakeAssuming a confident answer is a correct one.
InsteadHallucinations are fluent and confident; ground the model and keep humans in high-stakes loops.
MistakeChoosing SageMaker AI when no model needs building.
InsteadFor managed access to existing foundation models with no servers, Amazon Bedrock fits.
MistakeIgnoring output tokens when estimating cost.
InsteadOutput tokens are often priced higher than input tokens.
MistakePicking a revenue metric for an efficiency goal.
InsteadMatch the metric to the stated business goal.
Summary and key terms
- Tokens, chunking, embeddings and vectors are the building blocks of retrieval and cost.
- Foundation models are broad; LLMs are transformer-based; diffusion models generate images; multimodal models mix data types.
- Context engineering decides what goes into the model's context; MCP connects agents to tools and data.
- Generative AI is adaptable but can hallucinate, is hard to interpret and is nondeterministic.
- Bedrock gives managed access to foundation models; SageMaker AI builds and hosts models; Amazon Q is a ready-made assistant.
- On-demand pricing suits variable use; provisioned throughput suits steady high volume and custom models.
- Token
- The unit of text a language model reads or writes.
- Context window
- The maximum number of tokens a model can consider at once.
- Embedding
- A vector of numbers that represents meaning, used for similarity search.
- Hallucination
- A fluent, confident output that is false.
- Provisioned throughput
- Reserved model capacity for a term at a fixed charge.
- Model Context Protocol
- An open standard for connecting models and agents to tools and data.
Practice problems
Work each problem on paper first, then reveal the answer to check.
What makes generative AI nondeterministic?
Show answer
The same prompt can produce different outputs, especially at higher temperature.
Which AWS service offers managed API access to many foundation models?
Show answer
Amazon Bedrock.
What is chunking?
Show answer
Splitting long documents into smaller pieces for embedding and retrieval.
Which pricing suits steady, high-volume use?
Show answer
Provisioned throughput.
Name two disadvantages of generative AI from the guide.
Show answer
Any two of hallucinations, limited interpretability, inaccuracy and nondeterminism.
What does MCP stand for?
Show answer
Model Context Protocol.
Lesson quiz · 5 questions
Score 60% or more to complete this lesson.
Create a free account to save your progress, take quizzes and earn a certificate.