# Your Prediction Logs Can't Be Joined to What Actually Happened

> Why production accuracy goes unmeasured when prediction logs lack join keys and label maturity windows, and what to log so you can score your model.

Published 2026-11-02 by Sovont. Tags: MLOps, AI Production, Data Engineering.
Web page: https://sovont.com/blog/your-prediction-logs-can-t-be-joined-to-what-actually-happened/

Ask most teams how accurate their model is in production and you'll get the offline eval number or a drift chart. You rarely get a measured accuracy figure. The ground truth exists: chargebacks get filed, customers churn, meters get read, tickets get resolved. But it lands weeks later in a different system, and the prediction log has nothing you can join it to. The model is running, and nobody can say whether it's right.

## Why the join fails

Prediction logs usually start as debugging output. Someone adds a log line at the inference endpoint, it goes to the same place as application logs, and it gets the same retention and the same shape. That works for tracing a bad request. It doesn't work for evaluation, for predictable reasons:

- **No shared key.** The log has a request ID. The outcome system keys on account ID, order ID or meter ID. Nobody captured the mapping at serving time, and reconstructing it later means guessing from timestamps.
- **No model version.** You know a prediction was made but not which artifact made it. After two deploys, every metric you compute is a blend of models.
- **No inputs.** Without the feature values as served, you can't tell whether an error came from the model or from a bad upstream value.
- **Retention shorter than label lag.** If outcomes take six weeks to arrive and logs rotate sooner, the join is impossible by design.
- **Score but no decision.** You logged 0.71 but not the threshold in effect, the business rule that overrode it, or what the user was actually shown.

None of these break anything visibly, so they survive launch. They show up the first time someone asks whether the model is degrading, and the honest answer is "we can't tell."

## What a joinable prediction record contains

Treat the prediction log as a table you'll query in three months, not a stream you'll grep tomorrow. Each record needs:

| Field | Why it matters |
|---|---|
| `prediction_id` | Unique, stable, and returned to the caller so downstream systems can store it |
| Business entity key(s) | The exact key the outcome system uses, captured at serving time |
| `model_version` + artifact hash | Separates cohorts by model; registry tag alone can be re-pointed |
| `predicted_at` (UTC) | Defines the cohort and the start of the label clock |
| Served features, or a snapshot reference | Lets you separate model error from input error |
| Raw score and final decision | Threshold, overrides and fallbacks change what "correct" means |
| Policy/config version | Thresholds and rules change independently of the model |

Write it to durable, append-only storage with retention set by your longest label lag plus room to re-run evaluations. If you version your lake, this belongs in it; the reasoning in [The Immutable Data Lake](https://sovont.com/blog/the-immutable-data-lake-versioning-for-sanity/) applies directly.

The cheapest fix with the biggest payoff is passing `prediction_id` downstream. If the order, ticket or case record stores the ID of the prediction that influenced it, the join is a key lookup instead of a forensic exercise.

## Score cohorts only after labels mature

Once the join works, the next mistake is computing metrics on predictions whose outcomes haven't finished arriving. Late-arriving labels are rarely random. Fraud confirmations, churn and defaults often trickle in, so a recent cohort looks like it has fewer positives than it will. Recall looks great, precision looks terrible, and both are artifacts of timing.

Do this instead:

1. **Measure the label arrival curve.** For a past cohort, plot the share of eventual outcomes received by days since prediction. Pick a maturity window where the curve flattens.
2. **Group by prediction date, not outcome date.** Each weekly cohort gets scored once it passes the maturity window.
3. **Report join coverage next to every metric.** The share of predictions with a matched outcome is a health metric in its own right. A drop means a broken pipeline or a changed key, not a better model.
4. **Use proxies for the gap.** Score distributions, input drift and override rates cover the window before labels mature. They're early warnings, not accuracy.

If the model's decision changes the outcome, as when a declined application never produces a repayment label, joined outcomes only describe the cases you let through. Fixing that takes a small randomized holdout or an explicit counterfactual policy, and it's a product decision as much as an engineering one.

## A check you can run this week

Pick predictions from one cohort that should be mature by now and try to score them:

```sql
SELECT p.model_version,
       COUNT(*) AS predictions,
       COUNT(o.entity_id) AS with_outcome,
       ROUND(COUNT(o.entity_id) * 1.0 / COUNT(*), 3) AS join_rate
FROM predictions p
LEFT JOIN outcomes o
  ON o.entity_id = p.entity_id
 AND o.event_at >= p.predicted_at
WHERE p.predicted_at >= DATE '2026-08-01'
  AND p.predicted_at <  DATE '2026-08-08'
GROUP BY p.model_version;
```

If you can't write this query because a column doesn't exist, that's your backlog. If you can, a low or uneven join rate across versions tells you where the keys are leaking.

## What it costs

Logging full feature vectors for every request adds storage and write load, and at high volume that's real money. Two compromises hold up: log keys, version, score and decision for every request, and log full features for a stratified sample that over-weights rare classes and low-confidence scores. Store features by reference to a feature-store snapshot if you have one.

The larger cost is coordination. Getting `prediction_id` into a downstream system means another team changes a schema. Do it before launch, while you still have leverage. Without it, you're stuck with the pattern in [The Model That Passed Eval and Failed in Production](https://sovont.com/blog/the-model-that-passed-eval-and-failed-in-production/): learning about failures from users instead of from your own metrics. Retraining decisions also need these mature cohorts, or they're scheduled on guesswork.

If you want a second set of eyes on whether your models can be scored in production at all, start with a [production audit](https://sovont.com/#audit).
