Model Drift Response Runbook¶
Procedures for responding to model drift alerts and managing model retraining.
Understanding PSI (Population Stability Index)¶
| PSI Range | Severity | Interpretation | Action Required |
|---|---|---|---|
| < 0.10 | None | No significant drift | Monitor only |
| 0.10 - 0.25 | Moderate | Some drift detected | Investigate, plan retraining |
| > 0.25 | Significant | Major distribution shift | Immediate action required |
Moderate Drift (PSI 0.10 - 0.25)¶
Symptoms¶
- CloudWatch alarm:
tradai-{env}-drift-moderate - SNS notification with severity "moderate"
- Drift monitor Lambda detected PSI between 0.10-0.25
Assessment¶
-
Check drift details in DynamoDB:
-
Review recent backtest metrics:
-
Identify affected metrics:
- Which features have the highest PSI contribution?
- Are market conditions significantly different?
Response Options¶
Option 1: Continue monitoring - If drift is minor and model still performs acceptably - Set reminder to check in 24 hours
Option 2: Schedule retraining
# Trigger retraining via Lambda
aws lambda invoke \
--function-name tradai-retraining-scheduler-${ENVIRONMENT} \
--payload '{"models": [{"name": "MODEL_NAME"}], "force": false}' \
output.json
Option 3: Reduce stake amount - Reduce exposure while monitoring - Update strategy config in DynamoDB
Significant Drift (PSI > 0.25)¶
Symptoms¶
- CloudWatch alarm:
tradai-{env}-drift-significant - SNS notification with severity "significant"
- PSI exceeds 0.25 threshold
Immediate Actions¶
-
Consider pausing trading (if not already paused):
# Update trading state to paused aws dynamodb update-item \ --table-name tradai-trading-state-${ENVIRONMENT} \ --key '{"strategy_id": {"S": "STRATEGY_ID"}}' \ --update-expression "SET #status = :paused" \ --expression-attribute-names '{"#status": "status"}' \ --expression-attribute-values '{":paused": {"S": "paused"}}' -
Trigger immediate retraining:
-
Review open positions:
- Check if any positions need manual intervention
- Consider reducing exposure
Investigation¶
- Analyze the drift:
- Review MLflow experiment comparisons
- Check if external events caused market shift
-
Verify data quality (no gaps, correct sources)
-
Check for data issues:
-
Review feature distributions:
- Compare reference vs current feature distributions
- Identify which features changed most
Model Rollback Procedure¶
If a newly trained model performs worse than expected:
-
Identify previous model version:
-
Update model reference:
aws dynamodb update-item \ --table-name tradai-model-registry-${ENVIRONMENT} \ --key '{"model_name": {"S": "MODEL_NAME"}}' \ --update-expression "SET model_version = :v, model_path = :p" \ --expression-attribute-values '{ ":v": {"S": "PREVIOUS_VERSION"}, ":p": {"S": "s3://tradai-models-${ENVIRONMENT}/MODEL_NAME/PREVIOUS_VERSION/"} }' -
Restart strategy service to pick up new model:
-
Verify rollback:
- Check strategy service logs for model loading
- Verify predictions are using correct model version
Retraining Monitoring¶
Check retraining status:¶
aws dynamodb get-item \
--table-name tradai-retraining-state-${ENVIRONMENT} \
--key '{"model_name": {"S": "MODEL_NAME"}}'
Check ECS training task:¶
aws ecs list-tasks \
--cluster tradai-${ENVIRONMENT} \
--started-by tradai-retraining
# Get task details
aws ecs describe-tasks \
--cluster tradai-${ENVIRONMENT} \
--tasks TASK_ARN
Check training logs:¶
Post-Drift Resolution¶
-
Reset drift state (after successful retraining):
-
Resume trading (if was paused):
-
Monitor closely for next 24-48 hours
-
Update incident log with resolution details