Exams / AIF-C01 / D4 Applications of Foundation Models
D4.5
Applications of Foundation Models (part 5 of 6)
- Exam domain: Applications of Foundation Models
Customizing an FM on Amazon Bedrock
AWS advises: "Prioritize prompt engineering and RAG before model customization to" reach your goals at lower cost.
| Technique | Data | Notes |
|---|---|---|
| Prompt engineering | none | "Prompt engineering refers to the practice of optimizing textual input" |
| RAG / Knowledge Bases | your documents | "RAG is a more cost-effective approach to introducing new data to the LLM." |
| Fine-tuning | labeled | "Provide labeled data to train a model to improve performance on specific tasks." |
| Continued pre-training | unlabeled domain text | Extends pre-training; most effort |
| Distillation | teacher outputs | Transfers knowledge from a larger teacher to a smaller, faster student |
- A customized model must be served with Provisioned Throughput: "If you customized a model, you must purchase Provisioned Throughput to be able to use it."
- Knowledge base sync is incremental: "Syncing is incremental, so Amazon Bedrock only processes added, modified, or deleted documents since the last sync." Frequent changes mean RAG, not retraining.
- Vector stores for RAG include Amazon OpenSearch (Service or Serverless), Aurora and Neptune.
- Text plus image search needs a multimodal embedding model (Titan Multimodal Embeddings G1).
Agents, AgentCore and MCP
- Bedrock Agents "orchestrate interactions between foundation models (FMs), data sources," software applications and users; action groups define the actions the agent can perform. New sign-ups are closed (Agents Classic).
- AgentCore runs agents "using any framework and foundation model".
- MCP "provides a standardized way for AI applications to interact with external data and capabilities."
Evaluation and metrics
| Need | Answer |
|---|---|
| Answers every part of the prompt | Completeness (LLM-as-a-judge built-in metric) |
| RAG quality | Retrieval metrics (context relevance) and generation metrics |
| Summarization | ROUGE, BERTScore (BLEU if ROUGE is not offered) |
| Translation | BLEU |
| Human quality rating | Employees or subject-matter experts |
| Business impact | Conversion rate (revenue), average call duration (effort) |
Service picks
| Task | Service |
|---|---|
| Extract text, forms, tables from scans | Amazon Textract |
| Use FMs through one API | Amazon Bedrock |
| Serverless model hosting | SageMaker Serverless Inference |
| Cheap multimodal Nova model | Nova Lite (Micro is text only) |
| Lowest latency at the edge | Small models on the device |
| Idle Comprehend endpoints (15 days) | AWS Trusted Advisor |
| Inference cost driver | Input and output tokens |
Exam traps
- Labeled data = fine-tuning; unlabeled = continued pre-training.
- Data that changes often = RAG, never retraining.
- Temperature and logging do not add knowledge.
- BLEU is for translation, ROUGE for summarization; check which options are offered.
- Pick the business metric that matches the stated goal.
Docs
- https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models.html
- https://docs.aws.amazon.com/wellarchitected/latest/generative-ai-lens/genops05-bp01.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/prov-throughput.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/kb-data-source-sync-ingest.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/agents.html
- https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/what-is-bedrock-agentcore.html
- https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/mcp-stateful-features.html
- https://docs.aws.amazon.com/bedrock/latest/userguide/model-evaluation-metrics.html
- https://docs.aws.amazon.com/comprehend/latest/dg/manage-endpoints-trusted-advisor.html
- https://aws.amazon.com/what-is/retrieval-augmented-generation/