Validating New Models with Shadow Tests
This lesson explains shadow testing, which runs a new model on real requests alongside the current model without letting its responses reach users, so it can be compared safely before promotion.
Learning outcomes
After completing this lesson, you will be able to:
- Describe how SageMaker AI shadow tests copy traffic.
- Compare operational and prediction behaviour.
- Choose between shadow testing and A/B testing.
How SageMaker AI shadow tests work
A shadow test adds a shadow variant to a production endpoint. SageMaker AI copies a chosen percentage of incoming requests to the shadow variant. Callers always receive the production variant's response; shadow responses are discarded or logged through data capture for comparison. The test runs for a set duration, and a dashboard compares latency, error rates and other CloudWatch metrics of both variants.
What to compare
Operational comparisons include model latency at real request mixes, error rates, timeouts and resource utilisation, often on a different instance type. Quality comparisons use captured predictions: agreement rates with production, prediction distributions and, once labels arrive, accuracy. At the end, the shadow variant can be promoted to production in place, or the test is ended and the variant removed.
The following diagram shows how requests reach both variants during a shadow test of a new recommendation model.

Shadow test metrics
Shadow testing compared with A/B testing
Shadow testing has no user impact and suits validating stability, latency and agreement. A/B testing serves the new model's responses to a share of real users, which is needed to measure business outcomes such as conversions, but exposes those users to any defects. Teams often shadow test first, then A/B test. The following table compares them.
Shadow test or A/B test?
Moving to a new instance type
A team wants to move a recommendation model to a new version on Inferentia2 instances to cut cost, but must not risk user-facing latency or errors.
- Create a shadow test sending 50% of requests to the new variant on ml.inf2 instances for 7 days.
- Compare p99 latency and error rates in the shadow test dashboard; capture both variants' predictions.
- Check that top-10 recommendations agree for at least 95% of requests.
- Promote the shadow variant when all criteria pass.
Users never received a response from the untested variant, yet the team validated it on a week of real traffic patterns that a synthetic load test would not reproduce.
Which responses do callers receive during a shadow test?
Show answer
Only the production variant's. The shadow variant's responses are recorded for comparison.
Exam Tips
Remember for the exam
- Validate on live traffic with no user impact: shadow test.
- Callers only receive the production variant's responses.
- Compare latency, errors and prediction agreement before promotion.
- Business outcome measurement needs an A/B test instead.
- A shadow variant can be promoted to production at the end of the test.