|
Download wikitext2_gpt2_bae/README.md from corrected-lds/data: direct link, hf CLI and curl.
- Browser
- Download file 15.3 kB
-
https://huggingface.co/datasets/corrected-lds/data/resolve/main/wikitext2_gpt2_bae/README.md
- Command line
-
hf download hf://datasets/corrected-lds/data/wikitext2_gpt2_bae/README.md
-
curl -L -o README.md https://huggingface.co/datasets/corrected-lds/data/resolve/main/wikitext2_gpt2_bae/README.md
15.3 kB
| # wikitext2_gpt2_bae | |
| A **companion** bank for [`corrected-lds`](https://github.com/simonvary/corrected-lds), | |
| built on EleutherAI **bergson**'s retrain harness rather than our own `pools/runner.py`. | |
| > **Read this first.** This bank reproduces the **Bae et al. 2024** GPT-2/WikiText-2 | |
| > setup as packaged in bergson's `examples/replicate_bae_approx_unrolling_source/` — | |
| > **not** the experiment in bergson's own paper (arXiv:2606.11660, Table 2), whose | |
| > recipe and published EK-FAC LDS (0.318) differ. | |
| > | |
| > **It reproduces the published number.** On the default `pool.npz` (eval-mode readout), | |
| > bergson's EK-FAC scores **0.4562** over Bae's five seeds, against the example's | |
| > **0.468 ± 0.015**. The pool this bank shipped before (0.3506, a "24 SE gap") was read | |
| > with **dropout active** — that was the whole discrepancy. The same models' dropout | |
| > readout is kept, explicitly labelled, as `pool_dropout_readout.npz`. | |
| > | |
| > **2026-10-25: grown to 400 masks x 20 seeds** (from 100 x 10). The first 100 masks and | |
| > seeds 1004-1013 are the previous release's cells bit for bit; every pool_tda now covers | |
| > all 400 masks and equals the previous release on masks 0-99. Numbers on | |
| > the new bank are in "Results on the 400 x 20 bank"; the tables computed on 100 x 10 are | |
| > kept and labelled as such. | |
| ## Shape | |
| ``` | |
| wikitext2_gpt2_bae/ | |
| ├── pool.npz DEFAULT — eval-mode readout (dropout off) | |
| │ R=20 seeds x M=400 masks x Q=481 queries, n_train=4,656 | |
| ├── pool_dropout_readout.npz the SAME 8,000 models, read with dropout ON | |
| │ (bergson's in-loop readout; stamped readout="dropout") | |
| ├── tauq_ekfac_bergson.npz bergson's EK-FAC, ONE full-data model (seed 1004), unprojected | |
| ├── tauq_ekfac_e10.npz our EK-FAC (kronfluence), 10 full-set runs, seeds 30000-30009 | |
| ├── tauq_ekfac_e5.npz the first 5 of those runs (seeds 30000-30004) | |
| ├── pool_tda_ekfac.npz the 10 runs, replica-resolved (R_tda = 10; E=5 = the first 5) | |
| ├── tauq_source_L3_e1.npz SOURCE (L=3, Adam variant), ONE model: bergson's scorer at | |
| │ the pin + the #511 fix, on our seed-30000 run | |
| ├── tauq_tracin_e10.npz our TracInCP over the same 10 runs x 6 half-epoch ckpts: | |
| │ the 48 transformer Linears, a fresh 16,384-dim projection | |
| │ per checkpoint | |
| ├── pool_tda_tracin.npz the 10 runs, replica-resolved (R_tda = 10) | |
| ├── tauq_trak5_e{2,4,10}.npz our TRAK, Eq. 15 units of 5: E = 2, 4, 10 (10/20/50 members) | |
| ├── tauq_trak1_e{10,20,50}.npz our TRAK, single members averaged: 10, 20, 50 members | |
| ├── pool_tda_trak5.npz the 50 members as 10 Eq. 15 units, replica-resolved | |
| └── pool_tda_trak1.npz the 50 members one by one, replica-resolved (R_tda = 50) | |
| ``` | |
| Our EK-FAC and TracIn both trace the 48 transformer Linear layers (the tied `lm_head`/ | |
| `wte`, `wpe` and LayerNorms excluded), as kronfluence and Bae et al.'s IF do. SOURCE is | |
| bergson's implementation (the pinned commit plus upstream fix #511, which restores the | |
| EK-FAC inverse in the Adam variant; without it SOURCE scored 0.13-0.17 here) at Bae et al.'s | |
| settings: 3 segments over the 6 half-epoch checkpoints, the Adam preconditioner, damping | |
| 1e-8, on our seed-30000 run (disjoint from the ground-truth seeds). | |
| Our TRAK follows the protocol of this repo's qnli bank: members trained on their OWN | |
| random halves (seeds 10000-10049) -- here by bergson, each half saved as a dataset of its | |
| own (873 steps), not by weight-zeroing -- one featurize pass giving both `trak5` (Eq. 15 | |
| over units of 5) and `trak1`. It traces EVERY parameter, as qnli's TRAK does: on five | |
| members the 48 Linears scored 0.120 against 0.169 for all parameters (TRAK's kernel | |
| inverse whitens the tied embedding that swamps TracIn's dot product). The model output | |
| is the sum of per-token log-odds (TRAK App. F.3) and `Q` the mean over tokens of | |
| `1 - p`; projection k = 2,048, the peak of a 512-4,096 sweep and the `k < n/2` guard. | |
| The members' eval-mode query loss (3.156-3.162) sits on the pool's half-data retrains | |
| (3.158). | |
| | field | value | | |
| |---|---| | |
| | model | GPT-2 (124M), fine-tuned from the base checkpoint per (mask, seed) | | |
| | data | `EleutherAI/bergson-wikitext-2-4656-chunks` @ `971da0e6da181b9e147081087f1d3fd51669024c` | | |
| | recipe | AdamW, lr 3e-5 constant, batch 8, 3 epochs (1,746 steps), wd 0.01, fp32, dropout ON in training | | |
| | alpha | **0.5** (masks keep a random half) | | |
| | seeds | 1004-1023. **Replicas 0-4 (seeds 1004-1008) are Bae's R=5 protocol exactly**; slice `margins[:5, :100]` to compare with published numbers | | |
| | masks | M=400 from `sample_subsets(400, 4656, 0.5, 777)` (prefix-stable: masks 0-99 are the original bank's) | | |
| | queries | the **full 481-doc validation split** — the battery the 0.468 averages over | | |
| | readout | per-query cross-entropy; `margins = -loss` (higher = better); raw `losses` ride along | | |
| | built with | bergson @ `0ad2e5b0ce09207d2af0e80383fe2d952dd8e747`, `nproc_per_node: 1`, `--save_models` | | |
| ## Two readouts of the same models | |
| bergson's `validate` loop at the pinned commit never calls `.eval()` when `train_mode` is | |
| on, so the query losses it logs are read **with dropout active**. bergson's published | |
| 0.468 re-reads saved models in eval mode. We retrained every (mask, seed) cell with | |
| bergson at the pinned commit, saved every model, and read each one ourselves in eval mode | |
| (`corrected-lds read-bergson-retrained`) — that is `pool.npz`. bergson's own in-loop | |
| readout of the same runs is `pool_dropout_readout.npz`, which also carries the per-replica | |
| full-data `baselines`. | |
| Dropout at evaluation is most of the seed noise of the in-loop readout (measured on the | |
| 100 x 10 bank): | |
| | (mean over queries) | `pool.npz` (eval) | `pool_dropout_readout.npz` | | |
| |---|---|---| | |
| | seed-noise variance, total | 8.78e-05 | 6.99e-04 | | |
| | per-replica offset `c(r)` (cancels) | 2.31e-05 (26%) | 6.98e-05 (10%) | | |
| | residual (attenuates) | 6.53e-05 | 6.36e-04 | | |
| | lambda (median over queries) | **0.37** | **3.86** | | |
| The dropout pool reproduces the bank's original pool: for seeds 1004-1008 its cells on | |
| masks 0-12 match to ~4e-6, and its 5-seed EK-FAC LDS is 0.3499 vs the original 0.3506. | |
| The other cells are fresh dropout draws (bergson's dropout RNG carries across the models of | |
| one `validate` call, so only chunks aligned with the original run are bit-identical). | |
| ## Results on the 400 x 20 bank (2026-10-25) | |
| Every score file on the default eval-readout `pool.npz`, R=20 seeds, M=400 masks | |
| (`corrected-lds evaluate`; jackknife SE in brackets; columns are the result JSON's | |
| `spearman`, `corrected_rho_inf`, `bridged_rho_inf`, `debiased_noise_corrected_spearman`): | |
| | tauq | naive Spearman | corrected rho_inf (SE) | bridged rho_inf | debiased + noise-corrected | | |
| |---|---|---|---|---| | |
| | `ekfac_bergson` (bergson, 1 model) | 0.4782 | 0.4938 (0.0022) | 0.4782 | 0.4836 | | |
| | `ekfac_e10` (ours, 10 models) | 0.4772 | 0.4931 (0.0022) | 0.4776 | 0.4825 | | |
| | `ekfac_e5` (ours, 5 models) | 0.4759 | 0.4918 (0.0022) | 0.4763 | 0.4813 | | |
| | `source_L3_e1` (bergson's, 1 model) | 0.4723 | 0.4887 (0.0022) | 0.4732 | 0.4776 | | |
| | `tracin_e10` (ours, 10 runs) | 0.1267 | 0.1321 (0.0028) | 0.1263 | 0.1282 | | |
| | `trak5_e10` (ours, 50 members) | 0.2274 | 0.2380 (0.0025) | 0.2280 | 0.2300 | | |
| | `trak1_e50` (ours, 50 members) | 0.2274 | 0.2380 (0.0025) | 0.2281 | 0.2301 | | |
| | `trak5_e4` (ours, 20 members) | 0.2079 | 0.2178 (0.0026) | 0.2086 | 0.2103 | | |
| | `trak1_e20` (ours, 20 members) | 0.2080 | 0.2179 (0.0026) | 0.2087 | 0.2103 | | |
| | `trak5_e2` (ours, 10 members) | 0.1856 | 0.1946 (0.0027) | 0.1863 | 0.1877 | | |
| | `trak1_e10` (ours, 10 members) | 0.1856 | 0.1946 (0.0027) | 0.1863 | 0.1877 | | |
| With four times the masks the jackknife SE roughly halves; the corrected values sit within | |
| about two of the 100 x 10 bank's SEs of the values below (e.g. `ekfac_e10` 0.4931 vs | |
| 0.4842, `trak5_e10` 0.2380 vs 0.2397). | |
| ## Results on the original 100 x 10 bank (masks 0-99, seeds 1004-1013 of these pools) | |
| Mean per-query Spearman across the 100 masks, averaged over the 481 queries (bergson's | |
| aggregation), for bergson's EK-FAC, by number of seeds averaged in the readout: | |
| | seeds | 1 | 2 | 3 | 4 | **5** | 6 | 7 | 8 | 9 | 10 | | |
| |---|---|---|---|---|---|---|---|---|---|---| | |
| | eval (`pool.npz`) | .4063 | .4354 | .4445 | .4512 | **.4562** | .4585 | .4609 | .4627 | .4632 | .4637 | | |
| | dropout | .2222 | .2789 | .3115 | .3357 | **.3499** | .3585 | .3696 | .3786 | .3856 | .3899 | | |
| Every score file, naive LDS vs the corrected estimates (`corrected-lds evaluate`; | |
| jackknife SE in brackets): | |
| | pool | R | tauq | naive | corrected rho_inf | bridged | debiased | | |
| |---|---|---|---|---|---|---| | |
| | eval | 10 | `ekfac_bergson` (bergson, 1 model) | 0.4637 | 0.4845 (.0047) | 0.4693 | 0.4763 | | |
| | eval | 10 | `ekfac_e10` (ours, 10 models) | 0.4633 | 0.4842 (.0046) | 0.4690 | 0.4758 | | |
| | eval | 10 | `ekfac_e5` (ours, 5 models) | 0.4627 | 0.4833 (.0047) | 0.4682 | 0.4752 | | |
| | eval | 10 | `source_L3_e1` (bergson's, 1 model) | 0.4622 | 0.4824 (.0047) | 0.4673 | 0.4747 | | |
| | eval | 10 | `tracin_e10` (ours, 10 runs) | 0.1194 | 0.1233 (.0056) | 0.1180 | 0.1227 | | |
| | eval | 10 | `trak5_e10` (ours, 50 members) | 0.2267 | 0.2397 (.0055) | 0.2298 | 0.2331 | | |
| | eval | 10 | `trak1_e50` (ours, 50 members) | 0.2267 | 0.2397 (.0055) | 0.2299 | 0.2331 | | |
| | eval | 10 | `trak5_e4` (ours, 20 members) | 0.2102 | 0.2227 (.0054) | 0.2135 | 0.2160 | | |
| | eval | 10 | `trak1_e20` (ours, 20 members) | 0.2102 | 0.2228 (.0054) | 0.2136 | 0.2161 | | |
| | eval | 10 | `trak5_e2` (ours, 10 members) | 0.1874 | 0.1973 (.0058) | 0.1890 | 0.1927 | | |
| | eval | 10 | `trak1_e10` (ours, 10 members) | 0.1872 | 0.1973 (.0058) | 0.1890 | 0.1924 | | |
| | eval | 5 | `ekfac_bergson` | **0.4562** | 0.4848 (.0051) | 0.4696 | 0.4764 | | |
| | eval | 5 | `ekfac_e10` | 0.4559 | 0.4846 (.0050) | 0.4694 | 0.4761 | | |
| | eval | 5 | `ekfac_e5` | 0.4553 | 0.4838 (.0050) | 0.4686 | 0.4755 | | |
| | eval | 5 | `source_L3_e1` | 0.4548 | 0.4827 (.0049) | 0.4676 | 0.4750 | | |
| | eval | 5 | `tracin_e10` | 0.1165 | 0.1221 (.0060) | 0.1169 | 0.1217 | | |
| | eval | 5 | `trak5_e10` | 0.2221 | 0.2388 (.0055) | 0.2290 | 0.2321 | | |
| | dropout | 10 | `ekfac_bergson` | 0.3899 | 0.4737 (.0057) | 0.4590 | 0.4633 | | |
| | dropout | 10 | `ekfac_e10` | 0.3904 | 0.4743 (.0056) | 0.4596 | 0.4636 | | |
| | dropout | 10 | `ekfac_e5` | 0.3896 | 0.4730 (.0056) | 0.4583 | 0.4627 | | |
| | dropout | 10 | `source_L3_e1` | 0.3869 | 0.4689 (.0057) | 0.4543 | 0.4591 | | |
| | dropout | 10 | `tracin_e10` | 0.1023 | 0.1246 (.0062) | 0.1193 | 0.1217 | | |
| | dropout | 10 | `trak5_e10` | 0.2049 | 0.2492 (.0065) | 0.2391 | 0.2442 | | |
| | dropout | 5 | `ekfac_bergson` | 0.3499 | 0.4860 (.0071) | 0.4717 | 0.4759 | | |
| | dropout | 5 | `ekfac_e10` | 0.3504 | 0.4867 (.0069) | 0.4724 | 0.4759 | | |
| | dropout | 5 | `source_L3_e1` | 0.3483 | 0.4813 (.0070) | 0.4672 | 0.4730 | | |
| | dropout | 5 | `tracin_e10` | 0.0909 | 0.1245 (.0078) | 0.1193 | 0.1226 | | |
| | dropout | 5 | `trak5_e10` | 0.1834 | 0.2574 (.0070) | 0.2473 | 0.2513 | | |
| The two readouts disagree by 0.07-0.11 in naive LDS and agree to ~0.01 once corrected: | |
| the dropout readout is the same signal under ten times the noise, and the correction | |
| recovers it. | |
| **Published references.** bergson's example README: EK-FAC IF **0.468 ± 0.015** (eval | |
| readout, five seeds), and "kronfluence reports 0.44". Bae et al. 2024 print no WikiText-2 | |
| numbers; their Fig. 6 bars (alpha 0.5, R=5; read off the figure, ±0.005) are IF 0.43 (one | |
| model) / 0.445 (ten models), SOURCE 0.44 / 0.47, TracIn 0.10, RepSim 0.01. | |
| Our EK-FAC (kronfluence) matches bergson's to ≤0.001 on every pool. Its corrected LDS | |
| on the eval pool is flat in the number of runs averaged: 0.4687 (1 run), 0.4833 (5), | |
| 0.4842 (10), so ten of our runs land level with bergson's single model (0.4845). | |
| **SOURCE (one model) scores 0.4548 on Bae's five seeds (0.4622 at R=10)**, against | |
| bergson's 0.475 ± 0.015 and Bae's ≈0.44. On the same model (seed 30000) it beats our | |
| EK-FAC by +0.0135 (paired SE 0.0018), Bae's single-model ordering (SOURCE 0.44 > IF 0.43), | |
| and it beats each of our ten single EK-FAC runs (0.447-0.453); one SOURCE model matches | |
| our ten-run EK-FAC (0.4633). It is level with bergson's single-model EK-FAC (0.4637, | |
| difference -0.0015 ± 0.0023), which scores above every one of our single EK-FAC runs. | |
| **Our TracIn scores 0.1165 on Bae's five seeds (0.1194 at R=10), against Bae's ≈0.10.** | |
| Like theirs it does not improve with more runs: corrected 0.1222 for one run, 0.1233 for | |
| ten. The TracIn this bank shipped before scored 0.055: it traced all 124M parameters, | |
| where the tied `wte`/`lm_head` carries ~91% of the gradient norm, and one 1,024-dim | |
| projection per run lost half of what remained. | |
| **Our TRAK scores 0.2221 on Bae's five seeds (0.2267 at R=10; corrected 0.2397) with 50 | |
| members.** Bae et al. omit TRAK on WikiText ("no public LM implementation"), so there is | |
| no published reference. Unlike EK-FAC and TracIn here it keeps rising with members -- | |
| corrected 0.083 for one member, 0.169 for one unit of five, 0.223 at 20, 0.240 at 50 -- | |
| and stays well below EK-FAC. `trak5` and `trak1` agree to 1e-4 at equal members. | |
| ## Two properties that make this bank unlike the others here | |
| **1. `seed_mode = "shared-per-replica"`.** bergson uses ONE seed per replica, shared | |
| across that replica's masks, where our other banks seed every *cell*. The readout | |
| decomposes as `y[r,j,q] = mu(S_j) + c(r) + eps(r,j)`, and the per-replica offset `c(r)` | |
| shifts a whole column, so it **cancels** in a correlation across masks and does not | |
| attenuate rho. `evaluate_pool` reads the stamp and uses | |
| `estimator.seed_noise_variance_centred` for such a pool (corrected-lds `main` since | |
| 2026-10-06). | |
| **2. Masks are applied by zeroing loss weights, not by retraining on the subset.** | |
| Batching and data order are identical across masks — a *different counterfactual* from | |
| our CIFAR/QNLI/ImageNet banks. A companion measurement, not another entry in that series. | |
| ## Loading | |
| Listed in corrected-lds's `banks-manifest.json`, which pins every file's sha256: | |
| ```bash | |
| corrected-lds fetch-banks --bank wikitext2_gpt2_bae | |
| corrected-lds evaluate banks/wikitext2_gpt2_bae --tauq ekfac_e10 # eval readout | |
| corrected-lds evaluate banks/wikitext2_gpt2_bae/pool_dropout_readout.npz --tauq ekfac_e10 | |
| ``` | |
| ```python | |
| from corrected_lds import load_pool, load_tauq | |
| from corrected_lds.estimator import seed_noise_variance_centred, seed_offset_variance | |
| pool = load_pool("wikitext2_gpt2_bae/pool.npz") # eval readout, shared-per-replica | |
| tau = load_tauq("wikitext2_gpt2_bae/tauq_ekfac_bergson.npz") | |
| resid = seed_noise_variance_centred(pool.margins) # the part that attenuates | |
| offset = seed_offset_variance(pool.margins) # the part that does not | |
| ``` | |
| Identity is enforced on load: the stamped side digests must equal the `wikitext2` pins in | |
| `banks/presets.py`, which hash the int64 `input_ids` of the pinned dataset revision. The | |
| same revision is passed to bergson via `data.data_kwargs`, so both halves provably read | |
| identical bytes. Both pools carry the same masks and examples, so every tauq and pool_tda | |
| here pairs with either. | |
| ## Build record | |
| How to rebuild the bank, with each file's verification status, is in `docs/REPRODUCE.md` in the corrected-lds repository. | |