Domain 5: Optimize Generative AI Systems and Model Performance
This lesson covers 4 exam topics: Tuning RAG Retrieval, Embedding Models and RAG Evaluation, Fine-Tuning Methods and Synthetic Data, Fine-Tuned Models from Development to Production. Each topic has a short video, then the notes: key facts, exam traps and what to check in the official docs.
1. Tuning RAG Retrieval
Central question: Which retrieval knobs improve RAG answers?
Facts
- Hybrid search runs full-text (BM25) and vector search in one request and merges with Reciprocal Rank Fusion; the semantic ranker reranks top results.
- Integrated vectorization chunks and embeds during indexing; a vectorizer embeds queries with the same model.
Tuning knobs (design guidance)
| Knob | Effect |
|---|---|
| Chunk size/overlap | Small = precise but fragmented; large = context but diluted |
| Top k | More recall vs more noise and tokens |
| Similarity threshold | Drop weak matches to reduce off-topic context |
| Retrieval strategy | Hybrid + semantic ranker as default; agentic retrieval for complex questions |
| Filters | Metadata filters for scope and permissions |
Change one knob at a time and measure with retrieval and groundedness evaluators.
Exam traps
- Vector-only for queries with exact identifiers.
- Bigger top k to fix bad chunks.
- Tuning without metrics.
2. Embedding Models and RAG Evaluation
Central question: How do you choose embeddings and prove RAG improvements?
Facts
- RAG evaluators: Retrieval, Document Retrieval (NDCG, XDCG, Fidelity, Max Relevance, Holes with labels), Groundedness, Relevance, Response Completeness.
- The same embedding model must encode content and queries (vectorizer matches the indexing model).
Practice (design guidance)
- Embedding choice: compare candidate models on your own labeled queries (NDCG/recall); consider dimensions vs cost and storage; fine-tune or adapt embeddings for domain vocabulary when general models miss it; re-index everything after changing the model.
- A/B testing: run two configurations (chunking, embedding, ranker) on the same test set offline; then split production traffic and compare online metrics and evaluations.
Exam traps
- Changing the embedding model without re-indexing.
- Judging retrieval by answer quality only.
- A/B tests on different datasets.
3. Fine-Tuning Methods and Synthetic Data
Central question: Which fine-tuning method, with what data?
Facts
| Method | Data | Use |
|---|---|---|
| Supervised fine-tuning (SFT) | Prompt-response examples (JSONL) | Teach format, style, task behavior |
| Direct preference optimization (DPO) | Preferred vs non-preferred responses | Align to preferences |
| Reinforcement fine-tuning (RFT) | Prompts plus reference info for a grader | Improve reasoning on gradable tasks |
| Distillation | Teacher-generated SFT data | Smaller, cheaper student model |
- Provide training and validation files; hyperparameters such as epochs ("auto").
- Training tiers: Standard, Global (cheaper per token, no data residency), Developer (idle capacity, preemptible, cheapest).
- Roles: Foundry User to train; Foundry Owner to also deploy.
Synthetic data (design guidance)
Generate examples with a strong model (distillation), filter and review them, keep validation data real and separate.
Exam traps
- Fine-tuning to add changing facts. Use RAG.
- SFT when you have only preference pairs. Use DPO.
- Validation from synthetic training data.
4. Fine-Tuned Models from Development to Production
Central question: How do you take a fine-tuned model to production safely?
Facts
- Monitor training with training and validation loss and metrics from the job; use checkpoints (general background).
- Deploy the fine-tuned model as a deployment (deployment types depend on model and region; check eligibility); an adapter isn't interchangeable across similarly named base models.
- Evaluate the fine-tuned model against the base model with Foundry evaluations; monitor tokens, latency and quality in production.
Lifecycle (design guidance)
Data versioned → train in dev → evaluate vs baseline (quality + safety) → deploy to staging → gradual traffic → monitor → retrain on new data; keep the previous model deployment for rollback.
Exam traps
- Deploying without comparing to the base model.
- Overfitting: validation loss rising while training loss falls.
- No rollback deployment.
References
- AI-300 study guide — checked Oct 22, 2026
- Hybrid search — checked Oct 22, 2026
- Semantic ranking — checked Oct 22, 2026
- Integrated vectorization — checked Oct 22, 2026
- RAG evaluators — checked Oct 22, 2026
- Fine-tuning — checked Oct 22, 2026
- Fine-tuning considerations — checked Oct 22, 2026
- DPO — checked Oct 22, 2026
- RFT — checked Oct 22, 2026
Check your understanding
Merge keyword and vector results?Show answerHide answer
Answer
RRF in hybrid search.Ranking quality with labels?Show answerHide answer
Answer
Document retrieval evaluator (NDCG).Chosen vs rejected responses?Show answerHide answer
Answer
DPO.Overfitting signal?Show answerHide answer
Answer
Validation loss rising.Off-topic chunks in context?Show answerHide answer
Answer
Raise similarity threshold / rerank.