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 fraud model that labels the same user fraudulent today and legitimate tomorrow can disrupt downstream systems and undermine trust. Consistency metrics assess whether model outputs remain similar under specified changes to inputs or training conditions. They complement accuracy: a useful model should not change its behavior unexpectedly when the situation has not meaningfully changed. section 5.2.1

For input perturbations, compare the model’s output on the original input with its output on a modified version. Where invariance is expected, the difference should tend toward zero. The relevant transformation depends on the application: a small lighting change should usually not alter a vision model’s output, and substituting synonyms should not change a sentiment prediction. section 5.2.1

Consistency can be checked under different conditions:

  • Repeated execution: Given the same input, check whether the model produces the same prediction each time. section 10.5.1
  • Input changes: Compare predictions before and after a transformation that should preserve the result, or a small perturbation that should not change it significantly. section 5.2.1 section 10.5.1
  • Retraining: Compare outputs for unchanged inputs across model releases, including releases trained with new data or different random seeds. 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 similar fraud-probability estimates for a user across model releases. section 5.2.1

Property-based testing can generate inputs and check expected invariants. Choose those properties for the product: consistency matters especially when a small input change or routine model release could have a significant effect on users. section 10.5.1 section 5.4

Data-pipeline consistency is a related but distinct concern. Ambiguous labels can make training and validation difficult; a protocol for resolving ties can help annotators apply labels consistently. Reproducible preprocessing also helps prevent missed steps from creating data inconsistencies. section 6.6

How Machine Learning System Design covers it

How deep it goes
Defines output invariance and describes comparisons across perturbations and retraining, but does not specify a concrete metric implementation.
Examples
Uses lighting changes, synonym substitutions, and fraud predictions across model releases to illustrate consistency.
What you can do after
Evaluate model consistency by comparing predictions under relevant perturbations, repeated execution, and retraining.
How it connects
Connects consistency to invariance, robustness, property-based testing, accuracy, and reproducible preprocessing.

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.