Skip to content
Tutorials Center
My learning

Topics

Lesson 2 of 41 Β· Getting Started

Technical Debt in Machine Learning Systems

See why the model is a small box in a big system: entanglement, data dependencies, feedback loops, glue code and configuration debt, with runnable examples.

Software engineers use the phrase technical debt for shortcuts that make today's work faster and tomorrow's work slower. Machine learning systems collect debt faster than ordinary code, because they add data dependencies, hidden feedback and fragile experiments on top of normal software problems. Knowing the usual kinds of debt tells you what MLOps practices are for.

In a real production system the model code is a small box. Around it sit data collection, validation, feature extraction, configuration, serving, monitoring and resource management. Most of the engineering effort and most of the failures live in those surrounding boxes.

The model is a small box

Model code A small part of the system.
Data work Collection, cleaning, validation.
Serving APIs, batch jobs, scaling.
Monitoring Quality, latency, drift.

Most debt hides outside the model.

1 / 2

Entanglement: changing anything changes everything

A model combines features in ways that are hard to separate. Add, remove or rescale one input and the weights of all the others change. This is sometimes called the CACE principle: Changing Anything Changes Everything.

Python Changing anything changes everything

Press Run (or Ctrl + Enter) to see the result here.

Program input Β· what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Dropping x2 changes the weight of x1, even though x1 itself did not change. Because of this, you cannot "improve one feature in isolation" and expect the rest to stay put. You need tests that re-evaluate the whole model.

Data dependency debt

Code dependencies are caught by compilers and linters. Data dependencies are not. If your model reads a column produced by another team, a silent change there (a unit changes from dollars to cents, a null becomes 0) will break the model without any error.

Python A silent unit change

Press Run (or Ctrl + Enter) to see the result here.

Program input Β· what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The second prediction is absurd, yet nothing raised an error. The fix is not smarter modeling but data validation at the boundary.

Feedback loops

If a model's output changes the world that produces its next training data, you have a feedback loop. A recommender that only shows popular items will only collect clicks on popular items, which makes them look even more popular. Direct loops are easy to see; hidden loops (two models that read each other's outputs) are harder.

Defenses include logging what the model would have done on a small random slice of traffic (exploration), and monitoring the distribution of predictions over time.

Pipeline jungles and glue code

Research code often grows into a "jungle": many scripts, each preparing data in a slightly different way, glued together with copy-pasted code. Up to 95 percent of such a system can be glue that adapts one library to another. The cure is a clear, tested pipeline with one place for each transformation.

Configuration debt

Hard-coded paths, magic numbers and settings spread over notebooks make it hard to know what produced a model. Treat configuration as something you version and review, as in configuration and parameters.

Other smells to watch for

  • Dead experimental code paths that nobody dares delete.
  • Undeclared consumers: other systems quietly using your model's output, so a change breaks them.
  • Training-serving skew: features computed one way in training and another way online.
  • Unrecorded runs: a good model that nobody can reproduce.

Paying the debt down

Debt Typical MLOps remedy
Entanglement Full-model evaluation tests, ablation checks
Data dependencies Schema validation, data contracts, versioned datasets
Feedback loops Logging, exploration traffic, drift monitoring
Glue code Pipelines, shared libraries, packaging
Configuration Config files, parameters in version control
Unrecorded runs Experiment tracking and a registry

You will never reach zero debt. The goal is to know where it is and to make the expensive kinds visible early.

Check your understanding

Quick check Β· 4 questions

of 4 answered You scored / 4 Β· perfect!

  1. 1. What does the principle 'Changing Anything Changes Everything' describe?

    Features are entangled in a trained model, so a change to one can shift the weights of the rest.
  2. 2. An upstream team starts sending prices in cents instead of dollars. Which debt does this expose?

    The model silently depends on an unowned data source whose meaning changed.
  3. 3. Which is the best defense against silent bad inputs?

    Validation catches broken inputs before they reach the model.
  4. 4. What is training-serving skew?

    If the two code paths differ, the model sees inputs in production that it never saw in training.

Summary

  • The model is a small part of a production ML system; most debt lives around it.
  • Entanglement, data dependencies, feedback loops, glue code and configuration are the classic sources.
  • Silent data changes cause failures without errors, so validate inputs.
  • Pipelines, versioning, tracking and monitoring are the standard ways to repay debt.

Next: MLOps Maturity Levels