LIVE · Thursday 3 December

Monitoring and Retraining Custom Decision Models: Log Every Decision, Investigate Drift, Retrain on Outcomes

Give each decision a stable ID that links state, options, scores, versions and the delayed outcome. Use drift alerts to start an investigation, and retrain only when labeled outcomes show a lasting drop.

By Surya12 min read

To monitor and retrain a custom decision model, log every decision under a stable decision ID with its state, eligible options, scores, and model, calibrator and policy versions. Then join the executed action and the delayed outcome to that ID. Treat drift alerts as a reason to investigate, not a reason to retrain. Retrain only when labeled outcomes show that error at your chosen coverage has stayed above an agreed limit, and release the candidate only after it beats the incumbent in shadow and canary tests.

This is the same loop that AWS, Microsoft and Google document for ordinary models: monitor, investigate, retrain, validate and deploy. A decision model needs extra fields and checks, because it picks from a list of options that changes, it can defer a case, and its outcome often arrives days later.

A decision model needs a richer log than an ordinary classifier.

An ordinary classifier takes a fixed set of features and returns a label. A decision model takes a state, such as a customer request and its context, plus a list of allowed options, and scores each option. A policy then applies a confidence threshold. Above the threshold, the model's top option is selected. Below it, the case is deferred to a person, a rules engine or a larger model.

Three gaps follow from that design. The option list can change without any change to the model, so the same model can face different choices next week. The selected option is not always the executed action, because a downstream system or a person can override it. The outcome, such as a resolved ticket or a repaid loan, usually arrives long after the decision.

AWS's Prescriptive Guidance for MLOps says that monitoring starts "by logging requests and responses for the model." It also recommends logging the data before any lossy function on the output, such as argmax. For a decision model, that means keeping the score for every option, not just the winner. Without those scores, you cannot measure calibration or test a new threshold later.

Each decision should be written as versioned events that share one decision ID.

The simplest design that works is three event types joined by one ID. The decision event is written when the model scores the options. The execution event is written by the system that carries out the action. The outcome event is written when the result is known. Each type has its own schema_version, so that fields can be added without breaking old records.

{
  "schema_version": "decision.v3",
  "decision_id": "d-2026-11-24-000123",
  "decided_at": "2026-11-24T09:15:02Z",
  "state_ref": "s3://decisions-raw/2026/11/24/d-2026-11-24-000123.json",
  "state_hash": "sha256:...",
  "segment": "phone",
  "option_set_hash": "os-v13",
  "eligible_options": ["refund", "replace", "escalate", "close"],
  "scores": {"refund": 0.71, "replace": 0.18, "escalate": 0.08, "close": 0.03},
  "model": {"base": "<base model id>", "adapter": "<adapter id>", "revision": "<commit hash>",
            "dtype": "bf16", "attention": "<serving setting>"},
  "calibrator_version": "sigmoid@2026-10-30",
  "policy": {"version": "gate@v3", "threshold": 0.80},
  "deferred": true,
  "deferred_to": "human_queue",
  "selected_option": null
}
{"schema_version": "execution.v1", "decision_id": "d-2026-11-24-000123",
 "executed_at": "2026-11-24T09:41:10Z", "executed_option": "replace", "executed_by": "agent_417"}
{"schema_version": "outcome.v1", "decision_id": "d-2026-11-24-000123",
 "observed_at": "2026-11-29T16:00:00Z", "outcome": "resolved", "correct": true}

The cloud tools require the same kind of key. SageMaker Model Monitor merges ground truth with captured predictions on an inferenceId that the caller supplies, and the caller must make the IDs match. Azure Machine Learning joins model output to ground truth on a unique ID column, and Microsoft recommends logging your own ID column to avoid the index suffixes that its data collector adds to batched rows. Generate the decision ID in your application and pass it to whichever tool you use.

Sensitive data should stay out of the monitoring tables. Store the raw state in a separate location with a short retention period, and keep only a pointer and a hash in the decision event. An S3 Lifecycle expiration rule deletes objects after a set period, and AWS's documentation states that such rules apply to existing and new objects. Keep the IDs, scores, versions and outcomes for longer, because retraining and audits need them. The retention period itself is a legal decision for your organization, not a technical default.

The model, checkpoint and serving settings must be pinned in every record.

The model block in the event is there because a decision model can change behavior without a new training run. A different checkpoint, a new numeric precision or another attention setting can change which option wins. Pin the base model, the adapter, the exact revision hash and the serving settings, and write them into every decision event. Do the same for the calibrator and the policy threshold, since a threshold change alters coverage without touching the model.

Parsec's TOD is one example of where this matters. Parsec describes TOD as a decision model that ranks the next action from a supplied list, and its repository's predict(state, options, question, images) call returns one probability per option, summing to 1. Those per-option probabilities fit the scores field directly. The release is a set of LoRA adapters on google/gemma-4-12B-it, so the base and adapter revisions both need pinning. The repository also warns against the sdpa attention setting and bitsandbytes int8 quantization, which it says change some picks. Parsec's TOD page lists a hosted price of $0.30 per 1,000 decisions, separate from the cost of any parent model. Parsec does not describe a monitoring product or a retraining cadence. Its decision-models page says that it tunes models on a customer's own decisions and builds evaluations and training sets for them.

The monitoring matrix separates signals that need labels from signals that do not.

Most useful signals can be computed the moment a decision is logged. Only two groups need outcome labels. The table lists six groups and the first cause to check when each one moves.

Signal group First cause to check Needs outcome labels
Schema and feature drift: nulls, type errors, out-of-range values, distribution shift Upstream data pipeline No
Option-set changes: new, removed or renamed options Catalog or policy release No
Prediction mix: share of each selected option, score distribution Change in the population or the model No
Calibration and error at the chosen coverage Model quality Yes
Deferral and fallback rate, p95 latency Threshold, calibration or serving No
Business outcome of executed decisions Whether decisions still pay off Yes, often delayed

Azure's built-in signals cover the first group. Its data quality signal reports null value rate, data type error rate and out-of-bounds rate, and its drift signals compare production data with training or recent production data. AWS's Prescriptive Guidance notes that schema changes can be caught with simple rules, while distribution mismatch needs a threshold that someone must choose.

Calibration matters because the policy threshold assumes that scores mean something. The scikit-learn documentation defines a well-calibrated classifier as one where, among cases given a score near 0.8, about 80% are positive. If calibration slips, a 0.80 threshold no longer delivers the coverage and error rate that you agreed on. Error at the chosen coverage measures the error rate only on the cases that the model handled, at the threshold that is live.

Delayed labels create a timing trap. A decision made yesterday has no outcome yet, so a naive join makes the most recent days look unlabeled or unusually accurate. Only evaluate decisions that are old enough for their labels to have arrived. In Azure, the lookback window offset moves the end of the data window back from the date of the monitoring run, which can be used to leave this delay. Microsoft also advises that the reference and production windows should not overlap.

Selective observation is the second trap. You see outcomes only for the actions that were executed. A deferred case shows how the fallback performed, not how the model's top option would have done. A model that defers more will look more accurate on the cases that it keeps. To measure what the model would have done, send a small random share of deferred and low-confidence cases for human labeling against the model's top option. AWS's guidance makes a related point: the best practice is to monitor the business outcome, because model metrics are often only proxies for it.

A runnable example joins delayed outcomes and emits Azure-style custom signals.

The script below is an illustrative example, not a measured result. It generates synthetic logs so that it runs on its own with pandas and numpy. Replace make_demo_logs with reads from your decision and outcome tables. It keeps only decisions older than the label delay, joins outcomes by decision_id, and computes signals per segment. It skips label-based metrics when a segment has fewer than 200 labeled decisions.

# monitor_signals.py: illustrative example, not a measured result.
# Output columns follow Azure's custom-signal schema:
# group, metric_name, metric_value, threshold_value.
import numpy as np
import pandas as pd

def make_demo_logs(n=5000, seed=7):
    """Synthetic decision and outcome logs so that the script runs end to end."""
    rng = np.random.default_rng(seed)
    t0 = pd.Timestamp("2026-11-01", tz="UTC")
    d = pd.DataFrame({
        "decision_id": [f"d{i:06d}" for i in range(n)],
        "decided_at": t0 + pd.to_timedelta(rng.integers(0, 21 * 24, n), unit="h"),
        "segment": rng.choice(["web", "phone", "partner"], n, p=[0.6, 0.3, 0.1]),
        "option_set_hash": rng.choice(["os-v12", "os-v13"], n, p=[0.9, 0.1]),
        "top_score": rng.beta(6, 2, n),
        "latency_ms": rng.gamma(4.0, 20.0, n),
    })
    d["deferred"] = d["top_score"] < 0.80
    o = d.loc[~d["deferred"], ["decision_id", "decided_at", "top_score"]].copy()
    o = o.sample(frac=0.7, random_state=seed)  # labels arrive for only some decisions
    o["outcome_at"] = o["decided_at"] + pd.to_timedelta(rng.integers(1, 240, len(o)), unit="h")
    o["correct"] = rng.random(len(o)) < o["top_score"]
    return d, o[["decision_id", "outcome_at", "correct"]]

def join_outcomes(decisions, outcomes, as_of, label_delay_days=7):
    """Evaluate only decisions old enough for their labels to have arrived."""
    mature = decisions[decisions["decided_at"] <= as_of - pd.Timedelta(days=label_delay_days)]
    known = outcomes[outcomes["outcome_at"] <= as_of]
    return mature.merge(known, on="decision_id", how="left")

def expected_calibration_error(p, y, bins=10):
    idx = np.clip(np.digitize(p, np.linspace(0, 1, bins + 1)) - 1, 0, bins - 1)
    return sum((idx == b).mean() * abs(p[idx == b].mean() - y[idx == b].mean())
               for b in range(bins) if (idx == b).any())

def signals(joined, min_labels=200):
    rows = []
    for seg, g in joined.groupby("segment"):
        accepted = g[~g["deferred"]]
        labeled = accepted.dropna(subset=["correct"])
        rows += [
            (seg, "deferral_rate", g["deferred"].mean(), 0.35),
            (seg, "label_coverage", len(labeled) / max(len(accepted), 1), 0.50),
            (seg, "new_option_set_share", (g["option_set_hash"] != "os-v12").mean(), 0.20),
            (seg, "p95_latency_ms", g["latency_ms"].quantile(0.95), 250.0),
        ]
        if len(labeled) >= min_labels:  # below this, report nothing rather than noise
            y = labeled["correct"].astype(float).to_numpy()
            p = labeled["top_score"].to_numpy()
            rows += [(seg, "error_at_coverage", 1.0 - y.mean(), 0.15),
                     (seg, "calibration_error", expected_calibration_error(p, y), 0.05)]
    return pd.DataFrame(rows, columns=["group", "metric_name", "metric_value", "threshold_value"])

if __name__ == "__main__":
    decisions, outcomes = make_demo_logs()
    joined = join_outcomes(decisions, outcomes, as_of=pd.Timestamp("2026-11-22", tz="UTC"))
    print(signals(joined).to_string(index=False))

The thresholds in the script are placeholders. No demonstration output is reported here, and nothing in this article claims a measured accuracy, coverage or latency for any model.

Each part of the script maps to a documented step on one of the major clouds:

  • The join_outcomes step does what SageMaker model quality monitoring does when it merges ground truth from S3 with captured predictions. SageMaker files labels under the date when the label was collected, not the date of the inference.
  • The output columns match the signal_metrics table that an Azure custom signal component must return. Microsoft's guide shows that custom signals are scheduled through a YAML file and az ml schedule create, because its Python SDK and studio do not support them yet.
  • The per-segment loop follows the AWS open-source replacement for Model Monitor, which runs Evidently's classification preset per segment and lets you add business tests such as approval-rate shifts.
  • The output is meant to feed the retraining triggers in Google's MLOps architecture, which lists performance degradation and significant distribution change among the triggers for a training pipeline.

Only the ID formats, the output schema and the AWS sample repository are supported vendor code. The script itself is a proposed adapter, and you would own and test it. SageMaker Model Monitor is no longer open to new customers, according to AWS, so new AWS projects need an adapter of this kind or the open-source samples. Existing users also face limits, because AWS's documentation says that Model Monitor computes metrics on tabular data only and supports only endpoints that host a single model.

A persistent alert points to one of six responses, and only one of them is retraining.

A drift alert alone should never lead to the deployment of a new model. AWS's Well-Architected guidance warns against retraining on a fixed schedule and against retraining without clear thresholds. It says to retrain only when predictive performance falls below defined KPIs. Google's MLOps architecture says that a schema skew should stop the pipeline so that the team can investigate.

Persistent alert First check Response
Null, type or out-of-range errors rise Upstream feature pipeline Repair the data, and do not retrain
New or removed options appear Catalog and policy releases Review the policy, and label decisions with new options
Calibration error rises while ranking holds Score distribution against labels Recalibrate on a recent labeled window
Deferral rate rises while error holds Threshold against score shift Review the threshold or recalibrate
Feature drift with no outcome change Segment mix Keep watching, and label more cases in the drifted segment
Error at chosen coverage stays above the limit Data and label checks are clean Build a retraining candidate

Each response needs a minimum sample and a persistence rule, set before the alert fires. A practical starting rule is at least 200 labeled decisions per segment in each window, which is the count that AWS's own capture sample collects before computing standard deviations. Add a second rule: the same breach must appear in two consecutive windows. Microsoft suggests choosing the window by data growth, daily for heavy traffic and weekly or monthly otherwise.

Recalibration has its own sample rule. The scikit-learn documentation says that sigmoid calibration works best on small samples, and that isotonic calibration matches or beats it only above about 1,000 samples. Fit the calibrator on data that was not used to train the model.

A retrained candidate replaces the incumbent only after it passes time, segment, calibration and canary gates.

A release procedure for a decision model can follow these steps, in order:

  1. Freeze a versioned label set of decisions with matured outcomes, including the randomly sampled deferred cases, and record its hash.
  2. Split it by time, with training data strictly earlier than test data. The scikit-learn TimeSeriesSplit exists because ordinary cross-validation would train on the future, and its gap parameter leaves a buffer for label delay.
  3. Compare the candidate with two baselines: the incumbent model on the same test window, and a simple rules baseline. Google's architecture requires the new model to be compared with the current model.
  4. Check every important segment separately. Google warns that an overall gain can hide large variation between groups, such as customer regions.
  5. Refit the calibrator, then measure coverage, error at coverage and deferral rate at the live threshold. A model that improves only by deferring more has not improved.
  6. Get a named person to sign off on the results before any traffic moves.
  7. Run a shadow test. In SageMaker, a shadow variant receives a copy of live requests, and only the production variant's responses reach the caller.
  8. Shift traffic with a canary and automatic rollback. SageMaker deployment guardrails move a small share first and watch CloudWatch alarms during a baking period before moving the rest.
  9. Keep the incumbent if the candidate fails any gate. Google's metadata design keeps a pointer to the previous model for exactly this rollback.

Report the results as five separate numbers: decision accuracy, coverage, whole-task outcome, latency and total cost. Merging them hides the trade-offs that the release gates are meant to expose. Do not describe any of this as a managed guarantee. Azure marks its model performance signal as a preview, and Microsoft states that previews are provided without a service level agreement.

Sources

More in Models

All Models →