Where tonight sits
The two numbers quoted across the whole track, 0.949 held out and 0.765 shifted, are not symmetrical. The first comes from a split, which is a procedure. The second comes from a design decision somebody made about how the world changes, and a different decision would have produced a different number. Tonight is about making that decision defensible, because the shifted column is only as good as the argument behind it. Session 5 asks what happens once people start choosing models against it.
★ What you walk out with tonight. Three rules for designing a shift, each with the failure it prevents. The exact construction of the Thornbury shifted set, one argument different from the held-out set, so you can see where a stress test lives in code. The sentence a passed stress test licenses, and the three sentences it does not. And D'Amour et al.'s five application domains as the answer to anyone who says this is a hospital problem.
LiveA stress test is a scored set, not a technique4 min▶
There is nothing clever in the machinery. A stress test is a second evaluation set, built so that one named thing about the world is different, and scored with the same metric on the same trained model. No retraining, no new features, no change to the model at all. At Thornbury the named thing is the ward arrangement, and the difference between the held-out set and the shifted set is a single argument in the generator moving from 0.90 to 0.50.
What makes it hard is not the code, it is the argument for why that shift and not another. Anyone can perturb a column and produce a drop. A drop only means something if the perturbation corresponds to a change the world can actually make, which is why the design rules in Part 2 are about justification rather than about method.
Self-studyThe words that will keep coming back4 min▶
- Stress test. Scoring a trained model on data built so one named aspect of the world differs from the collection conditions.
- Named shift. A change you can describe in a sentence about the world, with a mechanism, before you write the code that produces it.
- Input shift. The relationship between the features and the outcome changes. The outcome itself is still generated the same way.
- Label shift. The outcome changes. A drop measured after moving labels is not a fact about the model.
- The licensed claim. The one sentence a passed stress test supports, which always names the shift it was run under.
- The unenumerable remainder. Every shift you did not think of. It does not shrink when you pass the ones you did.
A narrow claim, held firmly
13 min liveThe Thornbury shifted set answers one question well. Twenty models that were indistinguishable held out separate on it, and the separation is measurable: reliance on the ward from 0.70 to 1.00, shifted accuracy spread across 0.051 on draw 1. That is a strong result about one shift, and it is silent about everything else.
LiveThe sentence you may write, and the one you may not4 min▶
Licensed: "scored on patients from a year in which the ward no longer agrees with the outcome, this model falls from 0.949 to 0.765, and its measured reliance on the ward is the figure printed beside it." Every clause names something that was done. A reader can disagree with the design of the shift, and that disagreement is productive because the design is on the page.
Not licensed: "the model is robust to distribution shift." That sentence is about a category, and the test was about one member of it. It is also the sentence that gets written, because it is shorter and because the robustness section of a document is usually read as a verdict rather than as a list of what was tried.
Ask for the list, not the verdict. "Which shifts did you score it on" produces a short honest answer, usually one or two, and everybody in the room can then see the remainder. "Is it robust" produces a yes.
LiveFive domains, one result4 min▶
D'Amour et al. (2020) is a forty-author paper, and the author list is doing work. Their stress tests span computer vision, medical imaging, natural language processing, clinical risk prediction from electronic health records, and medical genomics. Different data types, different teams, different pipelines, and the same finding: many predictors with equally strong held-out performance, behaving differently once they were scored somewhere else.
That breadth is the answer to the most common deflection, which is that the effect is an artefact of one field's data or one team's habits. Thornbury is a small simulation built to make the mechanism visible and checkable. The evidence that the mechanism is general is theirs, not this bench's.
Three rules for a shift worth scoring
13 min liveEach rule exists because a specific bad stress test is easy to write and looks exactly like a good one in the write-up. The rules are about the design, not the code, and the third one is the one teams break after the run rather than during it.
LiveWhy the labels must stay where they are4 min▶
Corrupting labels in the stress set produces a drop reliably, which is what makes it tempting. It measures nothing about the model. Flip one outcome in five and a perfect model is now scored wrong on one row in five, because the thing predictions are compared against has been made wrong. Every model in the pool loses ground together, and the number that comes out is a property of the corruption.
The Thornbury shift keeps the outcome mechanism untouched and moves an input's relationship to it. A patient with a given vitals drift and lab trend deteriorates with exactly the same probability in the deployment year as in the collection year. What changed is which ward that patient is in, which is a fact about hospital administration and not about physiology. A model that never used the ward scores the same in both worlds, and that is the property the test is built to expose.
LiveAn open disagreement: named shifts, or a broad battery5 min▶
The rules above take one side of a live argument, and the other side is not foolish. The named-shift position says a perturbation with no mechanism behind it produces a number nobody can act on: if you cannot say what in the world would do that to your data, a drop tells you nothing about deployment and an absence of a drop tells you less.
The battery position says that the shifts which break models are, almost by definition, the ones nobody anticipated, so restricting yourself to shifts you can justify guarantees you only ever test the failures you already feared. On this view a wide sweep of arbitrary perturbations is a detector for underspecification rather than a forecast of deployment, and a pipeline whose outputs scatter under nonsense perturbations is telling you something real even though the perturbations are not.
Both positions are held by people who have shipped models that failed. They disagree about what the number is for: evidence about a deployment, or evidence about a pipeline. The practical reconciliation, which neither camp fully accepts, is that they are different measurements and should be reported under different headings rather than averaged into a robustness score.
Self-studyWhere the shift comes from when you cannot simulate it4 min▶
Thornbury can regenerate its deployment year because the world is a function. Real projects usually cannot, and the substitutes are ordinary: hold out a later time period rather than a random slice, hold out one site or region entirely, score on the subgroup whose intake process changed last year, or use data collected before and after a known policy change as two worlds.
Each of those is a named shift with a mechanism, which is the only property that matters. A held-out year is a stress test if you say what you expect to have changed in it, and it is just another random split if you do not. Generalisation of an experiment to a new population is a different subject and belongs to learn-experimentation-with-phoebe; the question here is a fitted model scored somewhere else.
Build the Thornbury shifted set
16 min build-alongThe whole stress test is one argument. Below is the generator that produces both worlds, the three lines that call it, and the mistake that looks identical in a diff.
Write the sentence before the code. "The group reorganises its wards, so the ward stops agreeing with who deteriorates." If the sentence needs the code to make sense, the shift has no mechanism behind it yet.
Find the one parameter that carries it. At Thornbury it is the agreement rate between the ward and the outcome. One argument, one value in each world, and a diff a reviewer can read in a second.
Check the label line is untouched. Read the generator and confirm the outcome is drawn the same way on both sides. This is the step that gets skipped, and skipping it is how a stress test comes to measure its own corruption.
Score without retraining. The same trained model, the same metric, the new rows. Any retraining turns a stress test into a different experiment about whether the pipeline can learn the new world.
Report both numbers and the shift. Held out, shifted, and the sentence from step one. Two numbers with no sentence between them is the shape most robustness sections already have.
Write down what you did not test. A ward that reverses rather than decays, a new intake process, a different patient mix. The list is short to write and it is the part a reader cannot reconstruct.
The habit to keep. Every robustness claim gets a shift named in the same sentence as the number. "0.765 once the ward stops agreeing with the outcome" survives a reader asking what was tested; "robust to shift" does not. And keep the list of untested shifts next to the tested one, because the person reading your summary in six months will otherwise assume the list is empty.
Three questions
A model passes the Thornbury stress test: it scores 0.949 held out and barely moves on the shifted set. What may go in the summary?
One shift was scored, so one claim is licensed and it names that shift. Other shortcuts may exist and would only appear under stresses nobody built, and the category word "robust" turns a result about one member into a claim about all of them.
A colleague builds a stress set by flipping one outcome in five, and reports that accuracy fell sharply. What did they measure?
Moving the labels changes what the predictions are being compared against, so the drop is a property of the manipulation rather than of the model. A stress test has to leave the outcome mechanism alone and move an input's relationship to it, which is what the single argument in the Thornbury generator does.
Why does the D'Amour et al. paper span computer vision, medical imaging, natural language processing, clinical risk prediction from electronic health records and medical genomics?
Forty authors across five application areas found many predictors with equally strong held-out performance behaving differently under stress. A single-domain result invites the reply that the domain is unusual, which is exactly the reply the breadth removes.
Before session 5
30 minTake the shift sentence you wrote after session 3 and put it through the three rules. Does it name a mechanism the world actually has? Does it move an input rather than the outcome? Then write the claim that passing it would license, in one sentence that mentions the shift. Most first drafts fail rule two without noticing, usually by resampling the outcome to change the base rate. Bring the sentence and the claim. Session 5 asks what happens once a set like this starts being used to choose between models rather than to describe one.