liveBook · Manning

Consistency

As explained in Machine Learning System Design

A quantitative measure of how consistently a model or machine learning system produces similar outputs under specified changes to inputs, data, or training conditions.

A model can be accurate overall yet behave unpredictably in cases users notice. Consistency metrics assess whether its outputs stay close when inputs change in ways that should not matter. For an original input x and a small perturbation ε, the desired difference between f(x) and f(x + ε) tends toward zero. The acceptable change depends on the product, not just the model. section 5.2.1

Check consistency under the changes the system will actually face:

  • Perturbed inputs: a lighting change should not alter an image model’s output, and replacing a word with a synonym should not change a sentiment prediction. section 5.2.1
  • Repeated execution: the same input should produce the same prediction across runs. Property-based tests can check this and related invariants. section 10.5.1
  • Retraining and releases: adding data or changing a training seed should not make unchanged inputs swing unexpectedly between outcomes. section 5.2.1

A fraud decision that keeps changing

If the same user is flagged as fraudulent today, legitimate tomorrow, and fraudulent again next week, a routine model release can disrupt downstream systems and users. Compare outputs for unchanged inputs across releases, alongside ordinary prediction metrics. section 5.2.1

Figure 5.5 New model releases are fairly consistent when estimating the probability (P) of the user (U) being fraudulent (F).
figure

The figure illustrates consistent fraud-probability estimates for the same user across new model releases. section 5.2.1

Consistency also starts before modeling. If a preprocessing step is skipped when new data arrives, or labelers resolve ambiguous categories differently, training and validation become harder to trust. Document the pipeline and agree on tie-breaking rules. These data practices support consistency, but they are not themselves a metric for output stability. section 6.6 section 6.8

Use offline consistency checks when small input changes could have significant product effects. Test the transformations and release-to-release changes that matter to users rather than assuming accuracy alone captures them. section 5.2.1 section 5.4

How Machine Learning System Design covers it

How deep it goes
Defines output invariance and illustrates perturbation and retraining checks, while deferring detailed treatment of perturbations to ML system testing.
Examples
Uses lighting changes, synonym substitutions, shifting fraud decisions, and ambiguous transaction labels to show where consistency matters.
What it assumes
Assumes familiarity with models, inputs, and outputs while defining the desired invariance through a simple input-perturbation relationship.
What you can do after
Evaluate/understand output stability across relevant perturbations and model releases, and test repeated-input consistency with property-based testing.
How it connects
Links consistency to robustness, invariance, property-based testing, model retraining, and data pipeline reproducibility.

Also explained in

Compare how 20 books explain consistency →

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.