Skip to content

Running an experiment you can trust

A methodology series on the part of research that decides whether any of the rest of it meant anything: how to measure, how to compare, and how to know when a number is telling you something. It is written for method development, where you build a thing, compare it against a baseline, and have to decide honestly whether it won.

Most guides to machine-learning research are about ideas. This one is about the scaffolding around them. That scaffolding is unglamorous and it is where the failures actually happen, because a broken idea announces itself and a broken measurement does not. A metric computed on the wrong inputs does not crash. It returns a number, and the number is plausible, and it is stable across runs, and it is meaningless. By the time it reaches a results table it is wearing a suit.

The worked example

Every principle here is illustrated on a single real project, warts included: an attempt to make a JEPA representation generative for single-cell gene perturbation, and to beat the established conditional generators in that space (the CPA and scPPDM lineage) at predicting what a cell does when you activate a gene. The dataset is Norman 2019 Perturb-seq, the test is twenty held-out two-gene combinations, and the honest outcome was a loss: a from-scratch conditional VAE beat the elaborate method by a wide and statistically significant margin.

That makes it a better teaching example than a success would. A win hides your methodology, because nobody audits a result they like. A loss forces you to ask, repeatedly, is this real, or did I measure it wrong? Over the course of that project the answer was "measured it wrong" more than once, and each time the mistake was invisible from downstream. The series is organized around those mistakes.

The full method series lives at conditional-flow + JEPA, and its running scoreboard is the results ledger. You do not need either to read this series. Where a number appears here, it appears to make a methodological point, not a biological one.

The chapters

  1. What are you actually measuring? — the metric, the unit of analysis, and the single most consequential decision in an evaluation: what counts as one observation. Why an aggregate score is not a sample, why a per-item metric is, and why choosing one primary endpoint before you look is the cheapest integrity you will ever buy.
  2. The scoring seam — every metric is computed on some support: a subset of items, features, or timesteps. That subset is chosen by code you probably have not read. A worked case where the support was chosen by a plausible-looking criterion that selected entirely the wrong features, which silently pinned one metric at a constant and inverted the sign of another. The general lesson, and the acceptance gate that prevents it.
  3. Seeds, and the noise you cannot see — what a seed actually controls, why a single seed is a narrator you cannot trust, and the distinction that matters more than either: seed noise versus metric noise. In our case most of what we had attributed to seed variance turned out to be measurement variance, and fixing the metric bought statistical power for free.
  4. Ablations and controls — an A/B changes one thing. A control changes everything and asks a different question. Confusing the two is how a whole-method gap gets misattributed to a single component. Plus the structural invariant that makes ablations cheap, and the one-lever-per-arm rule that we broke and then could not un-break.
  5. From a difference to a verdict — the paired bootstrap, why pairing is not optional on a small test set, why contrasts that share arms must be resampled jointly, and how a max-\(t\) simultaneous interval keeps a family of comparisons honest. Includes the multiplicity arithmetic that made us retract a finding we had already announced.
  6. Failure modes — a catalogue of the ways an experiment lies to you, each one drawn from this project: a better training loss with a worse model (three separate times), a two-lever arm that cannot attribute its own result, a data fetch that silently overwrote correct results with stale ones, and a log stream whose silence meant nothing at all.
  7. The ceiling — the constructive turn. Once you can trust a measurement, the next question is which measurement is worth improving. Replace a stage with an oracle (the ground truth it was trying to produce), measure the ceiling, and read off whether the stage is a bottleneck or already saturated. In our case it proved the stage under active development had almost no headroom left, and relocated the real problem to a component no one had been touching. It trains nothing and it takes an afternoon.
    • 7a — Probes, and other deliberately weak instruments (companion) — the instrument behind Chapter 7's linear arm, and the family it belongs to. Why the same probe wears a logistic head to ask which perturbation and a ridge head to ask what it did; why a linear map beating a trained nonlinear decoder rules out capacity as the explanation; why an absolute probe score is meaningless without a floor. Then the rest of the toolbox, organized by the question it answers: \(k\)-NN and effective rank and CKA for the representation; the oracle ladder for the bottleneck; posterior collapse, prior-versus-aggregate-posterior mismatch, two-sample tests and variance decomposition for the generator; shuffle controls and no-op checks for the training. The selection rule throughout: ask what the instrument must be unable to fake.

The one idea

If you take a single thing from the first six chapters, take the habit they are all really about: make every stage assert something about its own output before the next stage consumes it. Not because assertions catch bugs, though they do. Because the alternative is discovering the bug at the metric, which is the worst possible place to discover anything, since a metric is precisely the thing that will hand you a confident number no matter how badly you have fed it.

And if you take a second thing, take it from the last chapter: before you improve a component, measure whether it can matter. The two habits are the same instinct pointed in opposite directions. One makes a stage prove its output is trustworthy; the other asks a stage what it could achieve if its input were perfect. Together they keep you from both computing a number you cannot trust and improving a number that cannot move.


Part of ssl-lab. The project this is drawn from: perturbation response.