Domain 4: Operational Efficiency and Optimization for GenAI Applications
This lesson covers 4 exam topics: Token Efficiency and Cost-Effective Model Selection, Throughput, Scaling and Caching, Latency and Retrieval Performance, Monitoring and Observability for GenAI. Each topic has a short video, then the notes: key facts, exam traps and what to check in the official docs.
1. Token Efficiency and Cost-Effective Model Selection
Central question: How do you spend fewer tokens and pick the cheapest model that is good enough?
Token efficiency (4.1.1; guide examples, design guidance)
| Technique | Effect |
|---|---|
| Token estimation and tracking | Know cost per request; CloudWatch token metrics per model |
| Context window optimization / pruning | Send only relevant chunks and recent turns |
| Prompt compression | Shorter instructions, no repetition |
| Response size controls | Max tokens, "answer in 3 bullets", structured output |
Cost-effective model selection (4.1.2)
- Cost–capability trade-off: price-to-performance on your evaluation set.
- Tiered usage by query complexity: small model for simple queries, large for hard ones (cascading or intelligent prompt routing, verified: routes within a model family by predicted quality).
- Inference cost vs response quality: measure both; stop when extra quality isn't worth it.
- Pricing levers (verified): batch ~50% lower, Flex 50% off Standard, Priority +75%, provisioned throughput hourly, prompt caching cuts repeated input cost.
Exam traps
- Ignoring output tokens.
- Largest model for all traffic.
- Stuffing whole documents into every prompt.
2. Throughput, Scaling and Caching
Central question: How do you serve more requests per second, and skip model calls you don't need?
Throughput and capacity (4.1.3, 4.2.3, 4.2.5)
- Batching: Bedrock batch inference for offline volume; batch embedding generation.
- Capacity planning in tokens per minute (and requests per minute for embedding models — verified).
- Concurrency management: queue (SQS) and cap concurrent invocations to stay inside quotas.
- Provisioned throughput for steady, guaranteed capacity; monitor utilisation to right-size model units.
- Auto-scaling SageMaker AI endpoints on GenAI-aware metrics (for example concurrent requests or GPU utilisation).
Caching (4.1.4; guide examples)
| Cache | Hit when |
|---|---|
| Prompt caching (Bedrock) | The same long prefix repeats; lower latency and input cost (verified) |
| Deterministic request hashing / result fingerprinting | Identical request → return the stored answer |
| Semantic caching | A similar question was answered before (embedding similarity in a vector-capable cache) |
| Edge caching | Static or common answers near users (CloudFront) |
Cache only where answers are safe to reuse; respect personalisation and freshness (design guidance).
Exam traps
- Retrying throttled calls without a queue.
- Semantic cache for personalised answers, leaking one user's answer to another.
- Provisioned throughput left idle.
3. Latency and Retrieval Performance
Central question: How do you make responses feel fast and retrieval sharp?
Responsiveness (4.2.1)
| Technique | Notes |
|---|---|
| Response streaming | Users see tokens immediately |
| Latency-optimized inference | Set performanceConfig.latency to optimized for supported models; in preview, limited models and Regions; falls back to standard (verified) |
| Pre-computation | Generate answers to predictable queries ahead of time |
| Parallel requests | Run independent sub-tasks concurrently |
| Benchmarking | Measure time-to-first-token and total latency |
Retrieval performance (4.2.2, 4.2.6)
- Index optimization (sharding, HNSW settings in OpenSearch), query preprocessing, hybrid search with custom scoring, reranking (verified: reranker reorders by relevance).
- Vector database query optimization and metadata filters to search less.
Model parameters (4.2.4)
- Tune temperature, top-k, top-p to requirements (low for extraction, higher for ideation) (verified definitions).
- A/B test configurations before rolling out.
Exam traps
- Assuming latency-optimized inference is GA everywhere. It's preview, specific models and Regions.
- Sequential calls for independent steps.
- Retrieving 100 chunks when 5 reranked ones suffice.
4. Monitoring and Observability for GenAI
Central question: What do you watch in a GenAI app that you wouldn't watch in a normal app?
CloudWatch generative AI observability
- Pre-configured views of latency, usage and errors; end-to-end prompt tracing across knowledge bases, tools and models.
- Model Invocations dashboard: model usage, token consumption, and a curated invocation-logs table of inputs and outputs.
- AgentCore agents view: metrics for agents, memory, built-in tools, gateways and identity.
- Third-party model traces via the ADOT SDK.
What to monitor (guide examples)
| Area | Metrics |
|---|---|
| Cost | Token usage per model, team, feature; cost anomaly detection |
| Quality | Prompt effectiveness, hallucination rate, response quality, response drift |
| Behaviour | Token burst anomalies, model behaviour patterns |
| Tools and agents | Call patterns, tool latency and errors, multi-agent coordination |
| Vector stores | Query latency, index health, data quality |
| Forensics | Model invocation logs (off by default) for request/response analysis; audit logs |
GenAI-specific troubleshooting (4.3.6)
Golden datasets to detect hallucinations, output diffing for consistency, reasoning path tracing to find logical errors.
Exam traps
- Only CPU and error-rate dashboards for an LLM app.
- No invocation logging, so bad answers can't be investigated.
- No baselines, so anomalies go unnoticed.
References
- AIP-C01 Domain 4 — checked Oct 19, 2026
- Bedrock pricing — checked Oct 19, 2026
- Prompt caching — checked Oct 19, 2026
- Intelligent prompt routing — checked Oct 19, 2026
- Titan embeddings (RPM throttling) — checked Oct 19, 2026
- Provisioned Throughput — checked Oct 19, 2026
- Batch inference — checked Oct 19, 2026
- Latency-optimized inference — checked Oct 19, 2026
- Reranking — checked Oct 19, 2026
- Inference parameters — checked Oct 19, 2026
- CloudWatch generative AI observability — checked Oct 19, 2026
- Model invocation logging — checked Oct 19, 2026
Check your understanding
Route simple prompts to a cheaper model in the same family automatically?Show answerHide answer
Answer
Intelligent prompt routing.Same FAQ asked in many wordings?Show answerHide answer
Answer
Semantic caching.Chat feels slow though total time is fine?Show answerHide answer
Answer
Stream the response.Dashboard of token use and invocation logs by model?Show answerHide answer
Answer
CloudWatch GenAI observability, Model Invocations.Cut cost of a long system prompt repeated every call?Show answerHide answer
Answer
Prompt caching.