Sub topic 19
A maturity path from manual to continuous training
This chapter ties the earlier ones together as a sequence of stages. It assumes you know the retraining pipeline stages (validate, train, evaluate, register, roll out), the four trigger families, and basic CI/CD. The question here is which capabilities to build first, and when adding the next one is worth its cost.
Why a path matters
Teams often try to build "continuous training" in one step. They wire a drift detector to a training job and let the result deploy itself. Without data validation, an evaluation gate, and rollback, this fails in predictable ways. Bad data triggers a retrain, the retrain produces a worse model, and the model reaches production.
Each stage below depends on the one before it. Skipping a stage usually means a later safety mechanism has nothing to stand on. A drift trigger is useless if you cannot reproduce a training run. Automatic promotion is dangerous if you have no gate.
The five stages
| Stage | Name | Trigger | Promotion | Main risk |
|---|---|---|---|---|
| 0 | Manual | A person notices a problem | Person copies a file | Not reproducible |
| 1 | Scripted | A person runs a pipeline | Person decides | Forgotten retrains |
| 2 | Scheduled | Cron or orchestrator | Human approval | Wasted or needless runs |
| 3 | Signal-driven | Drift, performance, volume policy | Gate, then approval | Retraining loops, cost |
| 4 | Continuous | Policy with guardrails | Gate, canary, auto rollback | Silent systemic failure |
Stage 0: Manual
A data scientist retrains in a notebook and hands over a model file. This is fine for a first deployment. The problem is that nobody can say which data or code produced the model in production. Retraining happens when someone remembers, or when users complain.
The exit criterion is that one command reproduces the current production model from versioned inputs.
Stage 1: Scripted and reproducible
Training lives in one script, such as the train_pipeline.py from the earlier workflow example. Data snapshots, code commits, and model artifacts are versioned and linked (lineage). A person still starts the run and decides what to deploy.
This stage is mostly about reproducibility, not automation. You can already answer "what changed between model v7 and v8?" Everything later relies on that answer.
Stage 2: Scheduled with a gate
Add an orchestrator, a schedule trigger, data validation before training, and a champion-challenger evaluation gate. A registry stores candidates. A human still approves promotion.
The schedule is the right first trigger for most teams. It needs no monitoring, it is easy to explain, and it sets a maximum model age. Its weakness is that it ignores the world. It retrains when nothing changed and waits when something did.
The exit criterion is that the pipeline has run unattended for several cycles and its gate has rejected at least one bad candidate. A gate that has never rejected anything is untested.
Stage 3: Signal-driven
Add monitoring of inputs, predictions, and outcomes. Combine drift, performance, and volume signals into a trigger policy with thresholds, minimum data, and cooldowns. Keep the schedule as a backstop through a maximum model age.
Two new failure modes appear here:
- Retraining loops. A noisy drift signal fires, the new model changes behaviour, and the changed predictions shift the data, which fires the trigger again. Cooldowns and minimum-data rules limit this.
- Cost runaway. Triggers fire more often than planned. Put a budget or a cap on runs per period in the policy.
Stage 4: Continuous
The pipeline retrains, evaluates, and promotes with no person in the loop for ordinary cases. This needs shadow or canary rollout, automatic rollback on metric regression, tests for the pipeline itself, and observability of the pipeline (run duration, gate rejection rate, trigger reasons).
Continuous training is not the right goal for every model. If a model changes a few times a year, stage 2 is often the stable end state. Human approval is also a reasonable permanent control for high-stakes decisions such as credit or medical use.
Deciding where you are
A short checklist makes the stage explicit. The function below maps a set of capabilities to the highest stage whose requirements, and all earlier ones, are met.
REQUIREMENTS = [
("reproducible_run", "versioned data, code, and model lineage"),
("scheduled_pipeline", "orchestrated, scheduled runs"),
("data_validation", "validation before training"),
("evaluation_gate", "champion-challenger gate"),
("trigger_policy", "drift/performance/volume policy with cooldown"),
("canary_rollback", "canary rollout with automatic rollback"),
]
# Stage n requires every capability up to and including this index.
STAGE_NEEDS = {1: 1, 2: 4, 3: 5, 4: 6}
def maturity_stage(have):
"""Return (stage, next_missing_capability) from a set of capability names."""
names = [name for name, _ in REQUIREMENTS]
stage = 0
for s, count in STAGE_NEEDS.items():
if all(n in have for n in names[:count]):
stage = s
missing = next((n for n in names if n not in have), None)
return stage, missing
have = {"reproducible_run", "scheduled_pipeline", "data_validation", "evaluation_gate"}
print(maturity_stage(have))This prints (2, 'trigger_policy'). The ordering of REQUIREMENTS encodes the dependency: you cannot meaningfully hold trigger_policy without the gate before it.
Common mistakes on the path
- Automating promotion first. Teams automate the visible part, the deploy, and leave out the gate. Build the gate before you remove the human.
- Dropping the schedule when drift triggers arrive. Drift detectors miss slow changes and concept drift that does not show in inputs. Keep a maximum model age.
- Measuring maturity by trigger count. More triggers mean more ways to misfire. Fewer well-tuned signals usually beat many.
- Never testing the failure path. Rehearse a rollback and a rejected candidate before you rely on them.
- Ignoring the pipeline's own health. A silently failing scheduled job looks like a stable model until the model is 200 days old.
Moving up safely
Move one stage at a time and write down the exit criterion first. Keep the previous stage's manual path available for a while. When you add a new trigger, run it in log-only mode first. Record when it would have fired, compare that with when retraining actually helped, and tune thresholds before it can start a real run.
Exercise
A team runs a weekly scheduled pipeline with data validation and a champion-challenger gate, and a person approves every promotion. They want to add a PSI drift trigger that starts retraining automatically. Which stage are they at, which two things should they add or confirm before enabling the trigger, and why should the weekly schedule stay?
Show answer
They are at stage 2. Before enabling the trigger, they should define a trigger policy with a PSI threshold, a minimum new-row count, and a cooldown (to prevent loops and cost runaway), and run the trigger in log-only mode to compare when it would fire against when retraining actually helped. They should also add a run budget or cap. The weekly schedule should stay as a maximum-model-age backstop because PSI misses slow changes and concept drift that does not show in input distributions.