learn-ml-epistemology-with-phoebe / Practitioner session 8 of 10
Learn ML Epistemology with Phoebe · Practitioner session 8 of 10

Leakage at the scale of a field

Kapoor and Narayanan surveyed the published record and found leakage in 17 fields, collectively affecting 294 papers, organised into a taxonomy of eight types running from textbook errors to open research problems. Tonight builds one of those failures on purpose in the Thornbury world, in about ten lines, so that the shape is recognisable the next time it arrives in somebody else's results. Then it splits the checks you can run on a paper into the ones that cost nothing and the ones nobody can run at all.

🔴 Hardest Anyone building on a published result Anyone evaluating a vendor's accuracy claim 45 min
0-3 · Welcome 3-15 · A structural failure 15-28 · Build the leak 28-45 · Reading in cost order
Part 0

Where tonight sits

Session 7 took one published number apart and wrote down what it licensed. Tonight the unit is a literature rather than a number, because the flaw in question was found 294 times across 17 disciplines and a flaw distributed that widely is a property of the conditions rather than of any team. Session 9 turns the same suspicion inward, on a finding produced right here that did not survive one more data draw.

Live = written together in the 45 minutes Self-study = the full depth, after class 🔍 Every diagram zooms

★ What you walk out with tonight. Three numbers you can cite from memory: 17 fields, 294 papers, eight types. A leak you built yourself, running against the same engine the rest of the track uses, so you have seen a stress test certify a broken model rather than catch it. A split between the checks on somebody else's work that are free and the checks that no reviewer has ever been in a position to run. And a four-rung reading order that puts the free ones first.

LiveWhat tonight is about, and what it deliberately is not4 min▶

Leakage is information about the answer reaching the model's inputs when it should not have. The held-out score then measures something other than the ability to predict, and it measures it very well, which is the problem. Hunting one down inside a single validation is a separate job with its own timing analysis and its own filing, and it belongs to learn-model-risk-with-phoebe p3.

The subject here is evidence at the scale of a literature. Kapoor and Narayanan's survey reports leakage in 17 fields, collectively affecting 294 papers, across a taxonomy of eight types spanning textbook errors through to open research problems. That range is the part that gets dropped in retellings and it is the part a practitioner needs: some of the eight are mistakes anybody can be taught to avoid in an afternoon, and some are not solved by anyone.

Self-studyThe words that will keep coming back4 min▶
  • Leakage. Information about the answer reaching the inputs. The reported score stops being an estimate of what the model can do on a case whose outcome is not yet known.
  • The prediction moment. The instant the decision has to be made. Every input has to have existed before it, and dating each input against it is the whole check.
  • Shortcut. A feature that predicts without causing, genuinely available before the outcome. Thornbury's ward. A stress test is the fix.
  • A structural failure. One produced by shared conditions rather than individual error, so it is predicted by the conditions and not by the person.
  • The printed record. What a reader actually has: a methods section, a feature list, sometimes code. Much smaller than what would be needed to verify the claim.
  • Cost order. Running checks cheapest first, because the cheap ones catch most of it and the expensive one is the only one anybody ever schedules.
Part 1 · covers the scale of the finding

Two hundred and ninety-four is not a story about care

10 min live

The first instinct on hearing the number is to form a view about the authors. It is the wrong model of what happened, and more usefully it leads to a fix nobody can implement. The alternative reading changes what you do on a Monday.

Kapoor and Narayanan, Patterns, 2023. The three numbers, and the reading that follows. 294 papers affected one shared failure mode 17 fields disciplines, not one community 8 types in the taxonomy textbook errors to open problems If nearly three hundred teams were careless The fix is vigilance and better people. Nobody can implement that. Reading stays an impression formed by whoever is senior enough to be handed the paper. Because the conditions permitted it The fix is a fixed order of checks. Cheap, repeatable, survives staff changes, works on tired people at the end of a quarter, and runs on your own results as well as everybody else's. A count of supporting papers is not a count of independent checks. Studies that share a method, a tooling stack and a review culture share the flaw too. Variety is the signal, volume is not.
🔍 Click to zoom - the right-hand panel is the only one of the two that produces an action you can take tomorrow.
LiveWhy rerunning it proves nothing4 min▶

The instinct when a result looks too good is to try to reproduce it. That instinct is well trained and, for this particular flaw, it points at the wrong property. Running the same pipeline on the same data reproduces the flaw with perfect fidelity, along with the excellent number that came out of it. A leaked result generally replicates. Everybody who runs it gets the same figure, and the figure is still not an estimate of what the model can do on a case whose outcome is unknown.

This is why an independent replication is reassurance about the wrong thing, and it is also why the checks that matter are all about provenance rather than arithmetic. Nothing in the numbers is wrong. What is wrong is where one of the columns came from, and no amount of recomputation reaches that.

Real world

A supplier answers a query about an unusually high accuracy by offering to run the evaluation again with your team watching. That is a courteous offer and it settles nothing. The question that settles something is which columns went into the model and when each of them is written, and it can be answered over email in a paragraph.

Part 2 · covers building one

Build the leak, then watch the stress test approve it

13 min live

Thornbury already has an honest failure in it: the ward predicts without causing, and the shifted set exposes it. Add one more column, written after the outcome and joined back onto the row, and the same stress test that caught the ward reports that everything is fine.

One extra column, and the direction it travelled in. At the prediction moment vitals drift lab trend ward The 24 hours pass the patient does or does not deteriorate After the outcome a field that only exists once the outcome is known joined onto the row as if it had been there at admission. That join is the leak. The honest model Held out: high. Shifted: lower, the ward stopped agreeing. The stress test fails, and the failure is the most useful output of the whole run. The model with the leaked column Held out: higher. Shifted: higher too, by construction. The column agrees with the outcome in both years, so the stress test passes and is silent. A stress test repairs a shortcut and certifies a leak. The tell is timing, and only timing.
🔍 Click to zoom - a schematic of the two runs, not measured values. The code below prints your own.
★ Build the leak, run it against the engine on this page /* ep-live.js is loaded on this page and exposes window.THORNBURY */ const T = window.THORNBURY; /* One extra column, written after the outcome and joined back onto the row as if it had been recorded at admission. Nothing about the join looks wrong in a table; the only wrong thing is when it ran. */ function withPostOutcomeColumn(rows, seed, agreement) { const r = T.rng(seed); return rows.map(row => ({ x: row.x.concat([ r() < agreement ? row.y : (r() < 0.5 ? 1 : 0) ]), y: row.y })); } const train = T.makeData(4000, 11, 0.90); /* collection year */ const held = T.makeData(2000, 22, 0.90); /* same year */ const shifted = T.makeData(2000, 33, 0.50); /* wards reorganised */ const leak = rows => withPostOutcomeColumn(rows, 909, 0.95); const honest = T.train(train, 7); const leaky = T.train(leak(train), 7); console.log('honest', T.acc(honest, held).toFixed(3), T.acc(honest, shifted).toFixed(3)); console.log('leaked', T.acc(leaky, leak(held)).toFixed(3), T.acc(leaky, leak(shifted)).toFixed(3)); /* Behavioural reliance on any one column: flip it on every row and count how many predictions change. Run it on column 2 (the ward) and column 3 (the leak) for the leaky model and compare. */ function relianceOn(model, rows, j) { let changed = 0; for (const row of rows) { const a = row.x.slice(); a[j] = 0; const b = row.x.slice(); b[j] = 1; if ((T.forward(model, a) > 0) !== (T.forward(model, b) > 0)) changed++; } return changed / rows.length; }
LiveRead the second line of output before anything else4 min▶

The honest model does what the previous sessions trained you to expect: a strong held-out figure and a weaker shifted one, because the ward stopped agreeing with the outcome when the wards were reorganised. The gap between those two numbers is what a stress test is for, and it is doing its job.

The leaked model breaks the pattern in the direction nobody looks for. Both of its numbers are strong, because the extra column was built to agree with the outcome 95 percent of the time in every set it appears in, deployment year included. A reorganisation of the wards cannot touch a column that the outcome itself wrote. The model that is unfit for any use is the one that passes the robustness check cleanly, and it will pass every other environment you can construct too.

The two reliance numbers finish the picture. Session 2 measured the honest model flipping its mind on 7 patients in 10 or more when only the ward changed. Run the same flip on the leaked model and that reliance collapses, because it has found a better column to read; run the flip on the leaked column instead and the dependence has moved there. On a dashboard the first half of that reads as a model that stopped depending on a fragile feature, which is exactly what everybody has been asking it to do.

Self-studyWhy this arrives without anyone deciding to do it3 min▶

Nobody writes the line above on purpose. The realistic version is a join: a table of patients, a table of events, one key, and a merge that pulls in whatever the events table holds for that patient. Some of what it holds was written during the episode and some was written when the episode closed, and the merge has no opinion about which. The resulting frame looks entirely ordinary, with one column per thing you might want to know.

The reason a timing check has to be run per column rather than per table is sitting in that sentence. A table is not early or late. Individual columns are, and the ones that are late are usually the informative ones, which is why they survive feature selection so comfortably. Tracking a suspected leak back through a pipeline to the join that produced it is the practitioner job owned by learn-model-risk-with-phoebe p3.

Part 3 · covers what review can reach

What a reviewer could have caught, and what nobody could

8 min live

A reader has a methods section, a feature list and sometimes released code. That is a much smaller object than the thing that produced the number, and the boundary between the two is fixed. Knowing exactly where it sits stops both the wasted effort and the false comfort.

The boundary is fixed, and it is not where most reviews assume it is. What the printed record can settle 1 · Is the split unit stated at all? 2 · Is any listed input dated after the moment? 3 · Is the candidate count behind the score given? 4 · Is the entity behind one row named? All four are answered by reading, in minutes, without the data and without the code. An unanswerable one is itself an answer. What no reviewer could settle 1 · Whether a field that looks timely is filled by a process that runs later. 2 · Whether one entity sits on both sides of the split under two identifiers. 3 · Whether the released code is the path that produced the table. None of these are visible in a paper. Review reads a description of how evidence was produced, never the production itself. So the checkable set is small and fixed, and the response is a default applied to every result rather than a sharper reviewer.
🔍 Click to zoom - the left panel is four questions long, and answering all four takes less time than reading the abstract twice.
LiveThe one on the left that people skip4 min▶

Of the four checkable questions, the split unit is the one that gets waved through. A sentence saying the data were split into training and test does not say what was split: rows, patients, episodes, sites, weeks. Those are five different experiments and four of them can put the same underlying thing on both sides. The sentence looks complete because it uses the right words, and a reader who is scanning for the word split finds it and moves on.

The check is to read that sentence and ask which noun it names. If it names no noun, write that down rather than assuming the obvious one. Assuming the obvious one is how a reader converts a gap in the record into a fact, and doing it silently means nobody downstream can tell it happened.

Self-studyWhy the right panel is the structural half3 min▶

Peer review is strong at catching claims that do not follow from the evidence reported, and that strength is real. It has no purchase at all on how the evidence was produced, because that part arrives as a paragraph of prose written by the people who produced it. A reviewer reads that a held-out set was used and has nothing to check the sentence against. Nobody has behaved badly and no amount of additional care changes the shape of the problem.

That is what makes the finding structural rather than a story about three hundred teams. The conditions, the incentives and the format of the record all permitted it, and the same conditions currently apply to whatever your own team is about to publish or ship. A filter applied only to external evidence has a hole in the middle, and the hole is where the work you are most invested in sits.

Part 4 · covers the reading order

Cheapest first, because the cheap ones catch most of it

8 min live

The order matters more than the list. Run the free checks on everything, always, and reserve the expensive one for the claims a real decision rests on. Reversing that order is how teams end up doing a thorough job on one paper a year and nothing on the rest.

Four rungs. The order is the method. free 1 minute Find the sentence that names the split unit. If there is no such sentence, that absence is the finding and it goes in your notes. free 5 minutes Date every listed input against the prediction moment. Anything you cannot date is the shortlist, and the shortlist is usually very short. cheap 1 hour Ask whether one entity can sit on both sides of the split. The same patient, episode or site under two identifiers. Cheap to ask, rarely asked. costly days Rerun it on data you control. The only rung that settles an absolute claim, and the only one worth scheduling a person for. The first two cost nothing, need no data and no code, and carry almost all of the return.
🔍 Click to zoom - two free rungs, one cheap one, and one that needs a name and a date against it.

Write the prediction moment down first. One sentence: at what instant does the decision have to be made, and what is known then. Every later question is measured against this sentence, so vagueness here makes the rest of the pass meaningless.

Quote the split sentence verbatim. Copy it out of the paper rather than summarising it. Summarising is where a missing noun gets silently filled in with the one you expected.

Date the inputs, one column at a time. A table is neither early nor late; columns are. Mark each one as before, after, or unknown. The unknown ones are the whole output of this step.

Ask the entity question in writing. Can the same patient, episode or site appear on both sides of the split under different identifiers. To a supplier this is a one-paragraph email, and the speed of the reply tells you whether it had been considered.

Record what could not be established. Not as a failure of the review. It is the honest boundary of what the evidence supports, and it is the part that a decision made six months later actually needs.

Run the same four rungs on your own most-cited result. Same order, same wording, no softer. A checklist that is only ever pointed outward stops being a checklist and becomes a rhetorical device.

Schedule the expensive rung for exactly one claim. The one carrying the largest decision. Naming the owner and the date is what separates it from an intention.

The habit to keep. When a result is unusually good, the first question is not how it was validated but when each of its inputs was written. Validation questions get answered with confidence because the team thought hard about validation. Timing questions get answered with a pause, and the pause is the finding.

Check yourself

Three questions

The leaked Thornbury model scores strongly on the held-out set and strongly on the shifted set as well. What does that pattern tell you?

The extra column was constructed to agree with the outcome in both years, so no reorganisation of the wards touches it and no harder scenario would either. A stress test repairs a shortcut, whose usefulness depends on an arrangement that can change, and certifies a leak, which does not depend on any arrangement at all.

A supplier offers to rerun their evaluation with your team watching, to settle a question about an unusually high accuracy. How much does that settle?

A leaked result generally replicates perfectly. Every run gives the same excellent figure, and the figure is still not an estimate of what the model can do on a case whose outcome is unknown. The checks that reach this are about where a column came from and when it was written, not about recomputation.

Kapoor and Narayanan found leakage in 17 fields, affecting 294 papers, across a taxonomy of eight types. Why does the scale change the procedure rather than only the mood?

Nearly three hundred teams across seventeen disciplines did not independently become careless, so the explanation has to be in the incentives, the review format and the tooling they shared. Vigilance cannot be implemented; a short ordered list of checks can, and it survives tired people and staff changes. Those same conditions also apply to your own results.

Homework

Before session 9

30 min

Run the four rungs on your own team's most-cited internal result, in order, and stop after the third. Write the prediction moment as one sentence, quote the split sentence verbatim from wherever it is recorded, mark every input as before, after or unknown, and send the entity question to whoever owns the pipeline. Then write one line predicting what the unknown column will turn out to be. Session 9 is about findings that did not survive a second look, and a prediction written before the answer arrives is the only way to know whether you were reading the evidence or your own expectations.

Sources covered

What tonight maps to

✓ Kapoor and Narayanan (2023), Patterns Leakage in 17 fields, collectively affecting 294 papers, with a taxonomy of eight types running from textbook errors to open research problems.
✓ Structural rather than careless Why the two readings produce different fixes, and why only one of them can be implemented by a real team on a real Monday.
✓ A leak reproduced in the Thornbury world One column written after the outcome and joined back onto the row, trained against the same engine, with the stress test passing and the reliance numbers moving off the ward.
✓ What review can and cannot reach Four questions the printed record settles in minutes, three it can never settle, and why replication is reassurance about the wrong property.
✓ The reading order Two free rungs, one cheap rung and one costly one, with the costly one reserved for the single claim carrying the largest decision.
◐ The finding that did not survive Session 9 turns the same scepticism on a result produced inside this track, where one more data draw destroyed the headline.
◐ Shortcut against leak, drawn precisely Leader session 5 sets the definitions side by side; tonight uses them and spends its time on the build and the reading order.
· Leak mechanics inside one validation Not covered by design. learn-model-risk-with-phoebe p3 owns the leak hunt: timing, how a post-outcome field reaches a feature list, why a noisy leak survives review, and how to file it.
· Whether a feature causes an outcome Not covered by design. learn-causal-inference-with-phoebe owns identification and what may be adjusted for; tonight is only about timing and agreement.

Session 8 cheat sheet

17 fields, 294 papers, 8 typesKapoor and Narayanan, Patterns, 2023. Textbook errors through to open research problems.
Structural, so the fix is a listVigilance cannot be implemented. Four questions in a fixed order can.
Replication reproduces the flawSame pipeline, same data, same excellent number. It is reassurance about the wrong property.
The stress test certifies itA column the outcome wrote agrees with the outcome in every environment you can build.
Date columns, not tablesA table is neither early nor late. The late columns are the informative ones.
Which noun does the split name?Rows, patients, episodes, sites, weeks. Five experiments, four of them leaky.
Unanswerable is an answerRecord it. It is the honest boundary of what the evidence supports.
Point it at yourself tooA filter used only on external evidence has a hole exactly where your own work sits.