Inspiration

House Edge scores you against the simulator's true probabilities, not the payouts you can see. So winning means understanding how the machines actually work, not just fitting noise. We treated it like a detective problem: find the hidden rules, then build models that use them.

What it does

For every query (a slot machine at a cutoff tick), it predicts the chance of each payout (0, 1, 2, 5, 20) using only the history before the cutoff. It blends three team models that were built separately and adds an episode-level "shared luck" correction. It scores 58.63 / 60 on main-round validation and 19.49 / 20 on adaptation-round validation.

How we built it

Build separately, then let the best model devour the rest. Each of the three of us first built our own model independently, so we'd get genuinely different approaches instead of three copies of one idea. We scored them head to head on validation: a GRU ensemble (58.33), a Bayesian state filter (58.08) and Bayesian logistic models with rule flips (58.07). The top scorer became the backbone. Instead of throwing the other two away, it "devoured" them: error analysis showed exactly where each teammate's model beat it, and we folded those strengths into one gated blend. Every merge step had to win in cross-validation to stay in.

  • Finding the structure: The true probabilities factor as P(win) × P(size | win). Each machine type has exactly two size distributions, chosen by an XOR of a lagged payout and a per-machine flip. The win chance follows an XOR rule on a pair of lags, which can flip over time in the drift and shared-change conditions.
  • Model 1 (backbone): An ensemble of 13 GRU networks for the win chance (trained in PyTorch, run as a pure NumPy forward pass), plus an exact Bayesian posterior over the lag and flip rules for payout sizes.
  • Model 2: A Bayesian state filter (teammate).
  • Model 3: Bayesian logistic models with sudden and gradual rule flips and an episode latent (teammate).
  • Gated blend: The Bayesian models do better when a machine is in its low-win state, and the GRUs do better in its high-win state. We blend in log-odds space with a two-state gate and separate weights for short histories, all chosen by 4-fold episode cross-validation.
  • Shared-luck correction: Machines in one episode share a slowly drifting luck term. We add β·x to each machine's win log-odds, where x is a recency-weighted average of the other machines' prediction errors in that episode, and β is fitted on history only.
  • Result: 58.63 / 60 on main-round validation, up from 58.33 for the best single model. The code runs offline on CPU in about 15 minutes and reproduces the submission exactly.

Round two (adaptation)

The adaptation round changed which temporal relationships drive the machines. Because we had built a one-command pipeline ahead of time, we didn't hand-tune anything:

  • Rediscovered the rules: The pipeline searched lags automatically and found the new win pairs (1,4), (2,6) and (3,8), with size lags 1 to 3.
  • Refit all three models on the new training data only: retrained the GRUs and refit both teammates' Bayesian models.
  • Re-picked the blend gate and weights by 4-fold episode cross-validation. The shared-luck correction was kept only if it improved validation.
  • Result: The blend scored 19.49 / 20 on validation (cross-validated estimate 19.46), above every single model (19.27 to 19.40). The code ZIP reproduces the submitted CSV exactly.

Challenges we ran into

  • Drift and shared-change conditions break any fixed-rule model, which is why we needed the GRUs.
  • With short histories the payout-size rule is truly ambiguous, so some of that error can't be removed.
  • We had to merge three separately written codebases into one deterministic, offline runner within the time and CPU limits.
  • The moved deadline left only 90 minutes for the adaptation round, so the whole refit had to be automated and rehearsed in advance on simulated rule changes.

Accomplishments that we're proud of

  • We recovered the simulator's hidden rules almost exactly.
  • We went step by step from 58.33 (best single model) to 58.63 by combining all three teammates' work. Every change was checked by cross-validation, not one lucky split.
  • The same approach carried over to new rules in round two, where the blend again beat every single model.
  • The submission is fully reproducible and needs few dependencies.

What we learned

  • Error analysis beats guessing. Knowing where each model is strong is what made the blend work.
  • Simple models built on the real structure and flexible neural nets complement each other.
  • Cross-validate every tweak. Stacking, recalibration and per-type gates all looked promising and all lost once tested properly.
  • Building for change pays off: rehearsing the round-two pipeline on simulated rule changes is what let us adapt in 90 minutes.

What's next for House Edge

  • Model the shared episode luck directly, instead of correcting for it after the blend.
  • Make the pipeline fully self-tuning, so it adapts to any new simulator rules with no manual steps.
Share this project:

Updates

Submission history