Exams / AIP-C01 / D1 Operational Efficiency and Optimization for GenAI Applications
D1.1
Operational Efficiency and Optimization for GenAI Applications
- Exam domain: Operational Efficiency and Optimization for GenAI Applications
You are reading a free preview. The rest of the AIP-C01 course unlocks with an Exam pass or All access.See plans
Throughput, latency and cost levers on Bedrock
| Need | Choice | Why |
|---|---|---|
| Absorb bursts, no fixed cost | Cross-Region inference (on demand) | Spreads requests across Regions; Provisioned Throughput is billed hourly |
| Stay inside a compliance boundary | Geographic inference profile (US, EU, APAC) | Routes only within the geography |
| Predictable dedicated capacity | Provisioned Throughput | Fixed cost; inference profiles do not support it |
| Interactive, sub-second responses | Latency-optimized model | Batch or large reasoning models are too slow |
| Mixed easy/hard prompts | Intelligent prompt routing | Managed endpoint predicts response quality per model |
Streaming
InvokeModelWithResponseStreamreturns the response in a stream.- API Gateway response streaming works for REST APIs (Lambda proxy); HTTP APIs do not support it.
- A WebSocket API gives a persistent connection for 15-45 s answers.
- A synchronous
RequestResponseAppSync resolver waits for the full answer: stream instead of raising timeouts.
Resilience: retries and orchestration
- AWS SDK standard mode = exponential backoff with jitter; adaptive adds client-side rate limiting (not a general default).
- Step Functions: Task, Parallel and Map states accept
RetryandCatch; use them for graceful degradation across agents.
- Independent FM calls (financial, sentiment, compliance) → Parallel state to cut batch latency.
Retrieval quality and RAG design
| Symptom | Fix |
|---|---|
| Context window overflow on long docs | Hierarchical chunking (child retrieved, parent returned) |
| Exact terms/acronyms missed | Hybrid search (keyword + vector) |
| Similar but irrelevant chunks | Reranker via rerankingConfiguration in Knowledge Bases |
| Multi-hop entity relationships | GraphRAG with Neptune Analytics |
| Paraphrased repeat queries | Semantic cache: embeddings + k-NN |
| Hallucinated summaries | RAG grounding with citations |
| Large managed vector store | OpenSearch Serverless (auto-scaling) |
- Semantic chunking buffer size is 0-1, so a value of 3 is invalid.
- Hierarchical chunking is not recommended with an S3 vector bucket store.
Agents and observability
- Multi-agent collaboration: a supervisor routes to collaborator agents, each with its own knowledge base.
- Action groups give an agent API actions; knowledge bases give RAG; trace supports auditing.
- Composite alarms apply Boolean logic over other alarms and can notify through SNS; business metrics enter CloudWatch as custom metrics.
- Bedrock evaluation jobs use custom S3 prompt datasets (RWK for generation, BERTScore for summarization).
Exam traps
- Provisioned Throughput = fixed hourly cost; "no fixed cost" points to on-demand cross-Region inference.
- Cross-Region inference with data residency needs a geographic, not global, profile.
- API Gateway HTTP APIs cannot stream the response; REST APIs can.
- Hybrid search, a reranker or a managed config beats a custom pipeline for "least overhead".
- Anomaly detection belongs to metric alarms, not composite alarms.
- Higher temperature never reduces hallucinations.
Docs
- https://docs.aws.amazon.com/step-functions/latest/dg/concepts-error-handling.html
- https://docs.aws.amazon.com/step-functions/latest/dg/state-parallel.html
- https://docs.aws.amazon.com/sdkref/latest/guide/feature-retry-behavior.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/kb-chunking.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-routing.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/prov-throughput.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/rerank.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/agents-multi-agent-collaboration.html
- https://docs.aws.amazon.com/apigateway/latest/developerguide/response-transfer-mode.html
- https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-configure-neural-search.html
- https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Create_Composite_Alarm.html