Exams / AIF-C01 / D4 Applications of Foundation Models
D4.1
Applications of Foundation Models (part 1 of 6)
- Exam domain: Applications of Foundation Models
RAG and vector stores
Retrieval Augmented Generation adds private context to a pre-trained FM at query time, with no training.
| Step | When | Notes |
|---|---|---|
| Embed documents, build index | Offline / batch (ingestion) | "You create embeddings to ingest the internal documents into a vector database." |
| Embed query, retrieve, generate | Online, per request | Low latency path |
- Embeddings come from a text embeddings model (e.g., Amazon Titan Text Embeddings): "Text embeddings represent meaningful vector representations of unstructured text such as documents, paragraphs, and sentences."
- Vector stores: Amazon OpenSearch Service, Aurora PostgreSQL with the
pgvectorextension (DynamoDB, Redshift, Athena, EMR are not the answer). - Bedrock Knowledge Bases = managed RAG; cheapest way to use company data as context versus fine-tuning or stuffing every document into the prompt.
Customizing and steering an FM
| Need | Solution |
|---|---|
| Brand voice, audience style, role | Prompt engineering (lowest effort) |
| Reusable template with variables | Bedrock Prompt management |
| Private data as context | Knowledge Bases (RAG) |
| Call APIs, complete transactions | Bedrock Agents (action groups) |
| Learn domain from unlabeled documents | Continued pre-training |
| Pick model by subjective style | Evaluation job with human workers + custom prompts |
AgentCore resources: Runtime, Memory, Gateway, Browser (managed browser), Code Interpreter (sandboxed code), Observability (CloudWatch-powered dashboards).
Choosing a model and inference mode
| Requirement | Criterion |
|---|---|
| Real-time, strict time limit | Latency, smaller/faster model |
| Interactive chatbot or small-payload API | Real-time inference |
| Gigabytes of files offline | Batch transform ("Get inferences from large datasets.") |
| Small budget, no commitment | Bedrock On-Demand (Provisioned Throughput reserves model units billed per hour) |
| Quick FM deployment in your VPC | SageMaker JumpStart |
Service-to-use-case map
| Use case | Service |
|---|---|
| Recommendations from history | Amazon Personalize |
| Extract data from scanned documents (IDP) | Amazon Textract |
| Code and unit-test generation | Amazon Q Developer |
| Images from text | Stable Diffusion / Titan Image on Bedrock |
| Explain predictions, detect bias | SageMaker Clarify |
| Low-code data prep | SageMaker Data Wrangler |
| Document intended use, business goals | SageMaker Model Cards |
| Defect inspection from images | Computer vision |
Metrics
- ROUGE: reference-based text similarity (summaries); F1 = harmonic mean of precision and recall.
- Business metrics: CTR (engagement), AOV (purchase value), retention (returning users), cost per conversation (financial impact), average call duration (agent efficiency).
Exam traps
- Query embedding, retrieval and generation are online, never batch.
- Fine-tuning or custom models are not the "least effort"/"most cost-effective" answer when prompts or RAG suffice.
- Q Developer (coding) vs Q Business (enterprise data assistant).
- Spot Instances do not exist in Bedrock pricing; model customization is a feature, not a pricing model.
- No extra training allowed: customization is out; pick on latency/size.
Docs
- https://docs.aws.amazon.com/prescriptive-guidance/latest/retrieval-augmented-generation-options/what-is-rag.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/titan-embedding-models.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/agents.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base.html
- https://docs.aws.amazon.com/sagemaker/latest/dg/batch-transform.html
- https://aws.amazon.com/bedrock/pricing/
- https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/observability.html
- https://aws.amazon.com/textract/