Exams / AIF-C01 / D4 Applications of Foundation Models
D4.2
Applications of Foundation Models (part 2 of 6)
- Exam domain: Applications of Foundation Models
Bedrock capacity and cost
| Need | Choice |
|---|---|
| Scheduled bulk job, not urgent | Batch inference: "Batch inference helps you process a large number of requests efficiently by sending a single request and generating the responses in an Amazon S3 bucket." |
| Steady, predictable traffic | Provisioned Throughput: "You can purchase Provisioned Throughput to provision a higher level of throughput for a model at a fixed cost." |
| Fine-tuned / custom model | "If you customized a model, you must purchase Provisioned Throughput to be able to use it." |
| Spiky or small usage | On-Demand (pay per token) |
- Cost levers: right-size the model per use case, and shorten the prompt (fewer few-shot examples = fewer tokens).
- Model characteristics: context window (prompt capacity), latency (time to answer), concurrency (simultaneous users).
Choosing the service (least effort)
| Requirement | Service |
|---|---|
| Build and deploy with FMs, least effort | Amazon Bedrock |
| Try gen AI cheaply, no code | Bedrock PartyRock (daily free use) |
| Fine-tune an open-source model quickly | SageMaker JumpStart |
| No-code ML for analysts | SageMaker Canvas |
| Reusable saved prompts | Bedrock Prompt management |
| Few-shot examples for an agent | Advanced prompt templates |
| Code, unit tests, docs in the IDE | Amazon Q Developer |
| Assistant over company data | Amazon Q Business |
| Enterprise search | Amazon Kendra |
| PDF/scan to text | Amazon Textract |
| Translate text | Amazon Translate |
| Medical entities in clinical text | Amazon Comprehend Medical |
| Managed human labeling / feedback | SageMaker Ground Truth Plus |
| Vector search | OpenSearch Service k-NN |
Knowledge base ingestion
Order: parse → chunk → embed → write to vector store. RAG retrieval happens after ingestion. RAG grounds answers in an authoritative knowledge base, reducing hallucinations.
SageMaker inference options
| Option | Fits |
|---|---|
| Real-time | Interactive, low latency |
| Asynchronous | "large payload sizes (up to 1GB), long processing times (up to one hour), and near real-time latency requirements." |
| Batch transform | "Get inferences from large datasets." |
Evaluation and prompting
- BLEU = translation quality; ROUGE = summarization; AUC / precision = classification.
- Evaluate classification with a benchmark dataset of labeled ground truth.
- ReAct prompting = reasoning plus tool calls (agents) for live data; few-shot = examples.
- Fine-tuning = further training on labeled task data. Start any gen AI project with measurable business goals.
Exam traps
- Weekly or nightly bulk jobs: Batch, not Provisioned Throughput.
- Custom models cannot run on-demand: Provisioned Throughput.
- Asynchronous (one big request, near real-time) vs Batch transform (whole dataset, offline).
- RAG does not speed training or inference; it reduces hallucinations.
- Guardrails filter; they do not hold examples or instructions.
Docs
- https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/batch-inference.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/prov-throughput.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/async-inference.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/batch-transform.html
- https://aws.amazon.com/what-is/retrieval-augmented-generation/
- https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/q-in-IDE-chat.html