Courseiva

CCNA Generative Ai Optimization Questions

27 questions · Generative Ai Optimization topic · All types, answers revealed

1
MCQmedium

You are building a generative AI assistant for a financial advisory firm using Azure OpenAI. The assistant must answer questions based on a large repository of internal policy documents that are updated frequently. You need to reduce hallucination and ensure the model cites the most current policy versions. Which approach should you implement?

A.Increase the temperature setting to encourage more creative and comprehensive answers.
B.Fine-tune the base model on the entire document repository weekly.
C.Deploy a larger model with a higher token limit to accommodate more context.
D.Use Retrieval-Augmented Generation (RAG) with Azure AI Search to retrieve relevant document chunks and include them in the prompt.
AnswerD

RAG with Azure AI Search dynamically retrieves the most relevant and current document chunks from an index that can be updated as policies change. By grounding the model's response in retrieved content, it reduces hallucination and enables citation of specific policy versions. This approach is scalable, cost-effective, and aligns with Azure OpenAI best practices for dynamic knowledge bases.

Why this answer

Retrieval-Augmented Generation with Azure AI Search retrieves up-to-date document chunks and injects them into the prompt, grounding the model's responses in current policies and reducing hallucination. This dynamic approach is ideal for frequently updated repositories, as the search index can be refreshed independently of model retraining. Other options either fail to provide current information or increase randomness.

Exam trap

The trap here is assuming that fine-tuning or a larger model automatically ensures up-to-date knowledge, when in fact dynamic retrieval is required for frequently changing documents.

2
Multi-Selecthard

Which TWO techniques should you use to improve the accuracy of a RAG pipeline?

Select 2 answers
A.Reducing the number of documents in the vector store.
B.Upgrading to a more advanced embedding model.
C.Increasing the temperature to 2.0.
D.Optimizing document chunking strategy.
E.Using only one single long chunk for all documents.
AnswersB, D

Upgrading to a more advanced embedding model improves retrieval accuracy by producing richer semantic vectors, so relevant chunks rank higher for a given query. This directly addresses the stem's accuracy constraint: better embeddings reduce irrelevant context reaching the generator, lifting grounded answer quality without changing the pipeline architecture.

Why this answer

Option B is correct because upgrading to a more advanced embedding model improves the semantic quality of the vectors used for retrieval, so semantically similar passages are matched more accurately and relevant context is more likely to be retrieved. Option D is correct because optimizing the document chunking strategy (for example, choosing appropriate chunk sizes and overlaps that preserve coherent context) directly improves retrieval precision and ensures the retrieved passages contain the information needed to ground the generated answer. Option A is not correct because simply reducing the number of documents in the vector store shrinks the knowledge base and can remove relevant content rather than improve retrieval accuracy.

Option C is not correct because increasing the temperature to 2.0 makes the model's output more random and less faithful, which harms answer accuracy rather than improving it. Option E is not correct because using one single long chunk for all documents dilutes the embedding with irrelevant content and reduces retrieval precision, so it degrades RAG accuracy.

Exam trap

AI-300 often tests the misconception that generation-side knobs like temperature or corpus size drive RAG accuracy, when the real levers are embedding quality and chunking strategy.

3
Multi-Selectmedium

Which THREE factors contribute to increased latency in an LLM application?

Select 3 answers
A.The number of system messages used.
B.The size/complexity of the chosen model.
C.The number of output tokens generated.
D.The use of JSON output mode.
E.The number of input tokens provided.
AnswersB, C, E

Larger models take longer to compute per token.

Why this answer

Model size, input/output token count, and network transit time are the main drivers of latency.

4
MCQmedium

You want to evaluate your prompt engineering changes quantitatively. Which method is most reliable for comparing two prompt versions?

A.Monitoring the total request count.
B.Asking developers for subjective feedback.
C.Checking if the model is running on GPT-4.
D.Running the prompts against a benchmark evaluation dataset.
AnswerD

Running both prompt versions against the same benchmark evaluation dataset holds inputs constant, so measured differences in scores are attributable to the prompt change rather than sample variation. This satisfies the stem's reliability constraint by producing statistically comparable, reproducible results across versions.

Why this answer

Running both prompt versions against a benchmark evaluation dataset produces quantitative, reproducible metrics (accuracy, F1, BLEU, groundedness, etc.) that allow direct statistical comparison. This removes subjectivity and isolates the effect of the prompt change, which is the only reliable way to determine whether one prompt outperforms another.

Exam trap

AI-300 often tests the misconception that subjective feedback or traffic metrics constitute evaluation, when only benchmark datasets with defined metrics provide reliable quantitative comparison.

How to eliminate wrong answers

Option A is wrong because total request count measures traffic volume, not output quality, and has no bearing on which prompt produces better results. Option B is wrong because subjective developer feedback is not quantitative, is prone to bias, and cannot be reproduced or scaled. Option C is wrong because the underlying model version (GPT-4 vs. others) is a constant in the comparison and does not evaluate prompt quality at all.

5
MCQeasy

You are configuring a chat application. What is the benefit of enabling streaming in the Azure OpenAI API?

A.Increases the model's accuracy.
B.Removes the need for a system prompt.
C.Reduces time-to-first-token (TTFT) perception for the end-user.
D.Decreases the total number of tokens consumed.
AnswerC

Streaming returns tokens incrementally over a persistent connection instead of buffering the full completion, so the user sees output almost immediately. This lowers perceived time-to-first-token, satisfying the responsiveness constraint in an interactive chat scenario where waiting for the complete response feels slow.

Why this answer

Streaming improves perceived latency by delivering tokens as they are generated.

6
MCQeasy

You are monitoring an Azure OpenAI deployment used for a customer support chatbot. You notice that the model sometimes generates responses that include fabricated product features. You want to implement a technique that encourages the model to say 'I don't know' when it lacks information, rather than guessing. Which approach should you use?

A.Enable content filtering to block harmful or inappropriate responses.
B.Increase the frequency_penalty parameter to discourage repetitive tokens.
C.Use a system message that instructs the model to only answer if it is confident and to otherwise respond with 'I don't know'.
D.Decrease the top_p parameter to 0.1 to make the output more focused.
AnswerC

A system message sets the model's behavior and can explicitly instruct it to avoid guessing. By telling the model to only answer when confident and to otherwise say 'I don't know', you reduce fabricated responses. This is a prompt engineering technique that leverages the model's instruction-following ability. It is simple, cost-effective, and directly addresses the scenario's requirement.

Why this answer

A system message that instructs the model to only answer when confident and to otherwise respond with 'I don't know' directly leverages the model's instruction-following capability to reduce fabrication. This prompt engineering approach is effective for encouraging honesty and is easy to implement. Other options adjust randomness or filter harmful content but do not address the core issue of hallucination.

Exam trap

The trap here is thinking that parameter tweaks like top_p or frequency_penalty can improve factual accuracy, when only grounding or explicit instructions can reduce hallucination.

7
MCQhard

You are optimizing a generative AI application that uses Azure OpenAI's GPT-4 model for summarizing long legal contracts. The summaries are often incomplete because the model truncates important details from the middle of the contract. You need to improve the completeness of the summaries without exceeding the model's context window. What should you do?

A.Switch to a model with a larger context window, such as GPT-4-32k, and pass the entire contract.
B.Increase the max_tokens parameter to allow longer summaries.
C.Lower the temperature to 0 to make the model more deterministic.
D.Use a chunking strategy with overlapping segments and summarize each chunk, then combine the summaries.
AnswerD

Chunking the contract into overlapping segments ensures that no important details are lost at chunk boundaries. Summarizing each chunk separately and then combining the summaries (e.g., via a hierarchical summarization prompt) allows the model to process the entire document within its context window. Overlap preserves context continuity, reducing the chance of missing critical information in the middle of the contract.

Why this answer

Chunking with overlapping segments and hierarchical summarization allows the model to process the entire contract in parts, preserving context at boundaries and combining partial summaries into a complete one. This approach works within the model's context window and avoids truncation. Increasing output tokens or lowering temperature does not solve input truncation, and switching to a larger model may still be insufficient and costly.

Exam trap

The trap here is confusing output token limits with input context limits; increasing max_tokens does not help the model see more input.

8
MCQhard

You are fine-tuning a model on Azure OpenAI and notice the training loss curve is fluctuating significantly. What is the most likely cause?

A.The model's temperature is set too high.
B.The training dataset size is too large.
C.The model lacks enough epochs.
D.The learning rate is too high.
AnswerD

An excessively high learning rate makes each gradient step overshoot the loss minimum, so the loss oscillates or diverges rather than settling. Lowering it, or applying a warmup and decay schedule, stabilises convergence and smooths the fluctuating curve.

Why this answer

A fluctuating training loss curve is typically caused by a learning rate that is too high. When the learning rate is too high, the optimization algorithm takes large steps and may overshoot the minimum, causing the loss to oscillate or even diverge. Reducing the learning rate often stabilizes training.

Exam trap

AI-300 often tests the symptoms of hyperparameter misconfiguration. Candidates might confuse training-time issues (learning rate) with inference-time parameters (temperature) or dataset size effects.

How to eliminate wrong answers

Option A is wrong because temperature is a parameter used during inference, not training; it does not affect the training loss curve. Option B is wrong because a large dataset size generally leads to more stable training, not fluctuation. Option C is wrong because insufficient epochs would result in underfitting (high loss), not necessarily fluctuation; fluctuation is more about step size.

9
MCQmedium

A user wants to restrict the model's output to valid JSON format. What is the most effective way to ensure this?

A.Increase the temperature.
B.Add 'output must be JSON' to the prompt.
C.Post-process the output with a regex script.
D.Enable JSON mode/Response Format in the API configuration.
AnswerD

Enabling JSON mode constrains decoding so the model emits syntactically valid JSON, satisfying the stem's requirement for structured output. Unlike prompt instructions, which merely bias generation, response format enforcement operates at the API layer, guaranteeing parseable results without post-processing or retry logic.

Why this answer

Enabling JSON mode (Response Format) in the API configuration is the most effective way to constrain model output to valid JSON because the model is instructed and, in supported models, constrained to emit syntactically valid JSON. This is a first-class API feature (response_format: { type: 'json_object' }) that enforces structure at generation time. Prompt instructions alone are probabilistic, and post-processing only fixes output after the fact.

Exam trap

AI-300 often tests the misconception that prompt engineering alone guarantees output format, when the reliable answer is the API-level response_format/JSON mode setting.

How to eliminate wrong answers

Option A is wrong because increasing temperature makes output more random and creative, which increases the likelihood of malformed or non-JSON output, the opposite of what is needed. Option B is wrong because adding 'output must be JSON' to the prompt is only a soft instruction; the model may still produce prose, markdown fences, or invalid JSON, so it is not the most effective or reliable method. Option C is wrong because post-processing with regex is a reactive fix that cannot reliably repair arbitrary malformed JSON and does not prevent invalid output in the first place; it also adds complexity and failure modes.

10
MCQmedium

Your Azure OpenAI deployment is experiencing high latency during peak hours. You observe that input tokens are consistently high. Which strategy is most effective for reducing latency while maintaining quality?

A.Implement prompt caching for static instructions.
B.Increase the top_p parameter.
C.Enable dynamic scaling in Azure App Service.
D.Decrease the number of parallel requests.
E.Use a higher model version (e.g., o1-preview).
AnswerA

Prompt caching stores the static instruction prefix so repeated requests reuse its computed key-value state, cutting prefill work on every call. Since the stem identifies consistently high input tokens as the driver of peak-hour latency, caching that unchanging prefix directly reduces time-to-first-token while leaving model quality untouched.

Why this answer

Prompt caching stores the KV cache for static prompt prefixes (system instructions, few-shot examples) so the model doesn't recompute attention over those tokens on every request. When input tokens are consistently high and dominated by static content, caching eliminates redundant prefill computation, directly reducing time-to-first-token and overall latency without changing output quality.

Exam trap

AI-300 often tests the misconception that tuning sampling parameters (top_p, temperature) reduces latency — those affect output generation diversity, not input prefill cost, which is what dominates when input tokens are high.

How to eliminate wrong answers

Option B is wrong because increasing top_p widens the sampling nucleus, which can increase output variability and does nothing to reduce input-token processing latency. Option C is wrong because App Service dynamic scaling addresses compute capacity for the hosting app, not the model inference latency inside Azure OpenAI. Option D is wrong because decreasing parallel requests reduces throughput and may actually increase per-request queueing latency under load.

Option E is wrong because larger reasoning models like o1-preview are significantly slower and more expensive, worsening latency rather than improving it.

11
MCQhard

You are optimizing a model for a specific domain language. Which fine-tuning approach minimizes cost while maximizing domain adaptation?

A.Using LoRA (Low-Rank Adaptation).
B.Training the model from scratch.
C.Prompt engineering alone.
D.Full parameter fine-tuning.
AnswerA

LoRA freezes the pretrained weights and injects small trainable low-rank matrices into attention layers, so only a fraction of parameters are updated. This cuts GPU compute and storage costs substantially while still adapting the model to domain-specific language, satisfying the cost-minimisation constraint.

Why this answer

LoRA (Low-Rank Adaptation) freezes the pretrained model weights and injects small trainable low-rank matrices into attention layers, so only a tiny fraction of parameters are updated. This dramatically reduces GPU memory, compute, and storage costs compared to full fine-tuning while still adapting the model to domain-specific language. It is the standard cost-efficient fine-tuning technique for domain adaptation.

Exam trap

AI-300 often tests the misconception that 'more parameters updated = better adaptation,' causing candidates to pick full fine-tuning when the question emphasizes cost minimization.

How to eliminate wrong answers

Option B is wrong because training from scratch requires massive datasets, compute budgets, and time, and it discards the pretrained knowledge that already provides general language understanding. Option C is wrong because prompt engineering alone does not modify model weights, so it cannot deeply adapt the model to specialized domain vocabulary, jargon, or stylistic patterns. Option D is wrong because full parameter fine-tuning updates every weight, requiring far more GPU memory, storage, and training time, making it the most expensive approach rather than the cost-minimizing one.

12
Multi-Selecteasy

Which TWO of the following strategies are commonly used to optimize for cost in Generative AI?

Select 2 answers
A.Selecting the smallest capable model for the task.
B.Caching frequent prompts or responses.
C.Increasing the context window size to 128k.
D.Enabling verbose logging.
E.Using the highest possible temperature.
AnswersA, B

Smaller models consume fewer tokens and less compute per request, directly lowering inference cost. Where the task's accuracy requirements are still met, choosing the smallest capable model satisfies the cost-optimisation goal without sacrificing acceptable output quality.

Why this answer

Option A is correct because choosing the smallest capable model for a task directly reduces cost, since inference pricing scales with model size and capability—smaller models consume fewer compute resources per token. Option B is correct because caching frequent prompts or responses avoids redundant model invocations, so repeated queries are served from cache instead of incurring new token-generation charges. Option C is not a cost optimization: expanding the context window to 128k increases the number of input tokens processed per request, which typically raises cost.

Option D is not a cost optimization: verbose logging increases storage and observability overhead without reducing inference spend. Option E is not a cost optimization: using the highest possible temperature affects output randomness, not token pricing, and can even increase retries or output length.

13
Multi-Selecteasy

Which THREE metrics are critical for monitoring a production Generative AI system?

Select 3 answers
A.Latency (Time-to-first-token).
B.The hardware temperature of the Azure server.
C.Model training loss.
D.Token usage per request.
E.Error rates (HTTP 4xx/5xx).
AnswersA, D, E

Time-to-first-token measures the delay before a generative model begins streaming output, capturing prefill and queueing latency. It directly reflects perceived responsiveness in production, exposing capacity shortfalls or throttling that total request duration alone would obscure.

Why this answer

Option A (Latency, specifically Time-to-first-token) is critical because in a production Generative AI system, TTFT directly measures the perceived responsiveness of streaming responses, and high TTFT degrades user experience and can indicate model, network, or inference bottlenecks. Option D (Token usage per request) is critical because tokens drive both cost and throughput in LLM serving; tracking prompt and completion tokens per request enables accurate chargeback, quota enforcement, and capacity planning against rate limits such as tokens-per-minute. Option E (Error rates, HTTP 4xx/5xx) is critical because 4xx codes reveal client-side issues like authentication failures, throttling (429), or malformed prompts, while 5xx codes expose server-side faults such as model timeouts or backend unavailability, making them essential for reliability and SLO monitoring.

Option B (hardware temperature of the Azure server) is not a critical application-level metric for a Generative AI system because Azure abstracts physical hardware and exposes health through platform metrics rather than requiring per-server temperature tracking. Option C (model training loss) is not appropriate here because it is an offline training-time metric and does not reflect the runtime health, cost, or reliability of a deployed production inference system.

14
MCQmedium

You have a large set of documents for a RAG system. How should you optimize retrieval speed?

A.Store embeddings in a dedicated vector database with indexing.
B.Process all documents in the prompt.
C.Increase the model's max_tokens.
D.Perform a brute-force search on all documents.
AnswerA

A dedicated vector database with indexing satisfies the large-scale retrieval constraint by using approximate nearest neighbour indexes (such as HNSW or IVF) to search embeddings in logarithmic rather than linear time. This avoids exhaustive comparisons across the entire document set, delivering the low-latency similarity search that a RAG system demands.

Why this answer

Storing embeddings in a dedicated vector database with an ANN index (HNSW, IVF) enables sub-linear nearest-neighbor search instead of scanning every document. This is the standard architecture for fast retrieval over large corpora in RAG systems. The index precomputes a graph or cluster structure so queries touch only a small fraction of vectors.

Exam trap

AI-300 often tests whether candidates recognize that brute-force search is the naive baseline, not an optimization — and that prompt-stuffing is not a retrieval strategy at all.

How to eliminate wrong answers

Option B is wrong because stuffing all documents into the prompt is infeasible for large corpora due to context-window limits and would be extremely slow and expensive. Option C is wrong because max_tokens controls output length, not retrieval speed. Option D is wrong because brute-force search is O(n) per query and becomes prohibitively slow as the document set grows — it is the exact opposite of optimization.

15
Multi-Selectmedium

You are optimizing a generative AI solution that uses Azure OpenAI for a multilingual customer feedback analysis application. The application must process large volumes of text quickly and cost-effectively. You need to reduce token usage without sacrificing the quality of the analysis. Which two actions should you take? (Choose two.)

Select 2 answers
A.Increase the max_tokens parameter to allow longer responses.
B.Use a smaller, fine-tuned model for specific languages to handle simpler tasks.
C.Enable streaming to receive responses faster.
D.Implement prompt compression techniques to remove redundant or non-essential words from the input.
E.Set the temperature to a high value to encourage more diverse responses.
AnswersB, D

Deploying a smaller, fine-tuned model for specific languages can handle simpler analysis tasks with fewer tokens and lower cost per token. Fine-tuning tailors the model to the domain, improving accuracy while reducing the need for lengthy prompts. This approach is cost-effective for high-volume, repetitive tasks and complements prompt compression.

Why this answer

Prompt compression reduces input tokens by removing redundancy, and using a smaller fine-tuned model for specific languages lowers per-token cost and often requires shorter prompts. Together, they optimize token usage without sacrificing quality. Increasing max_tokens, raising temperature, or enabling streaming do not reduce token consumption and may increase cost or reduce consistency.

Exam trap

The trap here is equating latency improvements like streaming with cost reduction, when token usage is what drives cost.

16
MCQeasy

Which parameter in the Azure OpenAI API should be adjusted to make the model's output more deterministic and repeatable?

A.max_tokens
B.presence_penalty
C.temperature
D.frequency_penalty
AnswerC

Temperature scales the randomness of token sampling; lowering it towards zero sharpens the probability distribution so the highest-likelihood token is chosen consistently. This directly satisfies the requirement for deterministic, repeatable output rather than varied creative responses.

Why this answer

Temperature controls the randomness of the model's output by scaling the logits before the softmax function. A lower temperature (e.g., 0 or near 0) makes the probability distribution sharper, so the model almost always picks the highest-probability token, resulting in deterministic and repeatable responses. Setting temperature to 0 is the standard way to achieve consistent outputs for the same input in Azure OpenAI.

Exam trap

AI-300 often tests the confusion between parameters that control output length (max_tokens) and those that control randomness (temperature), so candidates must remember that only temperature directly adjusts determinism.

How to eliminate wrong answers

Option A is wrong because max_tokens only limits the maximum number of tokens generated in the response; it does not affect the randomness or determinism of the output. Option B is wrong because presence_penalty discourages repeating tokens that have already appeared, which increases diversity rather than determinism. Option D is wrong because frequency_penalty reduces the likelihood of tokens based on how often they have appeared, also promoting diversity and not repeatability.

17
MCQhard

You are optimizing a long-context application. Which technique is most effective for reducing context window costs in Azure OpenAI?

A.Using a smaller batch size.
B.Summarizing conversation history before passing to the next prompt.
C.Disabling streaming responses.
D.Increasing the frequency penalty.
AnswerB

Summarising prior turns replaces the full verbatim history with a condensed summary, shrinking the prompt token count that drives context window charges. This directly reduces per-request cost while preserving conversational continuity for the next prompt.

Why this answer

Long-context prompts are billed per input token, so the most direct cost lever is reducing the number of tokens sent. Summarizing conversation history replaces a growing transcript with a compact synopsis, cutting input tokens substantially while preserving semantic continuity. This is the standard pattern for multi-turn chat applications where history would otherwise balloon the context window.

Exam trap

AI-300 often tests whether candidates conflate sampling parameters (frequency penalty, temperature) or delivery settings (streaming) with token-reduction techniques, when only prompt-content compression actually lowers context cost.

How to eliminate wrong answers

Option A is wrong because batch size affects throughput and request grouping, not the token count of an individual prompt, so it does not reduce context window cost. Option C is wrong because disabling streaming changes response delivery UX, not the number of input tokens billed. Option D is wrong because frequency penalty is a sampling parameter that discourages token repetition; it does not shrink the prompt and can even slightly increase output token usage.

18
MCQeasy

An application is hitting rate limits on the Azure OpenAI service. Which action is the most standard approach for handling this in production?

A.Delete the deployment and recreate it.
B.Implement exponential backoff in the client application.
C.Disable the rate limit in the portal.
D.Increase the temperature of the model.
AnswerB

Exponential backoff retries failed requests with progressively longer, randomised delays, letting the client recover from 429 throttling without hammering the service. This is the standard production pattern for transient rate-limit errors on Microsoft Entra ID-authenticated Azure OpenAI deployments.

Why this answer

The standard production approach for handling rate limits (HTTP 429) from Azure OpenAI is to implement retry logic with exponential backoff in the client application. Azure OpenAI returns a 429 status code with a Retry-After header when the tokens-per-minute (TPM) or requests-per-minute (RPM) quota is exceeded, and the client should wait and retry with progressively longer delays. This is the documented Microsoft-recommended pattern and is also built into the Azure OpenAI SDKs via retry policies.

Exam trap

AI-300 often tests the misconception that rate limits are a configuration setting that can be toggled or bypassed, when in reality they are enforced service-side quotas that must be handled client-side with retry/backoff logic or raised via quota requests.

How to eliminate wrong answers

Option A is wrong because deleting and recreating a deployment does not change the underlying quota assigned to the subscription and would cause downtime plus loss of the deployment configuration; it does not address the rate-limit condition at all. Option C is wrong because rate limits on Azure OpenAI are enforced by the service at the subscription/deployment level and cannot be disabled from the portal — the only way to raise them is to request a quota increase or provision more capacity (e.g., PTU). Option D is wrong because temperature controls the randomness/creativity of model output and has no relationship to throughput, throttling, or quota enforcement.

19
MCQeasy

Which feature in Azure OpenAI allows you to reserve throughput for a consistent user experience during high demand?

A.Regional failover.
B.Auto-scaling groups.
C.Provisioned Throughput Units (PTUs).
D.Token throttling.
AnswerC

Provisioned Throughput Units reserve dedicated model capacity on Azure OpenAI, guaranteeing consistent latency and throughput under load. Unlike pay-as-you-go token billing, which shares capacity and throttles during demand spikes, PTUs satisfy the stem's requirement for a consistent user experience during high demand.

Why this answer

Provisioned Throughput Units (PTUs) let you reserve a fixed amount of model processing capacity on an Azure OpenAI deployment, guaranteeing consistent latency and throughput even under high demand. Unlike standard (pay-as-you-go) deployments that share a regional pool and can be throttled, PTUs give you dedicated capacity measured in units of tokens-per-minute equivalent. This is the feature designed specifically for predictable, high-volume workloads.

Exam trap

AI-300 often tests whether candidates confuse throttling controls with capacity reservation; the trap is selecting 'token throttling' because it sounds like a throughput-management feature when it is actually the failure mode PTUs prevent.

How to eliminate wrong answers

Option A is wrong because regional failover is a resiliency mechanism for availability, not a throughput reservation; it does not guarantee capacity during demand spikes. Option B is wrong because auto-scaling groups are an Azure VM/compute concept (VMSS) and are not how Azure OpenAI capacity is managed — Azure OpenAI does not expose autoscaling groups for model deployments. Option D is wrong because token throttling is a rate-limiting behavior imposed when you exceed quota, not a feature that reserves capacity; it is the problem PTUs are meant to solve.

20
Multi-Selectmedium

Which TWO methods are best for debugging an LLM pipeline that fails on complex queries?

Select 2 answers
A.Inspecting raw input and output tokens via logs.
B.Tracing the request flow through the RAG pipeline.
C.Increasing the number of API users.
D.Disabling all security controls.
E.Deleting the deployment and rebuilding it.
AnswersA, B

Logging raw input and output tokens exposes exactly what the model received and emitted, revealing truncation, malformed prompts or unexpected content on complex queries. This satisfies the requirement to pinpoint where the pipeline diverges from expected behaviour.

Why this answer

Option A is correct because inspecting raw input and output tokens via logs reveals exactly what prompt text and context the model received and what it generated, exposing truncation, malformed prompt templates, or unexpected tokenization that cause failures on complex queries. Option B is correct because tracing the request flow through the RAG pipeline shows each stage — query rewriting, embedding, vector retrieval, reranking, and final generation — so you can pinpoint which component drops or corrupts information for complex queries. Option C is wrong because adding API users only increases load and does not diagnose pipeline failures.

Option D is wrong because disabling security controls introduces risk without providing any debugging insight. Option E is wrong because deleting and rebuilding the deployment is a destructive, non-diagnostic action that may erase logs and state needed for root-cause analysis.

21
MCQmedium

You notice that your fine-tuned model is 'forgetting' base capabilities after training on a small dataset. What strategy should you use to mitigate this?

A.Include a portion of the original training data during fine-tuning.
B.Increase the fine-tuning learning rate.
C.Change the model architecture to GPT-4.
D.Reduce the batch size to 1.
AnswerA

Replaying a portion of the original training data during fine-tuning constrains weight updates, preserving base capabilities that a small, narrow dataset would otherwise overwrite. This directly mitigates catastrophic forgetting, satisfying the stem's requirement to retain general model behaviour.

Why this answer

Catastrophic forgetting occurs when a model fine-tuned on a small dataset loses its general capabilities. To mitigate this, you should include a portion of the original training data (or a diverse set of general data) during fine-tuning so the model retains its base knowledge while learning the new task. This is a common technique in continual learning.

Exam trap

AI-300 often tests the concept of catastrophic forgetting and its mitigation. Candidates might think that increasing learning rate or changing model architecture solves the problem, but the correct approach is to include original data.

How to eliminate wrong answers

Option B is wrong because increasing the learning rate would likely exacerbate forgetting by making the model rapidly overfit to the new data. Option C is wrong because changing the model architecture to GPT-4 is not a strategy to mitigate forgetting; it's a different model and may not be feasible. Option D is wrong because reducing batch size to 1 increases noise in updates and can worsen forgetting, not mitigate it.

22
MCQhard

You are debugging a prompt that is performing poorly on edge cases. You decide to use a 'Chain-of-Thought' approach. Why does this improve performance?

A.It enables the model to break down complex logic into sequential steps.
B.It bypasses the safety alignment layer.
C.It forces the model to use more input tokens, reducing costs.
D.It reduces the context window size.
AnswerA

Chain-of-Thought prompting improves edge-case handling by forcing the model to generate intermediate reasoning tokens before committing to an answer, decomposing complex logic into sequential steps. This explicit step-by-step generation reduces errors on multi-hop reasoning, satisfying the stem's requirement to improve performance on tricky edge cases.

Why this answer

Chain-of-Thought (CoT) prompting instructs the model to produce intermediate reasoning steps before the final answer, which improves accuracy on multi-step logic, arithmetic, and edge cases by giving the model more compute and context to work through ambiguity. This sequential decomposition is why CoT helps on problems where a direct answer would skip critical reasoning.

Exam trap

AI-300 often tests whether candidates understand that CoT trades higher token cost and latency for better reasoning accuracy, so any option claiming it reduces cost or context usage is a distractor.

How to eliminate wrong answers

Option B is wrong because CoT does not bypass safety alignment — safety layers operate independently of prompting strategy and remain active. Option C is wrong because CoT increases token usage and therefore cost, not reduces it; the claim inverts the actual effect. Option D is wrong because CoT consumes more context window, not less, since the reasoning steps occupy tokens.

23
Multi-Selecteasy

Which TWO of the following are effective ways to reduce hallucination?

Select 2 answers
A.Increasing the temperature to 0.7.
B.Removing the system prompt.
C.Using the longest possible response length.
D.Explicitly instructing the model to say 'I don't know' if the context is insufficient.
E.Providing ground-truth reference context in the prompt.
AnswersD, E

Giving the model an explicit escape route means it can decline rather than fabricate when retrieved context lacks the answer, directly reducing unsupported generation. This satisfies the hallucination-reduction constraint by converting an unknowable prompt into a grounded refusal instead of an invented response.

Why this answer

Option D is correct because explicitly instructing the model to say 'I don't know' when the context is insufficient gives it a permissible fallback behavior, reducing the tendency to fabricate plausible-sounding but unsupported answers. Option E is correct because supplying ground-truth reference context in the prompt anchors the model's response in verified source material, a technique commonly called retrieval-augmented or grounded generation, which measurably lowers hallucination rates. Option A is incorrect because raising the temperature to 0.7 increases sampling randomness, which typically increases rather than reduces hallucination.

Option B is incorrect because removing the system prompt strips away behavioral constraints and role guidance, generally making the model less reliable and more prone to unsupported output. Option C is incorrect because requesting the longest possible response length encourages verbosity and elaboration beyond the available evidence, which tends to increase hallucinated content rather than reduce it.

Exam trap

AI-300 often tests the confusion that higher temperature or longer responses improve quality, when in fact they increase hallucination; the exam expects knowledge that grounding and explicit uncertainty instructions are key mitigations.

24
MCQhard

You notice your model is outputting redundant information. Which parameter specifically targets the penalty for repeating tokens?

A.max_tokens
B.presence_penalty
C.frequency_penalty
D.top_p
AnswerC

The frequency_penalty parameter applies a proportional penalty each time a token has already appeared in the generated text, so higher values progressively discourage repeated tokens. This directly targets the redundant output described in the stem, unlike presence_penalty, which penalises any token merely for appearing at least once.

Why this answer

The frequency_penalty parameter applies a penalty proportional to how many times a token has already appeared in the generated text, directly discouraging repeated tokens and reducing redundancy. Its value ranges from -2.0 to 2.0, with positive values increasing the penalty for frequent tokens.

Exam trap

AI-300 often tests the confusion between presence_penalty and frequency_penalty, tempting candidates to pick presence_penalty when the question specifically asks about penalizing repeated tokens proportionally.

How to eliminate wrong answers

Option A is wrong because max_tokens caps the total length of the output and does not penalize repetition — it merely truncates generation. Option B is wrong because presence_penalty applies a flat one-time penalty to any token that has appeared at least once, encouraging new topics rather than scaling with repetition count. Option D is wrong because top_p (nucleus sampling) restricts the token pool to a cumulative probability threshold and controls diversity, not repetition penalty.

25
Multi-Selectmedium

Which THREE steps are necessary to successfully fine-tune an Azure OpenAI model?

Select 3 answers
A.Manually update the model weights in the code.
B.Prepare and upload a training dataset in JSONL format.
C.Disable the input filter in the portal.
D.Select a compatible base model for fine-tuning.
E.Monitor the training job progress.
AnswersB, D, E

Fine-tuning requires supervised training examples, and Azure OpenAI accepts them as JSONL files with prompt-completion pairs uploaded to the resource. Without this formatted dataset, no training job can be submitted, making it a mandatory prerequisite step in the fine-tuning workflow.

Why this answer

Option B is correct because Azure OpenAI fine-tuning requires a training dataset uploaded as a JSONL file with chat-completion formatted examples (messages with role/content pairs), which the service uses to adapt the model. Option D is correct because you must choose a base model that supports fine-tuning (for example gpt-35-turbo, gpt-4o-mini, or babbage-002/davinci-002) and that is available in the region where you create the fine-tune job. Option E is correct because after submitting the fine-tuning job you track its status and metrics (training loss, token usage, and completion state) via the Azure OpenAI Studio or the REST API, and you only deploy the resulting model once the job succeeds.

Option A is not needed because Azure OpenAI manages the weight updates internally; you never edit model weights in code. Option C is not required because content filtering is a separate safety configuration and disabling the input filter is neither necessary nor recommended for fine-tuning.

Exam trap

AI-300 often tests the misconception that fine-tuning involves manual weight manipulation or content-filter changes, when in fact it is a fully managed pipeline requiring only data preparation, base model selection, and job monitoring.

26
MCQmedium

To optimize costs for an enterprise chatbot, you want to implement token usage monitoring. Which Azure service should you integrate to track token consumption per user?

A.Azure Data Factory.
B.Azure Cognitive Search.
C.Azure SQL Database.
D.Azure Monitor with Log Analytics.
AnswerD

Azure Monitor with Log Analytics captures per-request token metrics emitted by Azure OpenAI, letting you query consumption grouped by authenticated user via Microsoft Entra ID. This satisfies the stem's requirement to track token usage per user, enabling cost attribution and optimisation across the enterprise chatbot's workload.

Why this answer

Azure Monitor with Log Analytics is the correct service to track token consumption per user because Azure OpenAI emits metrics and diagnostic logs (including token usage) that can be routed to a Log Analytics workspace for querying and per-user aggregation. You enable diagnostic settings on the Azure OpenAI resource to send logs and metrics to Log Analytics, then use Kusto Query Language (KQL) to aggregate tokens by user or custom dimension. This provides centralized monitoring, alerting, and cost analysis.

Exam trap

AI-300 often tests the confusion between monitoring/telemetry services and data services, tempting candidates to pick a database or ETL tool when the question asks where to 'track' or 'monitor' usage.

How to eliminate wrong answers

Option A is wrong because Azure Data Factory is a data integration/ETL service, not a monitoring or telemetry platform, and it does not natively capture or aggregate Azure OpenAI token usage. Option B is wrong because Azure Cognitive Search (Azure AI Search) is a search indexing service and has no role in tracking model token consumption. Option C is wrong because Azure SQL Database is a relational database; while you could store token data there, it does not natively collect Azure OpenAI telemetry and would require custom ingestion, making it not the service to 'integrate' for monitoring.

27
MCQmedium

Which technique is most appropriate for optimizing RAG performance when the vector database returns too much noisy information?

A.Changing the embedding model to a smaller one.
B.Implementing a re-ranking stage.
C.Increasing the number of chunks retrieved.
D.Reducing the temperature to 0.
AnswerB

A re-ranking stage applies a cross-encoder or similar model to rescore the retrieved chunks against the query, pushing genuinely relevant passages above the noisy ones. This directly addresses the excessive irrelevant content the vector database returns, improving the context passed to the LLM.

Why this answer

A re-ranking stage applies a more expensive cross-encoder or semantic ranker to the initial candidate set returned by the vector database, reordering results by true relevance to the query. This filters out semantically similar but contextually irrelevant chunks that vector similarity alone cannot distinguish, directly addressing the noisy-retrieval problem. It is the standard second-stage pattern in production RAG pipelines.

Exam trap

AI-300 often tests the misconception that generation-side parameters like temperature or max_tokens can fix retrieval-side quality problems — they cannot, because retrieval and generation are separate stages.

How to eliminate wrong answers

Option A is wrong because a smaller embedding model reduces vector dimensionality and semantic fidelity, which typically increases noise rather than reducing it. Option C is wrong because retrieving more chunks amplifies the noise problem by injecting additional low-relevance context into the prompt. Option D is wrong because temperature controls the LLM's sampling randomness during generation and has no effect on retrieval quality or the relevance of chunks returned by the vector database.

Ready to test yourself?

Try a timed practice session using only Generative Ai Optimization questions.