Downloads · 30 days
48
24% of all-time downloads
mrothroc/mixlab-gptbert-masked-focus-replica
mixlab-gptbert-masked-focus-replica is a fill-mask model from mrothroc. Use it when you need the model to fill a missing word. It is set up for transformers. The card lists the license as mit.
A faithful, from-scratch reproduction of the BabyLM 2025 GPT-BERT masked-focus Strict-Small baseline (BabyLM-community/babylm-baseline-10m-gpt-bert-masked-focus), trained entirely on a single Apple-silicon GPU with mi…
Downloads · 30 days
48
24% of all-time downloads
All-time downloads
196
Public
Parameters
39.3M
315 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors157 MB · 99%
From the Hugging Face model README
A faithful, from-scratch reproduction of the BabyLM 2025 GPT-BERT masked-focus Strict-Small baseline
(BabyLM-community/babylm-baseline-10m-gpt-bert-masked-focus),
trained entirely on a single Apple-silicon GPU with mixlab, an
open Metal/MLX trainer.
This is a faithfulness demonstration for the closed 2025 challenge, not a competition entry. GPT-BERT masked-focus is not a vanilla transformer: it is a masked+causal hybrid with disentangled relative attention, a gated attention output, dense layer aggregation, and a BERT-style MLM head. Reproducing it end to end on commodity hardware is a real test of the trainer.
For the six zero-shot components, both the reference baseline and this reproduction were scored through one identical eval harness. We report the per-component comparison (no aggregate as we did not compete):
| Component | Reference baseline | This reproduction | Δ |
|---|---|---|---|
| BLiMP | 70.36 | 70.64 | +0.28 |
| BLiMP-supplement | 63.71 | 61.79 | −1.92 |
| EWoK | 51.63 | 50.88 | −0.75 |
| entity tracking | 40.14 | 40.33 | +0.19 |
| COMPS | 53.55 | 52.85 | −0.70 |
| reading (eye+SPR) | 6.39 | 7.30 | +0.91 |
| GLUE † | 66.20 | 64.18 | −2.02 |
† The six zero-shot rows are both re-scored in our harness. For GLUE, the reproduction was fine-tuned and scored here, but the reference value (66.20) is the official published baseline (baselines paper, Table 2) — we did not re-fine-tune the baseline — so the GLUE row alone is not a within-harness re-eval of the reference.
The reproduction stays within ≈2 points on every reported component. The reference column is our within-harness re-evaluation of the official 2025 baseline model; it tracks the official published numbers (baselines paper, Table 2): essentially exact on BLiMP (official 70.4), supplement (63.7), entity (40.0), COMPS (53.5), reading (≈6.4), GLUE (66.2), with EWoK the one outlier at 51.6 vs the official 50.0 (harness variance). AoA is forfeited ≈0 here: the board scores it from a per-checkpoint surprisal trajectory submitted with the predictions, not the final model, which these artifacts don't include. The AoA scorer also has a confirmed, still-open upstream bug — a log2/bits random-chance baseline with a hardcoded ~300k vocabulary instead of the model's actual size (babylm-org/babylm-eval#2) — which makes the metric noise-dominated (one fixed model spans tens of points), so we report per-component, not a macro.
The exact architecture is in the repo's
config.json
(the exported HF model config); the full mixlab spec — architecture and training recipe — is in
training_config.mixlab.json.
≈33M tied parameters (16,384 vocab × 384 dim, tied to the output head). The exported model.safetensors
additionally stores a redundant untied lm_head copy.
Exports both MixlabForCausalLM and MixlabForMaskedLM (trust_remote_code=True); native↔HF logit parity
verified (≈7e-8).
-mode arch), Metal/MLX, single Apple M1 Max GPU, ≈5.5h wall-clock, seed 42<s> segment markers inserted in the packed token stream (reference convention)<s>=1, </s>=2, <pad>=3, <mask>=4, <unk>=0)The full reproduction recipe, configs, and scripts are in the companion GitHub repo (see Reproduce). The training config used for this run is linked under Architecture above.
from transformers import AutoModelForMaskedLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("mrothroc/mixlab-gptbert-masked-focus-replica", trust_remote_code=True)
m = AutoModelForMaskedLM.from_pretrained("mrothroc/mixlab-gptbert-masked-focus-replica", trust_remote_code=True)
The full recipe (data prep with <s> markers, train, export, parity, eval), configs, and scripts are in the
companion GitHub repo. One command per step; ≈5.5h
training on an M1 Max.
BabyLM-community/babylm-baseline-10m-gpt-bert-masked-focusFor the story behind it, read I Built an ML Architecture Lab in Go.