liveBook · Manning

Forward compatibility

As explained in Machine Learning System Design

The ability of older software or an interface version to work with new code or clients without changes.

Forward compatibility means allowing new code or clients to work with an older API version without changes. In ML systems, it also depends on versioning the model and its surrounding pipeline. section 13.1

Treat compatibility as a system-design responsibility:

  • Expose parameters that affect prediction when callers need control; hidden time or seed values make outputs difficult to reproduce. section 13.1
  • Version models and provide a way to request a specific version during initialization. section 13.1
  • Treat changes to models, data input/output, preprocessing, postprocessing, or dependencies as possible compatibility breaks, and reflect them in versioning. section 13.1
Listing 13.3 Adding a model version to the API
class Model:
    def __init__(self, version):
        self.version = version
        self.model = load_model(version)

    def predict(self, features, time=None, seed=42):
        if time is None:
            time = datetime.now()
        return self.model.predict(features, time, seed)

Shows how a prediction API selects a model by version while retaining controllable prediction parameters. section 13.1

How Machine Learning System Design covers it

How deep it goes
Defines the compatibility direction and discusses versioning risks, but defers complicated systems to the model registry pattern.
Examples
Uses HTTP query parameters, prediction functions, and a version-selecting model class to illustrate compatibility decisions.
What it assumes
Assumes familiarity with APIs, prediction functions, and ML pipelines while defining backward and forward compatibility explicitly.
What you can do after
Evaluate compatibility risks and configure model selection through explicit API and pipeline versioning.
How it connects
Connects forward compatibility with backward compatibility, API versioning, model versioning, reproducibility, and model registries.

Also explained in

Compare how 5 books explain forward compatibility →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning System Design. The section links point to the parts of the book it draws on.