Serving & Train/Serve Skew

Identical weights can fail if the features differ. Skew, feature stores as optional infrastructure, point-in-time correctness, freshness, latency breakdown and fallbacks.

Train / Serve Skew
▶ lab

The weights are identical in training and production. The features are not. A model can be exactly right about inputs it will never see again.

Q · The offline evaluation was strong, the artifact was promoted unchanged, and production quality is poor. What is different about the inputs?
Feature Stores
▶ lab

A feature store is optional infrastructure that makes one feature definition serve both training and low-latency inference, with lineage attached. It is one answer to skew, not a prerequisite for ML.

Q · Three teams compute "customer 30-day spend" three different ways and each ships a model on their own version. When is shared feature infrastructure worth its cost, and what does it actually guarantee?
Point-in-Time Correctness
▶ lab

A training example at time T may only use information that existed at T. The as-of join is how you build that, and the offline store exists to make it cheap.

Q · Our training set joins each event to the customer's "current" features. Which of those features existed when the event happened, and how do I build the join so the question cannot arise?
Feature Freshness
▶ lab

Features update in seconds, minutes, hours or days. The model was trained on values of a particular age, and the serving architecture must deliver the same age or the model is reading a different signal.

Q · How fresh do the features need to be, and does the serving path deliver the same freshness the training set had?
Latency Breakdown
▶ lab

A prediction request is parsing, feature fetch, preprocessing, model compute, postprocessing and network. The model is rarely the slow part for tabular systems, and almost always is for large networks.

Q · The prediction endpoint is over its latency budget. Which of the six stages is actually consuming it, and at p50 or at p99?
Throughput vs Latency
▶ lab

Throughput is predictions per unit time; latency is how long one waits. Batching raises the first by spending the second, and queue depth — not CPU — is the signal that says you are running out of both.

Q · We need more predictions per second without blowing the per-request latency budget. Which of batching, concurrency and autoscaling buys what, and what does each cost in latency?
Serving Fallbacks
▶ lab

When the model or its features are unavailable, the system must return something defined: the previous model, a rule, a cached score, a default ranking, or an explicit "no prediction". Which one is a product decision.

Q · The model server is down, or the feature store is slow. What does the endpoint return, who decided that, and does the caller know it happened?