A model needs its feature retrieval logic at inference. What do you do?
Why D is the answer
Package a feature retrieval specification with the model
Packaging the feature retrieval specification with the model keeps training and serving features consistent.
In detail
- Packaging the specification keeps feature logic consistent with the model.
- Different feature code in serving causes skew.
Use case
An illustrative scenario, not a real incident.
A fraud model needs the same features at inference. Packaging the feature retrieval specification with the model keeps them consistent.
See it in different ways
stateDiagram-v2 [*] --> WhenNeeded WhenNeeded --> Online: during a request WhenNeeded --> Batch: large volume, can wait Online --> Deployments: stable URL, several deployments Batch --> [*] Deployments --> [*]
flowchart LR S0["Model and specification"] --> S1["Deployed"] --> S2["Request arrives"] --> S3["Features retrieved"]
Key point: Package feature retrieval with the model.
Why the other options are wrong
- A. Ask each caller to rebuild the features in its own code
- Callers rebuilding features causes skew.
- B. Train a new model for each request that arrives
- Training per request is absurdly costly.
- C. Store the features in the endpoint's display name
- A display name is not storage.

