webzuweb/epoche-shortcut-experiment
Epoche: teaching one model to bracket a shortcut prior A small, fully reproducible experiment on shortcut learning: a two-path classifier learns handwritten digits while a color prior is made correct in 99% of training examples. We then test whether the same model can be trained to temporarily "bracket" (switch off) that prior and fall back to evidence-only inference — an idea borrowed, loosely, from Husserl's epoche (ἐποχή, "suspension"). This repository contains the code… See the full description on the dataset page: https://huggingface.co/datasets/webzuweb/epoche-shortcut-experiment.
Epoche: teaching one model to bracket a shortcut prior
A small, fully reproducible experiment on shortcut learning: a two-path classifier learns handwritten digits while a color prior is made correct in 99% of training examples. We then test whether the same model can be trained to temporarily "bracket" (switch off) that prior and fall back to evidence-only inference — an idea borrowed, loosely, from Husserl's epoche (ἐποχή, "suspension").
This repository contains the code, per-seed results, aggregated CSVs, bootstrap CIs and all figures behind the article. Everything runs offline on CPU in a few minutes.
- Data:
sklearn.datasets.load_digits(identical to the HF mirror `sklearn-docs/digits`, 1,797 × 8×8 digits). - Compute: CPU, PyTorch. 6 training schemes × 3 test environments × 10 seeds.
- Author: Viacheslav Golitsyn (webzuweb).
The setup in one paragraph
Each digit gets a 10-valued color prior. In training the color equals the label with probability ρ = 0.99. The model has an explicit evidence path (pixels) and an explicit prior path (color). We evaluate three passes: full (both inputs), bracketed (prior zeroed), prior-only (evidence zeroed), across three shifts: ID (ρ=0.99), Unbiased (ρ=0.10), Anti (ρ=0.00, the color always lies).
Headline results (10 seeds, 100 epochs)
Honest negative control. Simply zeroing the color branch of a plain ERM model after training already reaches 88.86% on Anti. The extra Epoche training adds only +0.64 pp over that post-hoc baseline (paired bootstrap 95% CI [+0.17; +1.17]).
The substantive result is not raw OOD accuracy but a switchable model: the dual configuration keeps +5.19 pp ID accuracy over evidence-only (95% CI [+4.44; +6.00]) while matching its robustness once the prior is explicitly bracketed.
Reproduce
pip install -r requirements.txt
python epoche_experiment.py --output-dir results --seeds 10 --epochs 100
# faster smoke test:
python epoche_experiment.py --output-dir results_smoke --seeds 2 --epochs 30Extra analysis figures (forest plot, cliff, per-seed spread, heatmap):
python extra_charts.pyWhat's in this repo
epoche_experiment.py # full experiment (model, losses, 6 methods, metrics, figures)
extra_charts.py # 4 additional charts from the saved results
requirements.txt # torch, numpy, scikit-learn, pandas, matplotlib
README_verification.md # independent reproduction notes (numbers matched to 2nd decimal)
results/
results.md # summary table
deployment_summary.csv # per method/mode means + stds
summary_results.csv # all metrics, mean/std over seeds
per_seed_results.csv # raw per-seed metrics
paired_bootstrap.json # paired differences + 95% CIs
config.json # exact hyperparameters
training_curve_seed0_*.csv
figures/*.png # 9 figuresKey hyperparameters
AdamW, lr=0.01, weight_decay=3e-4, 100 epochs, 60/20/20 stratified split, sensor noise σ=0.20. Dual weights (α,β,γ)=(0.10,0.02,0.02); robust (0.50,0.10,0.10). Full config in results/config.json.
Loss (three-view Epoche)
$$ \mathcal L = \operatorname{CE}(z^{full},y) + \alpha\,\operatorname{CE}(z^{brk},y)
- \beta\, JS(p^{full}\Vert p^{brk}) + \gamma\, D{KL}(p^{prior}\Vert U{10}). $$
Intended use & limitations
This is a controlled diagnostic, not a benchmark win. It assumes the suspicious prior is known in advance (a dedicated branch). A single 8×8 toy benchmark cannot show that the method beats GroupDRO/JTT/ReBias on natural images — the planned next step is `grodino/waterbirds` with worst-group metrics. Use it to study the mechanism, teach the idea, or as a starting point for a stronger evaluation.
Citation
@misc{golitsyn2026epoche,
title = {Philosophy as Inductive Bias: Bracketing a Shortcut Prior (Epoche)},
author = {Golitsyn, Viacheslav},
year = {2026},
note = {Reproducible experiment, sklearn-docs/digits}
}References
- Geirhos et al. Shortcut Learning in Deep Neural Networks. Nature MI, 2020. https://doi.org/10.1038/s42256-020-00257-z
- Arjovsky et al. Invariant Risk Minimization. 2019. https://arxiv.org/abs/1907.02893
- Sagawa et al. Distributionally Robust Neural Networks for Group Shifts. ICLR 2020. https://arxiv.org/abs/1911.08731
- Bahng et al. Learning De-biased Representations with Biased Representations. ICML 2020. https://proceedings.mlr.press/v119/bahng20a.html
- Liu et al. Just Train Twice. ICML 2021. https://proceedings.mlr.press/v139/liu21f.html
License
MIT (see license in the metadata above).
