概念
Shadow variants and A/B tests
Test a new model on a live endpoint by splitting traffic (A/B) or by mirroring it to a shadow copy that no user sees.
本课尚未翻译,暂以英文显示。
- 1The application calls the endpoint.
- 2The production variant answers the caller.
- 3A copy of the request goes to the shadow variant. Its reply is dropped or logged.
- 4Production metrics go to the comparison.
- 5Shadow metrics go to the comparison.
分步说明
- 1The application calls the endpoint.
- 2The production variant answers the caller.
- 3A copy of the request goes to the shadow variant. Its reply is dropped or logged.
- 4Production metrics go to the comparison.
- 5Shadow metrics go to the comparison.
Traffic
- A/B test
- Split by weight
- Shadow test
- Sampled copy
Who answers
- A/B test
- Each variant, its share
- Shadow test
- Production only
Measures
- A/B test
- User results, accuracy
- Shadow test
- Latency, errors, outputs
User risk
- A/B test
- Some users get model B
- Shadow test
- None
| Aspect | A/B test | Shadow test |
|---|---|---|
| Traffic | Split by weight | Sampled copy |
| Who answers | Each variant, its share | Production only |
| Measures | User results, accuracy | Latency, errors, outputs |
| User risk | Some users get model B | None |
1 / 2
Traffic
- A/B test
- Split by weight
- Shadow test
- Sampled copy
Who answers
- A/B test
- Each variant, its share
- Shadow test
- Production only
Measures
- A/B test
- User results, accuracy
- Shadow test
- Latency, errors, outputs
| Aspect | A/B test | Shadow test |
|---|---|---|
| Traffic | Split by weight | Sampled copy |
| Who answers | Each variant, its share | Production only |
| Measures | User results, accuracy | Latency, errors, outputs |
2 / 2
User risk
- A/B test
- Some users get model B
- Shadow test
- None
| Aspect | A/B test | Shadow test |
|---|---|---|
| User risk | Some users get model B | None |
是什么
A SageMaker AI endpoint can host several production variants: each a model with its own instance type and count, and a weight in the endpoint configuration. A variant gets its weight divided by the sum, so 1 and 1 give 50 percent each. That is an A/B test: real users split between model A and B, and you compare results. UpdateEndpointWeightsAndCapacities changes weights on a running endpoint with no redeploy: move to 25 and 75, then give the winner 100 percent and delete the old variant. TargetVariant in InvokeEndpoint overrides the weights for one request. CloudWatch reports Invocations and Latency per variant.
是什么
A shadow variant gets a copy of live requests, but only the production variant answers the caller. The shadow response is discarded, or logged with data capture for offline checks, so nobody is affected if the new model is slow or wrong. Use it to compare latency, error rate and outputs of a new model, container or instance type before any user depends on it.
是什么
In a shadow test you set the sampling percentage (the share of requests copied) and a duration: default 7 days, maximum 30. The console shows both variants side by side. You then promote the shadow variant, which answers all requests, or remove it. On promotion, keep the production instance settings (the safe choice) or the shadow settings, after testing at 100 percent sampling. An endpoint can have one shadow variant beside one production variant. Shadow tests do not work with serverless, asynchronous, multi-model or multiple-container endpoints, Marketplace containers or Inf1 instances.
是什么
Pick by the question. “Does it run well?” needs a shadow test. “Do users do better with it?” needs an A/B test, because a shadow reply never reaches a user. A common path is a shadow test, then a small A/B share, then 100 percent.
要记住
- Production variants: weighted split. TargetVariant overrides weights.
- Shadow variant: gets a copy of requests, response discarded or logged. No user impact.
- Shadow test: 7 day default, 30 day maximum, one shadow variant per endpoint.
考试中
- “Test a new model on live traffic with no effect on users” points to a shadow variant.
- “Send 10 percent of users to the new model” points to production variant weights.
- “Send one request to a chosen model version” points to TargetVariant.
别和这些弄混
本任务内容 · 2.3
- Experiment tracking: managed MLflow
- Amazon Bedrock evaluations
- Performance baselines and drift detection
- Shadow variants and A/B tests
- Explaining model outputs
- Debugging model convergence
- Evaluating traditional ML models
- NLP and text-generation metrics
- Human evaluation and human-in-the-loop
- LLM-as-a-judge and AI output assessment
- Evaluating RAG retrieval and answers