Retraining strategies

Scheduled, drift-triggered and guarded retraining, and how a champion-challenger margin keeps you from shipping a worse model.

Lesson 62 of 6610 minIntermediate

You will learn to

  • Compare scheduled retraining with drift-triggered retraining
  • Use a champion-challenger margin to decide whether to promote a new model
  • Keep every retraining decision auditable and reversible

Before this lesson

Intuition

Think about a shop that restocks its shelves. It can restock every Monday no matter what (scheduled), or only when a sensor says the shelf is nearly empty (triggered). Both can go wrong: a fixed schedule wastes effort when nothing changed and reacts late when something did; a sensor can misfire.

Models have the same choices.

  • Scheduled retraining reruns training on fresh data at a fixed interval: daily, weekly, monthly. It is simple and predictable. It spends compute even when nothing changed.
  • Drift-triggered retraining retrains when monitoring says the inputs have moved or accuracy has dropped. It spends compute only when needed, but it depends on good thresholds and it can lag behind a problem that drift checks do not see.
  • Hybrid setups retrain on a slow schedule and also react to strong alerts.

Whichever you use, one rule matters more than the trigger: the new model must earn its place. The model in production is the champion. The freshly trained model is the challenger. A challenger replaces the champion only if it is better by a margin that you chose in advance. Otherwise the champion stays. Retraining on newer data does not guarantee a better model: a bad batch of data, a pipeline failure or plain randomness can make the new one worse.

Picture it

Schedule ordrift alertRetrain on thelatest dataBeats the currentmodel by the margin?noyesKeep thecurrent modelPromote anew versionWrite a decision log entry (always)
Guarded retraining. Every pass ends in a log entry, whether the new model is promoted or not.

The math

Compare the challenger and the champion on the same primary metric, mm. For metrics where higher is better (accuracy, AUC, F1, R squared), the improvement is

Δ=mchallenger−mchampion\Delta = m_{\text{challenger}} - m_{\text{champion}}

For error metrics where lower is better (MAE, RMSE, MAPE), the sign flips so that a positive number is always good:

Δ=mchampion−mchallenger\Delta = m_{\text{champion}} - m_{\text{challenger}}

Promote only if Δ>0\Delta > 0 and Δ≥margin\Delta \ge \text{margin}. The margin is either absolute (in metric units) or relative (a share of the champion's value):

required={δabsolute margin δδ⋅∣mchampion∣relative margin δ\text{required} = \begin{cases} \delta & \text{absolute margin } \delta \\ \delta \cdot |m_{\text{champion}}| & \text{relative margin } \delta \end{cases}

Why a margin at all? Every metric is measured on a sample and has random scatter. If you promote on any tiny gain, you will often replace a model with one that is only luckier, and each promotion has a cost: risk, review and a new version to track.

Worked example

Higher is better. The champion has accuracy 0.842.

RuleChallenger accuracyImprovementRequiredDecision
Absolute margin 0.010.8510.0090.0100Keep champion
Relative margin 2%0.8660.0240.842 x 0.02 = 0.01684Promote

In the first row, 0.851 is higher, but 0.009 does not reach 0.01. In the second, the improvement 0.024 is above the required 0.01684.

Lower is better. The champion has RMSE 12.4 and the challenger 11.9. The improvement is 12.4 - 11.9 = 0.5. With a relative margin of 3%, the required improvement is 12.4 x 0.03 = 0.372, so the challenger is promoted. With a relative margin of 5% the requirement would be 0.62, and the champion would stay.

After a promotion, keep an eye on the new version. If its live results disappoint, you roll back to the previous version, which is still stored unchanged.

How mlflow does it

  • What is retrained. The deployed model's pipeline recipe, rerun on the latest version of its dataset.
  • Settings. On an endpoint's Monitor tab, Scheduled retraining has Retrain on a schedule, Frequency, Primary metric (Automatic by default), Margin type (Absolute in metric units, or Relative as a percentage of the current value), Required improvement and a timeout (Give up after, in hours).
  • Run now. Starts a retrain immediately, using the same guard.
  • Promotion. Creates a new pipeline version, so the previous one stays under Versions for rollback. If the deployment is backed by the registry, a matching registry version is created too.
  • Decision log. Each decision has a status: Training, Deciding, Promoted, Kept current, Failed or Skipped, with a readable reason, the metrics compared and a link to the run.
  • Other schedules. Under Settings, Automation lists drift checks, retraining and batch jobs as scheduled tasks.

Common mistakes

  • Promoting on any improvement. Tiny gains are often noise. Set a margin that matches the scatter of your metric.
  • Comparing on different data. The champion and the challenger must be scored on the same held-out data, or the comparison is meaningless.
  • Retraining on bad data automatically. A broken data feed produces a broken model. Keep the guard, and watch the data quality of the dataset you retrain on.
  • Retraining too often. More retrains mean more versions, more review and more chances of a harmful change. Match the frequency to how fast your data really changes.
  • No way back. Never overwrite the old model. Keep the previous version so a rollback takes one step.

Try it in mlflow

Set up guarded retraining

  1. Open Deployments, click an endpoint and open the Monitor tab.
  2. In Scheduled retraining, turn on Retrain on a schedule and pick a Frequency.
  3. Choose the Primary metric, a Margin type (Absolute or Relative) and the Required improvement.
  4. Save the schedule, then choose Run now and read the Decision log.
Open in mlflow

Read in the docs

Check your understanding

  1. 1. What is the main weakness of retraining on a fixed schedule with no checks?
  2. 2. The current model has accuracy 0.842. A candidate scores 0.851. The rule is an absolute margin of 0.01. What happens?
  3. 3. Why must a retrain decision be logged even when the candidate is not promoted?