2.2.6
| Question | Answer & Explanation |
|---|---|
| ### Question 1 - Multi-Model Endpoints (MME) for Cost Reduction A retail company operates thousands of distinct product lines and has trained a separate XGBoost model for each line to forecast demand. The data science team wants to deploy these models for real-time inference while strictly adhering to a "most cost-effective solution" constraint with "least operational overhead." Hosting each model on its own SageMaker endpoint would be prohibitively expensive. The team needs a native AWS architecture to serve all models efficiently. Which approach should the team implement? (Select ONE) - A) Deploy all XGBoost models to a single Amazon SageMaker Multi-Model Endpoint (MME) using a shared serving container. - B) Create an AWS Lambda function that loads all models into memory and performs inference sequentially. - C) Deploy a separate Amazon SageMaker real-time endpoint for each product line and use Amazon API Gateway to route traffic. - D) Use SageMaker Batch Transform to process all incoming real-time requests in hourly batches. |
Correct Answer: A Correct Option Analysis: - A is Correct: A SageMaker Multi-Model Endpoint (MME) allows you to deploy thousands of models on a single endpoint using a shared container. It dynamically loads and caches models in memory as requested, significantly reducing operational overhead and lowering costs compared to provisioning an endpoint for each model. Distractor Analysis: - B is Incorrect: Loading thousands of models into a single Lambda function memory limit (up to 10 GB) is not scalable, introduces high latency, and violates operational best practices for model serving. - C is Incorrect: Deploying thousands of individual endpoints maximizes operational overhead and cost, directly violating the specified constraints. - D is Incorrect: Batch Transform is designed for offline, asynchronous processing of large datasets, not real-time inference requirements. > Exam Tip: Use SageMaker Multi-Model Endpoints (MME) to host multiple models that share the same framework on a single endpoint to drastically reduce infrastructure costs. |
| ### Question 2 - Model Cascading for Cost Optimization A customer support center receives millions of text tickets daily and uses an NLP model to route them. 80% of the tickets are straightforward, while 20% are highly complex. Currently, the team routes all tickets through a large, expensive custom BERT model to maintain high accuracy. The business mandates a "most cost-effective solution" without compromising overall routing accuracy. They want to leverage AWS native services to combine models intelligently. Which architectural pattern best meets these requirements? (Select ONE) - A) Train a single massive foundation model on the entire dataset using Amazon SageMaker JumpStart. - B) Deploy a small, fast XGBoost classifier to handle initial routing; if the model's confidence score is below 95%, route the ticket to the large BERT model. - C) Deploy an ensemble of three BERT models and use majority voting for all incoming tickets. - D) Use Amazon Bedrock Knowledge Bases to store past tickets and retrieve similar ones for the agents. |
Correct Answer: B Correct Option Analysis: - B is Correct: This describes a "model cascading" pattern. By using a computationally cheap and fast model for the majority of easy cases, and only invoking the expensive, highly accurate model for low-confidence edge cases, the team drastically reduces inference costs while maintaining high overall accuracy. Distractor Analysis: - A is Incorrect: Training a single massive model does not reduce inference costs; it maintains the high cost of serving the large model for every request. - C is Incorrect: An ensemble of three BERT models triples the inference cost and compute overhead, violating the cost-effectiveness constraint. - D is Incorrect: Bedrock Knowledge Bases is for Retrieval-Augmented Generation (RAG) and does not solve the text classification/routing cost problem described in the scenario. > Exam Tip: Model cascading combines a cheap, low-latency model with an expensive, high-accuracy model, invoking the expensive one only when the cheap model's confidence is low, optimizing both cost and performance. |
| ### Question 3 - Stacking Ensembles for Performance Improvement A financial institution is developing a machine learning pipeline to detect credit card fraud. The team has separately trained an Amazon SageMaker XGBoost model and an Amazon SageMaker Linear Learner model. The current single-model performance is acceptable, but the company mandates the "highest possible performance" (F1-score), and cost is a secondary concern. The team must combine the outputs of these two base models to generate a final prediction. Which technique should the team use to structure this combination on AWS? (Select ONE) - A) Use a SageMaker Multi-Model Endpoint (MME) and randomly route traffic to either the XGBoost or Linear Learner model. - B) Create an Amazon SageMaker Pipeline that generates predictions from both base models and feeds them as features into a final meta-model (Logistic Regression) for the ultimate prediction. - C) Average the prediction probabilities from both models inside an AWS Lambda function and return the result to the client. - D) Retrain both models using SageMaker Automatic Model Tuning (AMT) and select the one with the higher F1-score. |
Correct Answer: B Correct Option Analysis: - B is Correct: This describes "stacking" (or stacked generalization), an ensemble method where a meta-model is trained on the outputs (predictions) of multiple base models. This technique often yields higher performance than any single base model by learning how to best combine the base models' strengths, fitting the "highest possible performance" constraint. Distractor Analysis: - A is Incorrect: Randomly routing traffic to one model or the other does not combine their predictions; it merely provides load balancing and offers no performance improvement over the individual models. - C is Incorrect: Simple averaging of probabilities is a basic ensemble technique (blending), but it does not learn the optimal way to combine the predictions like a trained meta-model does, yielding lower performance than stacking. - D is Incorrect: Selecting the single best model does not fulfill the requirement to "combine multiple ML models to improve performance." > Exam Tip: Stacking uses a meta-model (like Logistic Regression) to learn the optimal combination of base models' predictions, often achieving the highest ensemble performance for tabular data. |
| ### Question 4 - Multi-Container Endpoints for Sequential Inference A healthcare technology company processes patient intake forms. They require an architecture that performs Optical Character Recognition (OCR) on an uploaded image and then passes the extracted text to a separate NLP model for entity extraction. The business requires a "lowest latency" solution with "minimal operational overhead." They want to avoid network hops between separate API calls for the two models within the AWS native architecture. Which Amazon SageMaker feature should they use to combine these models on a single endpoint? (Select ONE) - A) SageMaker Multi-Model Endpoint (MME) - B) SageMaker Multi-Container Endpoint with Direct Invocation - C) SageMaker Asynchronous Inference - D) Amazon API Gateway with two linked SageMaker endpoints |
Correct Answer: B Correct Option Analysis: - B is Correct: Multi-Container Endpoints allow multiple Docker containers (running different models) to be hosted on the same SageMaker endpoint. Using Direct Invocation, you can route traffic directly to a specific container, process it, and pass it sequentially within the same instance, avoiding network latency between endpoints and minimizing operational overhead. Distractor Analysis: - A is Incorrect: MME is designed to host many models of the same framework that are dynamically loaded from S3, not for chaining two different models (OCR and NLP) sequentially in custom containers. - C is Incorrect: Asynchronous Inference is for long-running requests or large payloads; it does not solve the problem of combining two different models on a single endpoint without network hops. - D is Incorrect: Linking two endpoints via API Gateway introduces network latency between the OCR endpoint and the NLP endpoint, violating the lowest latency constraint. > Exam Tip: Use Multi-Container Endpoints with Direct Invocation to run multiple different models sequentially on a single instance, eliminating network latency between endpoints. |
| ### Question 5 - Blending Predictions with AWS Step Functions An e-commerce platform wants to display product recommendations. They have three distinct recommendation models trained on different algorithms: collaborative filtering, content-based, and trending. They want to combine these models by assigning specific, static weights to each model's output to produce a final ranked list. The orchestration must be highly reliable and require "least operational overhead" while keeping the workflow serverless. The models are hosted on separate SageMaker endpoints. Which AWS service combination is best suited to combine these models? (Select ONE) - A) Use AWS Lambda functions to synchronously invoke the three endpoints, calculate the weighted sum, and return the result. - B) Use AWS Step Functions to orchestrate parallel calls to the SageMaker endpoints and use a Lambda function to apply the weights and merge the results. - C) Use Amazon EventBridge to trigger the three endpoints simultaneously and use an Amazon SQS queue to collect and average the results. - D) Train a new SageMaker XGBoost model to learn the optimal weights dynamically based on user click history. |
Correct Answer: B Correct Option Analysis: - B is Correct: AWS Step Functions provides a serverless, highly reliable visual workflow to orchestrate parallel state machine branches (calling the three SageMaker endpoints). A subsequent Lambda function can easily apply the predefined static weights to the outputs and sum them. This minimizes operational overhead for complex multi-step orchestration compared to writing a monolithic Lambda. Distractor Analysis: - A is Incorrect: While possible, synchronously chaining three endpoint calls inside a single Lambda function increases code complexity, error handling overhead, and potential timeout issues, violating the least operational overhead constraint. - C is Incorrect: Amazon SQS is a message queuing service and is not designed to synchronously aggregate and compute weighted sums of API responses in real-time. - D is Incorrect: Training a new XGBoost model to learn weights dynamically describes a stacking ensemble, but the scenario explicitly asked for static predefined weights assigned by the team, not a learned meta-model. > Exam Tip: For combining model outputs using predefined logic (like weighted blending) across multiple endpoints, AWS Step Functions is the ideal serverless orchestrator to manage retries, parallelism, and state. |
| ### Question 6 - Reducing Cost via Knowledge Distillation A media streaming company uses a massive, highly accurate Transformer model for real-time content moderation. The model is deployed on expensive GPU instances, resulting in high real-time inference costs. The latency is acceptable, but the CFO has mandated a "most cost-effective solution." The team cannot compromise significantly on accuracy. They need to combine the knowledge of the large model into a smaller, cheaper model using an AWS managed service. Which technique should the ML engineer implement? (Select ONE) - A) Use Amazon Bedrock Model Distillation to train a smaller, faster student model using the outputs of the large teacher model. - B) Deploy the large Transformer model on a SageMaker Multi-Model Endpoint (MME) to share the GPU costs across other models. - C) Use SageMaker Automatic Model Tuning (AMT) to tune the hyperparameters of the Transformer model to run on CPU instances. - D) Use SageMaker Model Monitor to track GPU utilization and automatically scale the endpoint to zero when not in use. |
Correct Answer: A Correct Option Analysis: - A is Correct: Knowledge Distillation involves transferring the "knowledge" from a large, complex model (teacher) to a smaller, faster, and more cost-effective model (student). Amazon Bedrock Model Distillation specifically supports this by using the teacher's outputs to train the student, allowing deployment on cheaper instances with minimal accuracy loss. Distractor Analysis: - B is Incorrect: While an MME shares an instance among models, it does not reduce the inference cost of the heavy Transformer model itself, as each call still requires the expensive GPU compute. - C is Incorrect: Transformer models are fundamentally slow on CPUs; tuning hyperparameters will not make a massive model run cost-effectively on CPU instances without architectural changes. - D is Incorrect: Scaling to zero introduces cold start latency, violating the real-time requirement, and does not reduce the cost per inference when the endpoint is active. > Exam Tip: Knowledge Distillation combines the performance of a large model with the low cost and high speed of a small model by training the smaller model on the large model's soft labels. |
| ### Question 7 - Dynamic Model Routing for Performance & Cost A global news aggregator classifies incoming articles into three categories: Sports, Finance, and General News. They have a specialized, highly accurate model for Sports, one for Finance, and a general-purpose model. Processing every article through all three models is too expensive, and using one general model fails to meet accuracy targets for Sports and Finance. They require a "most cost-effective solution" that dynamically directs the article to the correct specialized model. Which AWS native architecture achieves this? (Select ONE) - A) Use an Application Load Balancer (ALB) with path-based routing to send articles to different SageMaker endpoints based on URL parameters. - B) Deploy a lightweight text classification "router" model on Amazon SageMaker that classifies the domain first, then invokes the specific SageMaker endpoint for that domain via AWS Lambda. - C) Deploy all three models on a single SageMaker Multi-Model Endpoint and let SageMaker randomly load the models. - D) Use Amazon Bedrock Knowledge Bases to embed the articles and query a vector database for the most similar past article's category. |
Correct Answer: B Correct Option Analysis: - B is Correct: This implements a dynamic model routing architecture. A fast, cheap router model acts as a traffic cop. It quickly categorizes the input and directs it to the specialized, highly accurate endpoint for that specific domain. This guarantees high performance (using the best model for the job) while keeping costs low (only invoking one specialized model per request). Distractor Analysis: - A is Incorrect: An ALB with path-based routing requires the client to already know the category to append it to the URL. The scenario implies the system must dynamically determine the category from the text itself. - C is Incorrect: MME dynamically loads models but requires the client to specify which model to invoke; it does not inherently route traffic based on content. - D is Incorrect: Bedrock Knowledge Bases is for RAG applications, not for routing inputs to different ML classification models. > Exam Tip: Dynamic model routing uses a lightweight router model to inspect the input and forward it to the best-suited specialized model, optimizing the balance between accuracy and inference cost. |
| ### Question 8 - Bagging Ensembles to Reduce Variance An agricultural technology company is predicting crop yields based on weather and soil data. They trained an XGBoost model, but the validation results show high variance depending on how the training data was sampled. The team needs to stabilize the predictions and improve overall performance. They want to manually create an ensemble of XGBoost models trained on different random subsets of the data. They need a solution with "least operational overhead." Which approach should they use? (Select ONE) - A) Use SageMaker Automatic Model Tuning (AMT) to run 50 training jobs with different random seeds and weightings, then select the single best model from the tuning job. - B) Write a custom Python script using SageMaker Processing Jobs to manually split the data 10 times, train 10 XGBoost models using SageMaker Training Jobs, and average their predictions. - C) Train a single XGBoost model with a significantly higher learning rate to force convergence on the global minimum. - D) Use SageMaker Random Cut Forest, which natively ensembles multiple trees to reduce variance in anomaly detection. |
Correct Answer: B Correct Option Analysis: - B is Correct: This describes a manual implementation of Bagging (Bootstrap Aggregating). By training multiple XGBoost models on different random subsets of the data and averaging their predictions, the team can significantly reduce the variance of the model and stabilize the predictions. Using SageMaker Processing and Training Jobs orchestrates this natively. Distractor Analysis: - A is Incorrect: AMT is for finding the single best hyperparameter combination; it discards all other models and does not create an ensemble to average predictions. - C is Incorrect: Increasing the learning rate typically increases variance and the risk of overfitting, not decreases it. - D is Incorrect: Random Cut Forest is a built-in SageMaker algorithm designed specifically for anomaly detection, not general regression for crop yield prediction. > Exam Tip: Bagging (Bootstrap Aggregating) reduces model variance by training multiple models on different subsets of data and averaging their predictions, which is highly effective for unstable algorithms. |
| ### Question 9 - Combining Models via SageMaker Inference Recommender An enterprise data science team has successfully trained three complex PyTorch models for image classification. They want to deploy these models together to serve traffic. The company requires the "most cost-effective solution" for inference, but the team is unsure which SageMaker instance types will provide the best price/performance ratio for this specific combination. They want an automated AWS native tool to test and recommend the optimal configuration. Which AWS service should they use? (Select ONE) - A) AWS Cost Explorer - B) Amazon SageMaker Inference Recommender - C) Amazon CloudWatch Metrics - D) AWS Compute Optimizer |
Correct Answer: B Correct Option Analysis: - B is Correct: SageMaker Inference Recommender is an AWS service that automatically benchmarks models and recommends the best instance types and configurations for deployment. It helps identify the most cost-effective and performant endpoint configuration, satisfying the requirement to find the optimal price/performance ratio. Distractor Analysis: - A is Incorrect: AWS Cost Explorer analyzes past billing data and does not run benchmark tests to recommend instance types for ML model inference. - C is Incorrect: CloudWatch Metrics provides monitoring data (like CPU/GPU utilization) but does not run automated load tests or recommend instance types for cost optimization. - D is Incorrect: AWS Compute Optimizer recommends right-sizing for EC2 instances based on historical usage, but it does not benchmark ML models for SageMaker inference endpoints like Inference Recommender does. > Exam Tip: Use SageMaker Inference Recommender to automatically benchmark your model and find the most cost-effective instance type and endpoint configuration before deploying to production. |
| ### Question 10 - Hardware sharing to reduce cost A startup is building an application that requires real-time inference for both Computer Vision (CV) and Natural Language Processing (NLP). They have deployed a ResNet model and a BERT model. Both models are relatively small and do not fully utilize the compute resources of a single ml.g4dn.xlarge instance. The team needs to combine these models to reduce idle compute waste, strictly adhering to a "most cost-effective solution" and "least operational overhead." Which SageMaker deployment strategy is best? (Select ONE) - A) Deploy both models on a single SageMaker endpoint using a Multi-Container Endpoint with Direct Invocation. - B) Deploy the ResNet model on an ml.g4dn.xlarge and the BERT model on an ml.g4dn.2xlarge to ensure they do not compete for resources. - C) Package both models into a single custom Docker container that loads both the ResNet and BERT weights and runs a custom Python inference script. - D) Deploy the models on separate SageMaker endpoints and use Amazon EventBridge to switch traffic based on user requests. |
Correct Answer: A Correct Option Analysis: - A is Correct: A Multi-Container Endpoint with Direct Invocation allows both models (in their respective containers) to share the underlying compute resources of a single ml.g4dn.xlarge instance. This maximizes instance utilization, drastically reducing costs while maintaining low operational overhead via managed SageMaker containers. Distractor Analysis: - B is Incorrect: Deploying on separate, larger instances ensures zero resource contention but significantly increases cost and leaves compute idle, violating the most cost-effective solution constraint. - C is Incorrect: Creating a single custom Docker container to run both models requires building and maintaining a complex custom inference script and Dockerfile, resulting in high operational overhead. - D is Incorrect: Using EventBridge to switch traffic between two endpoints does not consolidate the compute, resulting in two underutilized instances and higher costs. > Exam Tip: When multiple models don't max out an instance's resources, combine them on a Multi-Container Endpoint to share the instance hardware, maximizing utilization and minimizing cost. |