← Notes

The same model, trained twice

Retrain a model with nothing changed but the random seed and about a third of its top picks change. Any improvement smaller than that is noise, however good it looks.

Here is an experiment worth running once on any model you rely on. Train it twice on exactly the same data with exactly the same settings, changing only the random seed. Then compare what the two versions would actually have traded.

When we did this, about a third of the trades in the top tenth of the scores were different between the two. Same data, same code, same settings. A third of the portfolio changed because of a random number.

Where the randomness comes from

Modern tree ensembles are deliberately random. They train each tree on a sample of the rows, consider a sample of the features at each split, and some variants randomly drop trees while training. That randomness is what stops them from memorising the data. The cost is that any single trained model is one draw from a distribution of models that would all have been equally reasonable.

For ranking in aggregate this barely matters: the two versions agree on which candidates are generally better. At the margin of a decision rule it matters a lot, because the trades near the cut-off swap in and out with the seed.

The winner’s curse

This is where research goes wrong. Suppose you try a handful of variations: a different setting, a new feature, an alternative label. You train each one, measure the result and keep the best. The best of several noisy measurements is very likely to be one whose noise happened to be favourable. On a fresh measurement it falls back.

It happened to us cleanly. A configuration change looked like a solid improvement across three seeds. We re-measured it on six new seeds and about ninety percent of the improvement disappeared. “Better in three out of three” sounds convincing, but when the change moves predictions no more than a reseed does, three out of three is three coin flips.

López de Prado makes the general version of this point about backtest overfitting: the more variants you try, the higher the bar a winner has to clear, and a result has to be judged against how many attempts it took to find.

How we compare models now

  • Measure the seed noise first. Train the unchanged model with two seeds and record how much its picks and results move. That is the floor. A change has to beat it to count.
  • Look at the swaps. Compare the trades only the new model takes with the trades only the old one takes. If the swaps are no larger or different than between two seeds of the same model, nothing happened.
  • Judge the profile, not a single number. For the population that survives the decision rule, look at the win rate, the share of bad outcomes, the median and the worst decile. A real improvement usually shows up as a visibly healthier population. A noise improvement shows up as a fraction of a point on one average.
  • Pre-register the metric. Decide what “better” means before looking. Otherwise the metric gets chosen by whichever one moved.

None of this makes testing slower; our standard comparison takes minutes. It just makes it harder to fool yourself with a result that a different random number would have taken away.