learn-ml-production-with-phoebe / Session 1 of 6
ML in Production: The Leader Cut · Session 1 of 6

The first deployment is the middle

Most ML projects are planned as if the launch were the finish line: scope it, get the data, train the model, deploy, done. Production turns that line into a loop. The data keeps moving, the model keeps aging, and the code that surrounds the model is many times larger than the model itself and carries debts no notebook ever showed you. Tonight is the map for the whole series: the lifecycle as a loop, the small box of ML code inside the big box of system, and a readiness score that is only as good as its weakest part. You leave with a one-page readiness sheet for a system you own or are about to approve.

🟠 Advanced Leaders who approve ML launches Builders who have to run them 45 min
0-3 · Welcome 3-18 · Loop, small box, weakest section 18-40 · Build-along: one-page readiness sheet 40-45 · Q&A
Part 0

Where we start

Every session in this series is a decision a leader signs and a team then lives with: what to scope, how to roll out, when to retrain, what to watch, when to stop. None of them is a tooling choice, and all of them get made by default when nobody makes them on purpose. This first session sets out why they exist at all. A model in production is not a finished artifact; it is the smallest part of a system that has to keep working while the world it predicts moves underneath it.

🎫 Clear all three quiz questions to stamp your passport Live = presented in the 45 minutes Self-study = the full depth, after class ★ Build-along = fill it in for your own system

★ What you walk out with tonight. A one-page readiness sheet for one real ML system: its boxes and their owners, its ML Test Score by section with the minimum taken honestly, and the three debts you will pay first. Plus the sentence that reframes every launch review: "the first deployment is the middle of this project, not the end."

Part 1 · covers the ML project lifecycle

The lifecycle is a loop with a launch in the middle

5 min live

Andrew Ng's Machine Learning in Production course lays the project out in four stages: scoping, data, modeling, deployment. Drawn as a line it looks like a plan with an end. Drawn the way it actually runs, three of the arrows point backwards, and the launch sits in the middle of the timeline, not at its right edge.

THE PROJECT AS IT RUNS: FOUR STAGES, THREE ARROWS BACK first deployment before launch: weeks to months after launch: operate, monitor, retrain, retire Scoping what to work on Data define, baseline, label Modeling train, error analysis Deployment serve, monitor, maintain error analysis asks for better data retrain when the model ages live data drifts: new data to collect and label Stages as named in Ng's Machine Learning in Production. The arrows back are the work nobody puts in the first plan.
🔍 Click to zoom - the launch sits at the middle of the timeline, and everything to its right is recurring cost
LiveWhat each stage decides, and who should sign it3 min▶

Scoping decides what to work on and what success means, in business terms, before any data is touched. Session 2. Data decides what the inputs and labels are, how they are defined consistently, and what baseline the model has to beat. Modeling trains, then does error analysis to decide whether the next gain comes from the model or the data. Deployment is where the system meets real traffic: how it rolls out (session 3), how it stays fresh (session 4), what is watched (session 5).

The leader's job is at the two ends. Scoping is the only stage where "no" is still cheap. Deployment is the stage where the recurring bill starts, and it is the one most plans budget as a single line item.

Self-studyThe proof-of-concept to production gap3 min▶

Ng's lectures name the distance between "it works in the notebook" and "it works for customers" the proof of concept to production gap (reported, from compiled lecture notes; the official notes sit behind the course login). The same lectures say that in many projects maybe only 5 to 10 percent of the work is the machine learning code itself. Treat that as a practitioner's estimate, not a measurement: it is a different figure from the one in Part 2, and neither paper nor lecture measured it.

What closes the gap is not a better model. It is the work the next five sessions are about: a scoped problem with a baseline, a rollout that can be reversed, a retrain policy somebody chose, monitoring wired to actions, and a standing willingness to switch it off.

Real world

A model that was "up" the whole time. Session 4 replays two and a half years of a real electricity market, Elec2, against a model trained on its first four weeks and never touched again. Nothing crashed. Every prediction was served on time. And on the same rows, a policy that refits once a quarter is 3.75 accuracy points ahead of it, because the market the model learned no longer existed. A system can pass every uptime check and still be quietly wrong, which is the whole reason the right half of the timeline exists.

Part 2 · covers Sculley et al. 2015, hidden technical debt

The model is the small box

6 min live

In 2015 ten Google engineers led by D. Sculley published "Hidden Technical Debt in Machine Learning Systems" at NeurIPS. Its first figure is the most reproduced picture in production ML: a tiny black box labelled ML Code, surrounded by nine much larger boxes of everything else a real system needs. The caption says only a small fraction of real-world ML systems is the ML code. Here it is redrawn, with the one thing everyone budgets for in ochre.

WHAT A PRODUCTION ML SYSTEM IS MADE OF (SCULLEY ET AL. 2015, FIGURE 1, REDRAWN) Configuration Data Collection Feature Extraction Data Verification ML Code Machine Resource Management Analysis Tools Process Management Tools Serving Infrastructure Monitoring Box sizes are drawn, not measured: the paper gives the figure no numbers. Its glue-code section says a mature system "might end up being (at most) 5% machine learning code", an argument about glue code, not a survey result.
🔍 Click to zoom - every box but the ochre one is work the model's accuracy number never mentions
LiveRead the percent carefully, because everyone quotes it2 min▶

The figure is often retold as "ML code is 5 percent of an ML system". The figure itself carries no percent. The number appears later, in the section on glue code, hedged: a mature system "might end up being (at most) 5% machine learning code and (at least) 95% glue code", written as an argument for building native solutions rather than wrapping general-purpose packages. Ng's lectures offer "maybe only 5-10%" as a separate estimate. Quote either with its hedge and its author, or quote the caption, which is the claim the paper actually makes: a small fraction.

LiveThe debts a leader should be able to name4 min▶

The paper's catalogue is long. Six of its debts show up in almost every production review, and each one is a decision, not a code smell.

DebtWhat it meansThe decision it forces
Entanglement, CACE"Changing Anything Changes Everything": no input's effect is independent of the othersEvery change, even one feature, is re-validated as a new model
Undeclared consumersOther systems silently use the model's output as their inputWho is allowed to read the output, and who is told when it changes
Unstable data dependenciesAn input signal changes behaviour over time, often owned by another teamVersion the signals you depend on; give each an owner
Feedback loopsThe model influences the data it will later be trained on, directly or through the worldSession 5: what you hold out so the model cannot grade itself
Glue code, pipeline junglesMost of the code moves data in and out; joins and scrapes pile upBudget the plumbing as the product, not overhead
Changes in the external worldFixed thresholds go stale; the world moves under the modelSessions 4 and 5: retrain policy and monitoring you will act on
Self-studyThe rest of the catalogue3 min▶

Correction cascades (a model patched on top of another model, until improving the first breaks the second: the paper calls it an improvement deadlock). Underutilized data dependencies (legacy, bundled, epsilon and correlated features that add little and break often; the paper suggests leave-one-feature-out evaluations to find them). Dead experimental codepaths. Abstraction debt. Configuration debt ("the number of lines of configuration can far exceed the number of lines of the traditional code"). And four debts outside the code: data testing, reproducibility, process management and cultural debt.

Real world

The paper's own warning about dead code. Sculley and colleagues cite the Knight Capital incident, in which a firm lost $465 million in 45 minutes, apparently because obsolete experimental codepaths behaved unexpectedly. It is not an ML failure, and the paper does not claim it is. It is the reason the paper tells ML teams to delete the experiment branches they no longer run: in a system where most code is not the model, the code nobody remembers is the code that surprises you.

Part 3 · covers Breck et al. 2017, the ML Test Score

Readiness is scored by the weakest section

4 min live

Two years after the debt paper, Eric Breck, D. Sculley and three colleagues turned the warning into a checklist: 28 tests in four sections of seven, for data, model, infrastructure and monitoring. The scoring rule is the part worth stealing. Each test earns half a point if it is run by hand and documented, a full point if it runs automatically. The final score is not the total. It is the minimum of the four section scores.

FOUR SECTIONS, ONE SCORE: THE MINIMUM (CONSTRUCTED EXAMPLE) each section: 7 tests x (0, 0.5 manual, 1 automated) Features and data Model development ML infrastructure Monitoring 3.5 2.0 4.0 1.0 7 = every test automated final score 1.0: "Not totally untested, but it is worth considering the possibility of serious holes in reliability."
🔍 Click to zoom - strong infrastructure does not buy back missing monitoring; the minimum makes the weakest section the score
LiveWhy the minimum is the leader's rule2 min▶

A total would let a team with superb infrastructure and no monitoring report a healthy number. The authors take the minimum because "all four sections are important, and so a system must consider all in order to raise the score". That is a governance rule, not a statistics choice: it tells a team that the next point of readiness can only come from its weakest area, which is exactly where the next unit of effort should go.

Final scoreWhat the paper says it means
0More of a research project than a productionized system
(0, 1]Not totally untested, but it is worth considering the possibility of serious holes in reliability
(1, 2]There's been first pass at basic productionization, but additional investment may be needed
(2, 3]Reasonably tested, but it's possible that more of those tests and procedures may be automated
(3, 5]Strong levels of automated testing and monitoring, appropriate for mission-critical systems
above 5Exceptional levels of automated testing and monitoring
Self-studyWhat the 36 Google teams showed2 min▶

The authors met 36 teams across Google. None of the 28 tests was implemented by more than 80 percent of them. The one they single out, "perhaps the most important and least implemented", is monitoring test 3: training and serving are not skewed, meaning the features the model sees live are computed the same way as the features it was trained on. Session 3 comes back to it, because a shadow deployment is the cheapest way to catch that skew before customers do.

Build-along

A one-page readiness sheet for a system you own

★ 22 min · everyone builds

Pick one ML system: one you run, one you are about to approve, or one you depend on. If you have none, use the Elec2 price-direction model from session 4. Five steps, each a block you copy into a document and fill in. There are no right answers to type; there are honest ones and optimistic ones, and the sheet is only useful if it is the first kind.

ONE PAGE, FIVE BLOCKS, READ LEFT TO RIGHT 1 · the decision what it decides for whom what happens if it is off 2 · boxes, owners one box, no owner 3 · four sections 0, 0.5 or 1 per test 4 · the minimum lowest section read the band 5 · pay first three debts an owner each a date each The red box is the finding most sheets produce first: a part of the system that runs every day and belongs to nobody. The ochre block is the only number the sheet reports upward. The other four explain it.
🔍 Click to zoom - the sheet reports one number, the minimum, and names who owns closing the gap under it

Name the decision, not the model. One sentence each. The fallback line matters most: it is what the business does when the model is switched off, and if nobody can write it, the model has no safe "off".

★ Block 1 · the decisionSystem: ____________________________ It decides: ____________________________ (e.g. "which invoices get a manual check") For whom: ____________________________ Cost of a wrong yes: __________ Cost of a wrong no: __________ If it is switched off, we: _________________________ (the fallback, today) We find out if it was right after: ________ (the label delay, measured, not guessed)

Draw your nine boxes and put a name on each. Use Sculley's list as the checklist. A team name is not an owner; a person who gets paged is.

★ Block 2 · boxes and ownersConfiguration ............... owner: ________ Data collection ............. owner: ________ Feature extraction .......... owner: ________ Data verification ........... owner: ________ Machine resource mgmt ....... owner: ________ Analysis tools .............. owner: ________ Process management .......... owner: ________ Serving infrastructure ...... owner: ________ Monitoring .................. owner: ________ ML code ..................... owner: ________ Undeclared consumers we know of: ________

Score the four sections. Seven tests each. Zero if it is not done, 0.5 if someone does it by hand and writes the result down, 1 if it runs automatically. Monitoring is below; the other three sections are in the paper, and session 3 and 5 come back to the ones leaders ask about.

★ Block 3 · the monitoring section, as an exampleMonitor 1 Dependency changes result in notification .......... 0 / 0.5 / 1 Monitor 2 Data invariants hold for inputs .................... 0 / 0.5 / 1 Monitor 3 Training and serving are not skewed ................ 0 / 0.5 / 1 Monitor 4 Models are not too stale ........................... 0 / 0.5 / 1 Monitor 5 Models are numerically stable ...................... 0 / 0.5 / 1 Monitor 6 Computing performance has not regressed ............ 0 / 0.5 / 1 Monitor 7 Prediction quality has not regressed ............... 0 / 0.5 / 1 Section total: ____ / 7 Repeat for: features and data, model development, ML infrastructure.

Take the minimum and read the band. Write the lowest section score as the system's score. Resist the urge to average. Then copy the band sentence from Part 3 next to it, word for word.

★ Block 4 · the one numberData ____ Model ____ Infra ____ Monitoring ____ ML Test Score = min(...) = ____ Band: "_______________________________________________" The section holding the score down: ____________

Pick three debts to pay first. From the lowest section, or from any box without an owner. Each gets a person and a date. That list, not the score, is what the sheet is for.

★ Block 5 · pay first1. ______________________ owner: ________ by: ________ 2. ______________________ owner: ________ by: ________ 3. ______________________ owner: ________ by: ________ Next review of this sheet: ________
What you would build

Keep the sheet as data in the model's repository, not as a slide, so the score is recomputed on every review and the history shows whether it moved. A few lines are enough.

★ readiness.pySCORES = { # 0 not done, 0.5 manual and documented, 1 automated "data": [1, 0.5, 0.5, 0, 1, 0.5, 0], "model": [0.5, 0, 0.5, 0, 0.5, 0.5, 0], "infra": [1, 1, 0.5, 0.5, 0.5, 0, 0.5], "monitoring": [0.5, 0.5, 0, 0, 0, 0, 0], } totals = {k: sum(v) for k, v in SCORES.items()} score = min(totals.values()) weakest = min(totals, key=totals.get) print(totals, "score", score, "weakest", weakest) # {'data': 3.5, 'model': 2.0, 'infra': 4.0, 'monitoring': 1.0} score 1.0 weakest monitoring

Those scores are the constructed example from the Part 3 figure. The automation that turns a 0.5 into a 1, scheduled checks, alerts and pipeline tests, is built in DataOps session b6 ↗.

Date the sheet. readiness_2026-09-29.md, not readiness.md. Session 6 asks whether this system should still be running, and the answer is much easier when you can show the score it had when it launched and the score it has now.

Homework

Before session 2

30 min
  1. Finish the sheet with the people who run the system, not alone. The first disagreement about a score is usually the most useful line on the page.
  2. Find one undeclared consumer. Ask the data platform team who reads the model's output table. If the list surprises the model's owner, write it into block 2.
  3. Write the fallback in one sentence and ask the business owner whether it is true. If the honest fallback is "we would not notice", that is a finding for session 5.
  4. Bring one project that has not launched yet. Session 2 scopes it before a line of model code exists, including the version of it that uses no machine learning at all.
Check yourself

Three questions

Clear all three and session 1 gets stamped in your passport.

1 · A board slide says "Google showed ML code is only 5% of an ML system." What is the accurate version?

The figure has no numbers. The hedged 5 percent is in the text, and the 36 teams belong to a different paper, the ML Test Score, which measured test adoption, not code share.

2 · A system scores 6 of 7 on infrastructure, 5 on data, 4 on model development and 0.5 on monitoring. What is its ML Test Score?

The final score is the minimum of the four section scores, so strength elsewhere cannot hide the weakest section. The next point of readiness can only come from monitoring.

3 · Why does the lifecycle diagram put the first deployment in the middle of the timeline?

The three arrows back are the point: deployment feeds data and modeling again. "The middle" is a claim about where the work continues, not a measured ratio of durations.

Sources covered

What this session teaches, and where it came from

✓Ng, Machine Learning in Production, week 1: the ML project lifecycleStage names and week titles read on the DeepLearning.AI and Coursera pages; lecture content, including the POC-to-production gap and "maybe only 5-10%", reported from compiled lecture notes. Videos and certificate stay official
✓Sculley et al. 2015, Hidden Technical Debt in Machine Learning SystemsRead at source: Figure 1 caption and box names, the hedged 5 percent in the glue-code section, the debt catalogue, the Knight Capital citation
✓Breck et al. 2017, The ML Test ScoreRead at source: 28 tests in four sections, the half-point and full-point rule, the minimum, the six bands, the seven monitoring tests, the 36 teams and the 80 percent finding
◐The readiness sheet scoresConstructed for the figure and the code example, and labelled so

Every fact on this page, and its verification tier, is recorded in the course's source map.

Session 1 cheat sheet · pin this

Four stages, three arrows backScoping, data, modeling, deployment. Deployment feeds data and modeling again.
The launch is the middleEverything after it is recurring cost: operate, monitor, retrain, retire.
The small boxNine boxes around ML code. The caption says "a small fraction" and gives no number.
Quote the hedge"Might end up being (at most) 5%" is an argument about glue code, not a survey.
ML Test Score = the minimum28 tests, 4 sections, 0.5 manual, 1 automated. The weakest section is the score.
Every box has a personA box with no owner is the first debt to pay.