Courseiva
ModelinghardMultiple SelectObjective-mapped

Reducing Inference Latency in SageMaker

A company is using Amazon SageMaker to deploy a model for real-time inference. The model takes 200 ms to respond, but the requirement is 100 ms. Which THREE actions could reduce latency? (Choose THREE.)

Quick Answer

The answer is to use SageMaker Neo to compile the model for the target instance, alongside deploying a more powerful instance and applying model pruning. These three actions directly reduce inference latency in SageMaker by optimizing the model’s execution path and computational load: SageMaker Neo compiles the model to leverage hardware-specific instructions, a more powerful instance provides faster compute throughput, and pruning removes redundant parameters to shrink the model size. On the AWS Certified Machine Learning Specialty MLS-C01 exam, this question tests your understanding of real-time inference optimization trade-offs, often appearing as a multi-select trap where you must avoid choosing increased batch size or switching to CPU instances, both of which increase latency. A key memory tip is “Neo, Power, Prune” — think of Neo optimizing the model, Power boosting hardware, and Prune cutting unnecessary weight to hit that 100 ms target.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Use a larger instance with more compute capacity

Using a larger instance with more compute capacity reduces inference time by providing more CPU/GPU power. Option B: Pruning removes unnecessary weights, reducing model size and computation. Option D: SageMaker Neo compiles the model to optimize for the target instance, improving performance. Option C is incorrect because CPU instances are generally slower than GPU instances for deep learning models. Option E is incorrect because increasing batch size typically increases latency for real-time inference as it waits for more samples.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Use a larger instance with more compute capacity

    Why this is correct

    More powerful instances reduce inference time.

  • Prune the model to remove unnecessary weights

    Why this is correct

    Pruning reduces model complexity and inference time.

  • Switch to a CPU-based instance

    Why it's wrong here

    CPU instances are generally slower than GPU for deep learning inference.

  • Use SageMaker Neo to compile the model for the target instance

    Why this is correct

    Neo optimizes models for faster inference.

  • Increase the batch size for inference

    Why it's wrong here

    Larger batch size increases latency per request.

About these practice questions

One of 1,672 original MLS-C01 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

2 more ways this is tested on MLS-C01

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A company is using Amazon SageMaker to deploy a model for real-time inference. The model requires 500 MB of memory and has a latency requirement of 100 ms. The endpoint is receiving 10 requests per second. Which instance type should be chosen for cost-effectiveness?

medium
  • A.ml.c5.xlarge
  • B.ml.t2.medium
  • C.ml.m5.large
  • D.ml.p3.2xlarge

Why C: Ml.m5.large (Option C). This instance type provides 2 vCPU and 8 GB memory, which is more than sufficient for the 500 MB memory requirement. It also offers consistent performance suitable for real-time inference with 10 requests per second and 100 ms latency. Option A (ml.c5.xlarge) has 4 vCPU and 8 GB, which is over-provisioned and more expensive. Option B (ml.t2.medium) has only 4 GB memory but uses burstable CPU, which may cause latency spikes. Option D (ml.p3.2xlarge) is GPU-optimized and significantly more expensive, making it unsuitable for a CPU-bound workload. Therefore, ml.m5.large is the most cost-effective choice.

Variation 2. A company is using Amazon SageMaker to deploy a model for real-time inference. The model receives requests with varying payload sizes. The company observes occasional latency spikes. Which feature can help mitigate this?

easy
  • A.Multi-model endpoints
  • B.Amazon Elastic Inference
  • C.Automatic scaling
  • D.Amazon SageMaker Inference Recommender

Why D: SageMaker Inference Recommender provides load testing and recommendations for instance type and endpoint configuration. It can help identify optimal settings to reduce latency spikes. Multi-model endpoints are for hosting multiple models, not directly for latency spikes. Elastic Inference is for accelerating deep learning inference, not general latency. Automatic scaling adjusts capacity but not per-request latency.

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This MLS-C01 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the MLS-C01 exam.