Sub topic 5
Define Objective Rollback Triggers
Assume you understand basic model deployment, production monitoring, alerting, version control, and APIs. This chapter shows how to turn monitoring signals into explicit rollback rules that people and automation can apply consistently.
A rollback trigger is a measurable condition that pauses or reverses a deployment. It should answer three questions:
- What signal indicates a problem?
- How bad must the problem become?
- How long must the condition last before action is taken?
Use three types of production signals
A model can appear healthy at the service level while producing harmful predictions. Monitor signals from three layers:
| Signal layer | Example measurements | Possible failure |
|---|---|---|
| Model quality | Error rate, precision, recall, calibration | Predictions become less accurate |
| System health | HTTP errors, p95 latency, timeouts | Requests fail or become slow |
| Business behavior | Approval rate, revenue, manual-review rate | Downstream outcomes change unexpectedly |
Compare current measurements with a baseline. The baseline might come from the previous production version, a validation period, or a stable control group.
A trigger should use a baseline that matches the current traffic and time period. For example, compare weekday traffic with a weekday baseline. Otherwise, normal seasonal changes can look like model regressions.
Set thresholds and observation windows
Avoid rules such as “rollback when the model looks worse.” Use a threshold and an observation window instead:
- Error rate exceeds 3% for 10 consecutive minutes.
- p95 latency exceeds 250 milliseconds for five minutes.
- The approval rate drops by more than 15% compared with the control group.
- A drift detector reports a high-severity change for two consecutive evaluation periods.
The window prevents one unusual request or short-lived dependency failure from causing an unnecessary rollback. Use a minimum sample count as well. A 20% error rate from five requests is weaker evidence than a 5% error rate from 100,000 requests.
Use separate thresholds for warning and rollback. A warning starts investigation. A rollback threshold requires action. This separation gives operators time to confirm the signal without making the decision subjective.
def should_rollback(
error_rate,
baseline_error_rate,
max_multiplier,
drift_detected,
):
error_regression = error_rate > baseline_error_rate * max_multiplier
return error_regression or drift_detected
if should_rollback(
error_rate=0.08,
baseline_error_rate=0.02,
max_multiplier=2.0,
drift_detected=False,
):
print("pause rollout and evaluate rollback")In this example, the current error rate is four times the baseline, so the function requests action. In production, add a minimum sample count, an observation window, and a record of the measurements that caused the decision.
Combine signals without hiding failures
Some triggers use AND conditions to reduce false alarms. For example, require both a quality regression and enough traffic. Other triggers use OR conditions for severe failures, such as a security violation, corrupted artifact, or sustained service outage.
Write the logic explicitly. State whether a trigger pauses rollout, sends an alert, or performs an automatic rollback. Record the version, metric values, timestamps, traffic percentage, and rule that fired.
Review triggers before automating them
Test each rule against historical incidents and normal seasonal variation. Ask whether it would have detected real failures and how often it would have rolled back healthy releases.
Start with automatic traffic pause for uncertain cases. Reserve automatic rollback for signals that are reliable, timely, and reversible. Revisit thresholds after every incident and document the reason for each change.
Exercise
A new model has a 4% error rate. The previous version has a 2% baseline, the rollback multiplier is 2.0, and the minimum observation window has not yet completed. Should the system roll back immediately?
Show answer
No. The rate reaches the threshold, but the observation window is incomplete. It should continue collecting data or pause further rollout according to the policy.