ML-SYSTEMS
    beginner

    ML Systems: An Overview

    ML Engineer path · lesson 60 of 80
    The idea
    Hiring a forecaster instead of writing a rule. A rule is right every time and only for the case you wrote it for. A forecaster is usually right, generalises to cases you never considered, needs to be paid continuously, and will quietly get worse as the world changes. Whether that trade is good depends entirely on the problem.
    How to use
    Step the five clauses of the definition — each one is a way a project can be the wrong shape for ML, and each has a characteristic failure.
    “Machine learning is an approach to (1) learn (2) complex patterns from (3) existing data and use these patterns to make (4) predictions on (5) unseen data.”
    Does the system have the capacity to learn?
    A relational database is not ML — it answers questions from what you put in it, and nothing about it changes as a result of answering them.
    Fails as · A lookup table dressed as a model.
    Four more conditions where ML shines
    It is repetitive
    Most ML algorithms still need many examples, and repetition is what makes a pattern learnable at all.
    Wrong predictions are cheap
    Recommender systems are the biggest use case precisely because a bad recommendation is forgiving. Self-driving is the counter-case — a mistake can lead to death — and is pursued anyway because the benefits outweigh the costs once the system is statistically safer than a human driver.
    It is at scale
    The up-front investment in data, compute, infrastructure and talent needs volume to amortise. And a problem that looks like one prediction is often a series: a US presidential election model may re-predict every hour.
    The patterns keep changing
    Hardcoded rules go stale. "Today an indication of a spam email is a Nigerian prince, but tomorrow it might be a distraught Vietnamese writer."
    Three conditions under which ML should not be used
    It is unethical.
    Simpler solutions do the trick.
    It is not cost-effective.
    And even then, the answer is rarely all-or-nothing: break the problem into components and use ML for some of them. Predict whether a query matches an FAQ; if it does, route to the stored answer, and if not, route to a human.
    What is complex to a machine is not what is complex to you
    Raising a number to the power of ten is trivial for a machine and tedious for a person. Deciding whether there is a cat in a picture is the reverse. The reason this matters at project-selection time is that engineers consistently estimate difficulty on the human scale, and the human scale is the wrong one.

    Key insight

    The clause that fails most often in practice is the fifth. A project can satisfy every other condition and still fail because the production distribution drifts away from the training distribution — which is not a modelling problem and cannot be fixed by a better model.

    Should this be ML at all?

    Sort

    Sort each property of a problem by which way it points.

    Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.

    Points toward ML

    Drop items here

    Points away from ML

    Drop items here
    6 pieces left to place

    Test your knowledge

    20 questions
    Question 1 of 20
    Score: 0

    Which of these fails the "complex patterns" clause of the definition of ML?

    The short version

    Hiring a forecaster instead of writing a rule. A rule is right every time and only for the case you wrote it for. A forecaster is usually right, generalises to cases you never considered, needs to be paid continuously, and will quietly get worse as the world changes. Whether that trade is good depends entirely on the problem.

    In more depth

    ML Systems: An Overview

    An ML system is not the algorithm. It is the business requirements, the interface, the data stack, the logic for developing, monitoring and updating models, and the infrastructure.

    MLOps is a set of tools and best practices for bringing ML into production. ML systems design takes a system approach to MLOps — considering the system holistically so all components and stakeholders satisfy the objectives.

    When to use ML — a five-part checklist

    "Machine learning is an approach to (1) learn (2) complex patterns from (3) existing data and use these patterns to make (4) predictions on (5) unseen data."

    Patterns are different from distributions: we know a fair die's distribution and there are no patterns in it. Zip code → state is a lookup; rental price from listing characteristics is not.

    Four amplifiers: it's repetitive · wrong predictions are cheap · it's at scale · the patterns keep changing.

    Three stop conditions: it's unethical · simpler solutions do the trick · it's not cost-effective. Even then, break the problem into components and use ML for some.

    Research vs production — Table 1-1

    ResearchProduction
    RequirementsSOTA on benchmarksDifferent stakeholders, different requirements
    Computational priorityFast training, high throughputFast inference, low latency
    DataStaticConstantly shifting
    FairnessOften not a focusMust be considered
    InterpretabilityOften not a focusMust be considered

    Stakeholders disagree

    The restaurant app with a 10% service fee: ML engineers want a better model, sales wants expensive restaurants, product wants under 100 ms, the platform team wants no updates, the manager wants margin. Model A (most clicked) and Model B (most money) are different models, and neither meets 100 ms. Resolution: decouple objectives — one model per objective, combined at serving time.

    Latency

    10 ms latency = 100 q/s. Batch 10 at 10 ms/batch = 1,000 q/s at the same latency. Batch 50 at 20 ms = 20 ms latency and 2,500 q/s — both improved.
    Latency is a distribution. 100, 102, 100, 100, 99, 104, 110, 90, 3,000, 95 ms averages 390 ms. Use p50, p90, p95, p99.
    Akamai (2017): 100 ms delay can hurt conversion by 7%. Booking.com (2019): ~30% more latency cost ~0.5% conversion. Google (2016): >half of mobile users leave after three seconds.

    Not like traditional software

    Software assumes code and data are separated. ML systems are part code, part data, part artifacts — so you must version the data too, and that's the hard part. Not all samples are equal: a cancerous lung scan among a million normal ones is worth far more.

    Interview Questions

    Google
    Meta
    Amazon
    Stripe
    Netflix
    Uber
    DoorDash
    Meta
    Amazon
    Google
    Booking.com
    Cloudflare
    Google
    Microsoft
    Apple
    Anthropic

    Love this visualization?

    Sign up to track your progress, earn achievements, use the AI assistant, and access your personal learning dashboard.

    100% free • No credit card required